2015-12-25 36 views
1

我正在嘗試使用Rodeo IDE。但是,根據以下錯誤消息,Rodeo無法找到正確版本的Python(我已經使用Python 3.5安裝了Anaconda發行版,但根據以下消息,可能不是Python Rodeo版本試圖使用):發現哪個版本的Python在PATH中以及如何更改它

"Bad news! Rodeo can't start. If you do have one of them installed, then the issue is that Rodeo is using the "wrong python". Rodeo defaults to using whatever python is on your PATH (or on Windows, whatever is set in your Environment Variables)." 

請注意,我使用的是Mac OS 10.11.1。我試圖刪除Python 2.7(成功,我認爲),並通過Anaconda重新安裝Python 3.5,但與Rodeo的問題仍然存在,我認爲,因爲我沒有改變我的路徑中的Python版本。

如何才能發現哪個版本的Python在我的PATH中,以及如何將其更改爲與Anaconda發行版關聯的版本? Python初學者和答案不能太簡單。

回答

2

在終端類型

which python 

來得到當前的Python程序路徑。 您可以編輯您的〜/ .bashrc,並在末尾添加以下anacondas發行版的路徑,然後刪除.bashrc文件中的所有其他python路徑。

export PATH=$PATH:/usr/local/lib/ <path to Anacondas...> 
    #for me it is /usr/local/anaconda/bin 

可選: 如果要添加其他庫/執行自己的程序,如果他們在圖書館或保存自己重新安裝一切,你可以使用以下命令:

export PYTHONPATH=/Library/Python/2.7/site-packages' 

在那裏添加您希望包含的任何庫的路徑。

如果的Mac: 你有一個的.profile文件,而不是的.bashrc。因此,您需要添加路徑(上圖)並刷新您的終端。最簡單的方法是使用nano。

nano ~/.profile 

#add: 
    export PATH=$PATH:/usr/local/anaconda/bin 

# ctrl+x, then y, then rtn : to save and exit 

#run bash or reopen terminal to refresh 
bash 

which python #should now be updated to anacondas path 
+0

謝謝,好消息 - 前兩個命令似乎*工作*,但羅迪歐似乎仍然顯示相同的錯誤。任何建議什麼嘗試 –

+0

@JoshuaRosenberg我剛剛注意到你正在使用Mac,你想編輯你的主目錄nano〜/ .profile中的.profile文件,因爲你沒有bashrc。另外不要忘記輸入bash重新啓動配置文件/ bashrc文件,一旦你改變了它。 – user2589273

相關問題