Search code examples
pythoncompilationenthoughtcanopy

How to change python compile directory


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.


Solution

  • 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.