Score:1

How to run Python code using Codon in Ubuntu

ss flag

I have a Python code, and I wanna use Codon to run it. To do this, I first need to install it. I copy and paste the code /bin/bash -c "$(curl -fsSL https://exaloop.io/install.sh)" in terminal. Every time that I run this code, it install codon again and I face the following results.

PATH export command:
  export PATH=/home/aaron/.codon/bin:$PATH
Could not find bash configuration file to update PATH
Codon successfully installed at: /home/aaron/.codon
Open a new terminal session or update your PATH to use codon

My Python file called code.py is in Downloads folder. Now, to run the code, I open the terminal in Downloads folder, I use the command codon run code.py. However, when I do this, I face the following error. I would be thankful if you could let me know how to fix it.

Command 'codon' not found, did you mean:
  command 'codonw' from deb codonw (1.4.4-6)
Try: sudo apt install <deb name>

I should add that I just installed Ubuntu and I am not familiar with it. I am a Windows user!

Score:1
us flag

Add the following line to your $HOME/.bashrc file.

export PATH=/home/aaron/.codon/bin:$PATH

Then run source .bashrc (once and for all).


Afterwards, you should be able to run codon run code.py

Aaron avatar
ss flag
Thank you so much. In my code, I imported some libraries like numpy, scipy, matplotlib, pandas, etc. When I want to run it, I face some errors like ```code.py:1:8-13: error: no module named 'numpy'```. is it possible to run it with codon using all libraries in anaconda?
Aaron avatar
ss flag
When I use the code ```python code.py``` in terminal, it runs the code. But when I use codon, I face that error/
us flag
I don't know how to get numpy to work with codon (I am not familiar with Codon at all). Please open an issue at GitHub and ask a question there.
us flag
Also see - https://github.com/exaloop/codon/issues/224#issuecomment-1466119313 which says "Codon does not support numpy yet".
Aaron avatar
ss flag
I really appreciate your help.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.