0

I'm a newbie to python. Trying to compile a file in mac terminal.

I did python file_name.py

Gives me following error: /Users/XXX/Library/Enthought/Canopy_64bit/User/bin/python/activate: no such file or directory

I have previously installed Canopy and selected "Yes, use Canopy as python default". Now how do I fix this? Appreciate it.

NewbieDave
  • 1,199
  • 3
  • 12
  • 23
  • I suspect you didn't get the error message right. *Copy* it from the terminal, then edit out your username if you care. (If you did copy it, you can ignore this, but I'd be surprised to see `Entought` or capitalized `User` in the file path.) – user2357112 Sep 18 '13 at 05:50
  • Now its correct. I just edited. – NewbieDave Sep 18 '13 at 05:58

1 Answers1

2

Do you still have Canopy installed? If so, you can go into the Canopy preferences and turn off Canopy as default.

If Canopy is gone:

sudo nano /Users/<username>/.profile

or, if that's not found

sudo nano /Users/<username>/.bash_profile

And then remove the line referring to Canopy. Control+X -> Y (to save buffer) and you should be all set. To test, type python and ensure that the Python interactive shell comes up. exit() will get you out of there and then you can try running your program again.

c1phr
  • 590
  • 5
  • 14
  • Thank you so much @C1phr. You are awesome. Could you please explain little bit how did the removal work? Like why is that i go into sudo nano /Users/username/.profile and save it would remove the line referring? Thank you. – NewbieDave Sep 18 '13 at 06:19
  • It appears that Canopy does it with an external file, but essentially it was aliasing the `python` command to Canopy's Python interpreter in the shell. Removing that line from the `.profile` prevented that alias from being established. If my solution helped you out, please remember to mark it as such with the check mark so that others know you got it all sorted out. – c1phr Sep 18 '13 at 06:39
  • Hi, actually, I have one more question. Whenever i start my terminal, I got this error msg ~bash:/Users/XXX/Library/Enthought/Canopy_64bit/User/bin/python/activate: no such file or directory everything else works fine – NewbieDave Sep 18 '13 at 07:09
  • When i get into nano profile. this was nothing in there. So I just saved it. – NewbieDave Sep 18 '13 at 07:11
  • Whoops, I forgot the second file. Nano into that .bash_profile and check in there. I just edited my answer. – c1phr Sep 18 '13 at 16:20