2016-03-05 42 views
0

我在使用macports的小牛上安裝theano。 安裝步驟之一是使用python和gcc的macport版本。 我不確定macport python的路徑在哪裏。用MacPorts版本的gcc和MacPorts版本的python

sudo port select python python27 
which python 
"/Library/Frameworks/Python.framework/Versions/2.7/bin/python" 

通常macport節省包裝上的下/opt/local/bin/

.bash_profile文件中我有這些線

# Setting PATH for Python 2.7 

    # The orginal version is saved in .bash_profile.pysave 
    PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" 
    export PATH 

/opt/local/bin/下,有二進制文件python2.7

那麼是什麼Macport對應的版本?

對於GCC 我有同樣的困惑:

可用版本爲GCC: 須藤端口選擇的gcc MP-gcc47 MP-gcc49(有源) MP-gcc5 無 和

which gcc 
    "/usr/bin/gcc" 

/opt/local/bin下,我有一個二進制文件gcc

任何解釋?

回答

0

MacPorts的增加export PATH="/opt/local/bin:/opt/local/sbin:$PATH"到的~/.profile結束,使得/opt/local/bin首先搜索。

顯然,如果你在前面加上例如/Library/Frameworks/Python.framework/Versions/2.7/binPATH覆蓋這一點,那麼python將在該目錄中首次發現。您可以通過運行which -a python來顯示所有可用的python可執行文件。

所以,「解決」這個問題的一種方法是將python的路徑設置移動到MacPorts條目上方的~/.profile,或者將其註釋掉。

我假設有一些類似的路徑問題gcc