我是Python的新手.我现在正在运行Python2.6.我正在关注Python网站上的教程.我的问题是当我尝试按照这里的说明操作时:
http://py-psycopg.darwinports.com/
我得到的东西......
sudo port install py-psycopg ... bunch of errors here... Error: The following dependencies failed to build: py-mx python24
我正在运行MacOS X 10.4.
我如何使这项工作?
任何回复将不胜感激.
更新:
运行下面的代码后,我得到以下错误:
$ sudo port install py26-psycopg2 Warning: Skipping upgrade since openssl 0.9.8k_0 >= openssl 0.9.8k_0, even though installed variants "" do not match "+darwin". Use 'upgrade --enforce-variants' to switch to the requested variants. Warning: Skipping upgrade since readline 6.0.000_1 >= readline 6.0.000_1, even though installed variants "" do not match "+darwin". Use 'upgrade --enforce-variants' to switch to the requested variants. ---> Computing dependencies for py26-psycopg2 ---> Building python26 Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.2" && /usr/bin/make all MAKE="/usr/bin/make CC=/usr/bin/gcc-4.0" " returned error 2 Command output: /usr/bin/install -c -d -m 755 Python.framework/Versions/2.6 if test ""; then \ /usr/bin/gcc-4.0 -o Python.framework/Versions/2.6/Python -dynamiclib \ -isysroot "" \ -all_load libpython2.6.a -Wl,-single_module \ -install_name /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python \ -compatibility_version 2.6 \ -current_version 2.6; \ else \ /usr/bin/libtool -o Python.framework/Versions/2.6/Python -dynamic libpython2.6.a \ -lSystem -lSystemStubs -install_name /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python -compatibility_version 2.6 -current_version 2.6 ;\ fi ld64 failed: in libpython2.6.a(__.SYMDEF), not a valid ppc64 mach-o file /usr/bin/libtool: internal link edit command failed make: *** [Python.framework/Versions/2.6/Python] Error 1 Error: The following dependencies failed to build: python26 Error: Status 1 encountered during processing.
仅供参考,我安装的python是来自pythong站点的dmg文件.
谢谢,温伯特
如果您使用的是Python 2.6,那么您实际上想要构建py26-psycopg2
:
$ sudo port install py26-psycopg2
在MacPorts中,py-*
使用Python 2.4 py25-*
使用Python 2.5 构建包,并py26-*
使用Python 2.6.