macports 拾取错误 python 的问题

发布于 2024-11-28 12:43:57 字数 2419 浏览 0 评论 0原文

我之前在 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 中安装了 Python。然后在 Lion 更新之后,我在 /System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 中再次安装了它。但是,当我使用 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 版本?我应该能够告诉它这是需要使用的版本和地方。

I previously installed Python in /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6. then after the Lion update I installed it again in /System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6. But when I install any Python package using MacPorts, the installation fails with the following message:

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

This happened while installing mercurial. I tried setting the default Python as the active one, but it was no use.

How can I make MacPorts use the version of Python I want? I should able to tell it this is the version and place which needs to be used.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

如痴如狂 2024-12-05 12:43:57

/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 中再次安装 Python 2.6 是什么意思?这是 Apple 提供的 Python 2.6 在 Lion 中的位置。该框架中还有 Apple 提供的 Python 2.7 和 2.5 版本。不要修改或删除 /System/Library 中的任何内容! MacPorts 版本像以前一样安装在 /opt/local/ 中。

升级到 Lion 后,您是否:

  1. 从 Mac App store 下载了 Xcode 4.1 安装程序,然后运行它的安装程序(位于 /Applications 中)?

  2. 您是否已将 MacPorts 端口设置更新到最新更新以支持 Lion?

    $ sudo 端口 selfupdate
    $ sudo port -u 升级已过时
    
  3. 您使用的是 MacPorts Mercurial 端口吗?

    $ sudo port install Mercurial
    
  4. 您是否修改了 PATH 以包含 /opt/local/bin 或者您是否使用 Macports Python 的绝对路径:/opt/local/bin/python2.6 code>

What do you mean by you installed Python 2.6 again in /System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6? That's the location of the Apple-supplied Python 2.6 in Lion. There are also Apple-suppled Python 2.7 and 2.5 versions in that framework. Do not modify or delete anything in /System/Library! The MacPorts version is installed as before in /opt/local/.

Since upgrading to Lion, have you:

  1. downloaded the Xcode 4.1 installer from the Mac App store and then run the installer for it (found in /Applications)?

  2. Have you updated your MacPorts ports setup to the latest updates to support Lion?

    $ sudo port selfupdate
    $ sudo port -u upgrade outdated
    
  3. Are you using the MacPorts mercurial port?

    $ sudo port install mercurial
    
  4. Have you modified your PATH to include /opt/local/bin or are you using the absolute path to the Macports Python: /opt/local/bin/python2.6

苯莒 2024-12-05 12:43:57

我发现在进行 python 编程时最好使用 virtualenv - 然后就是哪个依赖项在哪里并不神秘,并且使用 pipeasy_install 安装软件包变得轻而易举。如果您 google 一下,您可以看到很多有用的博客文章如何设置并有效使用它。

I find it best to work with virtualenv when programming python - then there's no mystery about which dependency is where, and installing packages is a breeze with pip or easy_install. If you google it, you can see a bunch of useful blog posts on how to set it up and use it effectively.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文