简体   繁体   中英

OSX: Setting Enthought python path in .bash_profile results in weird terminal behavior

I followed the knowledge base on adding this to the .bash_profile

PATH="~/Library/Enthought/Canopy_64bit/User/bin"
export PATH

When I then restart the Terminal, a lot of functions do not work anymore:

X:~ excuvator$ ls
-bash: ls: command not found
X:~ excuvator$ security
-bash: security: command not found
X:~ excuvator$ sudo
-bash: sudo: command not found

However, enpkg and cd still seem to be callable. If I remove that part, stuff works again. Does anyone have any insight to what is happening? I just want to get enpkg running...

You reset PATH , rather than adding to it, so bash doesn't know any place to look for commands other than the single directory you specified. Instead, use one of

PATH=$PATH:~/Library/Enthought/Canopy_64bit/User/bin

or

PATH=~/Library/Enthought/Canopy_64bit/User/bin:$PATH

Which of the two assignments you use depends on whether whether you want the new directory to be the first or last place the shell looks for a named command.

enpkg actually is in that directory, and cd is a shell built-in command, not an external program, so no path lookup is involved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM