2011-08-08 70 views
0

我以前在/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6上安裝了Python。然後在獅子更新後,我再次安裝它在/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6。但是,當我使用MacPorts安裝任何Python軟件包時,安裝將失敗,並顯示以下消息:macports問題撿錯了python

CPATH='/opt/local/include' MACOSX_DEPLOYMENT_TARGET='10.7' LIBRARY_PATH='/opt/local/lib' F90FLAGS='-m64' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mercurial/mercurial/work/.CC_PRINT_OPTIONS' LDFLAGS='-arch x86_64' FCFLAGS='-m64' OBJCFLAGS='-arch x86_64' FFLAGS='-m64' CC_PRINT_OPTIONS='YES' 
:debug:build Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mercurial/mercurial/work/mercurial-1.9" && /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 setup.py --no-user-cfg build' 
:debug:build Executing command line: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mercurial/mercurial/work/mercurial-1.9" && /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 setup.py --no-user-cfg build 
:info:build sh: /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6: No such file or directory 
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mercurial/mercurial/work/mercurial-1.9" && /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 setup.py --no-user-cfg build " returned error 127 
:error:build Target org.macports.build returned: shell command failed (see log for details) 
:debug:build Backtrace: shell command failed (see log for details) 
    while executing 
"command_exec build" 
    (procedure "portbuild::build_main" line 8) 
    invoked from within 
"$procedure $targetname" 
:info:build Warning: the following items did not execute (for mercurial): org.macports.activate org.macports.build org.macports.destroot org.macports.install 
:notice:build Log for mercurial is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mercurial/mercurial/main.log 

安裝mercurial時發生這種情況。我嘗試將默認的Python設置爲活動的Python,但它沒用。

我該如何讓MacPorts使用我想要的Python版本?我應該能夠告訴它這是需要使用的版本和地點。

回答

0

我覺得最好的編程蟒蛇當virtualenv工作 - 那麼就沒有神祕哪些依賴是哪裏,安裝軟件包是PIP的easy_install一件輕而易舉的事。如果你使用google it,你可以看到一些有用的博客文章,關於如何設置和有效地使用它。

+0

的MacPorts的蟒蛇重新安裝解決了這個問題。多謝你們 – Avinash

2

你是什麼意思你又在/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6上安裝了Python 2.6?這就是Apple提供的Lion 2.6在Lion中的位置。該框架中還有Apple提供的Python 2.7和2.5版本。請勿修改或刪除/System/Library中的任何內容! MacPorts版本像以前一樣安裝在/opt/local/中。

由於升級到獅子,有你:

  1. 從Mac App商店下載Xcode的4.1安裝程序,然後運行(在/Applications),選擇它的安裝程序?

  2. 您是否已將MacPorts端口設置更新爲支持Lion的最新更新?

    $ sudo port selfupdate 
    $ sudo port -u upgrade outdated 
    
  3. 您使用的是MacPorts的善變端口?

    $ sudo port install mercurial 
    
  4. 是否修改路徑,以包含/opt/local/bin或者您使用的Python的MacPorts的絕對路徑:/opt/local/bin/python2.6