2013-10-09 77 views
2

我真的無法在我女朋友的mac上安裝pycurl,我設法自己做,但我不記得哪個命令帶來了成功。我在她的Mac上試過的所有東西都無法工作。在mac上安裝pycurl時遇到的麻煩10.8.5

我擡頭一看每一個答案,我可以找到有關如何安裝pycurl,沒有爲我工作:(。我嘗試MacPorts的,並沒有正常工作。問題是,我不認爲到使用終端

這是我到目前爲止已經試過:

sudo port install py27-yaml 
sudo port install py27-curl 
/opt/local/bin/python2.7 
import pycurl 

但ID工作:(

試圖sudo env ARCHFLAGS="-arch x86_64" easy_install setuptools pycurl==7.19.0

沒有'給我帶來了這個

Last login: Wed Oct 9 23:51:34 on ttys000 
Loras-MacBook-Air:~ Lora$ sudo env ARCHFLAGS="-arch x86_64" easy_install setuptools pycurl==7.19.0 
Searching for setuptools 
Best match: setuptools 0.6c12dev-r88846 
setuptools 0.6c12dev-r88846 is already the active version in easy-install.pth 
Installing easy_install script to /usr/local/bin 
Installing easy_install-2.7 script to /usr/local/bin 

Using /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python 
Processing dependencies for setuptools 
Finished processing dependencies for setuptools 
Searching for pycurl==7.19.0 
Reading http://pypi.python.org/simple/pycurl/ 
Reading http://pycurl.sourceforge.net/ 
Reading http://pycurl.sourceforge.net/download/ 
Best match: pycurl 7.19.0 
Downloading http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz 
Processing pycurl-7.19.0.tar.gz 
Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-r7sdRe/pycurl-7.19.0/egg-dist-tmp-DKaHyW 
Using curl-config (libcurl 7.32.0) 
clang: warning: argument unused during compilation: '-mno-fused-madd' 
src/pycurl.c:1168:16: warning: implicit conversion loses integer precision: 
     'long' to 'int' [-Wshorten-64-to-32] 
      ret = dup(PyInt_AsLong(fileno_result)); 
        ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~ 
src/pycurl.c:1912:31: warning: implicit conversion loses integer precision: 
     'long' to 'int' [-Wshorten-64-to-32] 
         val = PyLong_AsLong(PyTuple_GET_ITEM(t, j)); 
          ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
src/pycurl.c:2904:22: warning: implicit conversion loses integer precision: 
     'long' to '__darwin_suseconds_t' (aka 'int') [-Wshorten-64-to-32] 
     tv.tv_usec = (long)(timeout*1000000.0); 
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~ 
3 warnings generated. 
zip_safe flag not set; analyzing archive contents... 
Adding pycurl 7.19.0 to easy-install.pth file 

Installed /Library/Python/2.7/site-packages/pycurl-7.19.0-py2.7-macosx-10.8-x86_64.egg 
Processing dependencies for pycurl==7.19.0 
Finished processing dependencies for pycurl==7.19.0 
Loras-MacBook-Air:~ Lora$ 

我只是不能讓我做:(

+0

我看到的'須藤ENV輸出ARCHFLAGS =無差錯 「 - 拱x86_64的」 easy_install的setuptools的pycurl == 7.19.0',你試圖導入'pycurl'到這個'/選擇/本地/ bin/python2.7' python和/或簡單的'python'命令之後?從另一個SO問題看來,你可能有兩個python安裝。 – TobiMarg

回答

0

我沒有蘋果,但我想輸出是比較明確的:

port: command not found 

這可能意味着沒有MacPorts的安裝,你需要首先要做到這一點。如果您按照說明here這似乎很容易。之後,您可以使用port命令。

+0

我管理得到端口命令完成,但沒有在最後工作:( –

-1

我建議你不要使用port,但下載並安裝brew+pip,然後使用pip安裝pycurl。這些是步驟

1)Homebrew 或簡稱爲「在終端‘輸入’紅寶石-e」捲曲-fsSL https://raw.github.com/mxcl/homebrew/go(沒有最外引號)

2)然後,通過在輸入端子安裝PIP:「釀造安裝在殼PIP」

3),然後再次在終端‘命令PIP安裝pycurl’

+0

我會很高興知道爲什麼我得到一個負面投票?! – Cupitor

2

蘋果LLVM編譯器在Xcode 5.1對待不可識別的命令行選項爲錯誤。當構建Python本地擴展和Ruby Gems時,已經看到了這個問題,當前指定了一些無效的編譯器選項。從Kasper Munck

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install-2.7 pycurl 
+0

爲我工作,謝謝 –