我剛剛安裝了Canopy Express並希望測試其虛擬環境集成。我發現,當我停用虛擬環境中,我的系統的Python將恢復爲默認安裝:Canopy Express python不會持續
Mímisbrunnr:~ me$ which python
/Users/me/Library/Enthought/Canopy_64bit/User/bin/python
Mímisbrunnr:~ me$ venv ~/Projects/ProjectX/myvenv
Mímisbrunnr:~ me$ source ~/Projects/ProjectX/myvenv/bin/activate
(myvenv) Mímisbrunnr:~ me$ deactivate
Mímisbrunnr:~ me$ which python
/usr/bin/python
除了是新雨棚,我是新來OS X.我懷疑這個問題與做我的.bash_profile
和.profile
文件,但我似乎無法看到如何讓他們彼此合作。這是我目前的.profile
:
# OS X looks in here first, but aliases in here won't work in xterm, screen, etc., so we port it over
echo 'source ~/.profile' >> ~/.bash_profile
# Added by Canopy installer on 2013-08-01
# VIRTUAL_ENV_DISABLE_PROMPT can be set to '' to make bashprompt show that Canopy is active, otherwise 1
#VIRTUAL_ENV_DISABLE_PROMPT=1 source /Users/me/Library/Enthought/Canopy_64bit/User/bin/activate
這裏是我當前.bash_profile
:
# set architecture flags to let compiler know it should assume 64 bits
export ARCHFLAGS="-arch x86_64"
# Added by Canopy installer on 2013-08-01
# VIRTUAL_ENV_DISABLE_PROMPT can be set to '' to make bashprompt show that Canopy is active, otherwise 1
VIRTUAL_ENV_DISABLE_PROMPT=1 source /Users/me/Library/Enthought/Canopy_64bit/User/bin/activate
# ensure user-installed binaries take precedence
#export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
# alias to start Canopy
alias canopy='open /Applications/Canopy.app'
# alias to combine cd & ls
function cdl() {
cd "[email protected]" && ls
}
其中一些條目是從我前面沒有雨棚安裝IPython的嘗試,所以我可以在條款已經搞砸了Canopy期望的。我如何配置這些文件以保持Canopy Python的始終?
這就是訣竅!感謝知道的答案。我不得不說,我不明白爲什麼這是一種理想的行爲,但我可以使用解決方案。 – verbsintransit