简体   繁体   English

pycurl模块在Snow Leopard上安装后不可用

[英]pycurl module not available after installation on Snow Leopard

I'm running Python 2.6.4 on Mac Snow Leopard. 我在Mac Snow Leopard上运行Python 2.6.4。 I installed pycurl using: 我使用以下方法安装了pycurl:

sudo env ARCHFLAGS="-arch x86_64" easy_install setuptools pycurl==7.16.2.1

The installation completes with no issues and says pycurl is installed in subsequent installation attempts. 安装完成没有问题,并说在以后的安装尝试中已安装pycurl。 However, when I try to "import pycurl" in a script, I get a message that pycurl isn't found. 但是,当我尝试在脚本中“导入pycurl”时,收到一条消息,提示未找到pycurl。 I'm not sure what else to do to fix this. 我不确定该如何解决。

I would suspect you have 2 versions of python on your system. 我怀疑您的系统上有2个版本的python。 How about removing easy install and reinstalling it. 如何删除易于安装并重新安装它。

Remove the current easy install script by typing which easy_install and then rm [easy install full path] . 通过键入which easy_install ,然后输入rm [easy install full path]来删除当前的easy install脚本。

To install easy install 安装简易安装

wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py

Then, try your command again: 然后,再次尝试您的命令:

sudo env ARCHFLAGS="-arch x86_64" easy_install setuptools pycurl==7.16.2.1

我猜你有2个不同版本的python,可以通过运行命令来找出which python

如果您已使用python.org OS X安装程序安装了Python 2.6.4,则需要从10.6 Xcode mpkg安装可选的10.4u SDK ,以安装任何包含C扩展模块的python软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM