2011-06-19 42 views
6

Tôi đã thử cài đặt pycurl qua pip. nó không hoạt động và thay vào đó nó mang lại cho tôi lỗi này.Lỗi khi cài đặt PyCurl

running install 

running build 

running build_py 

running build_ext 

building 'pycurl' extension 

gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv 
-Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc 
-arch x86_64 -pipe -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/ 
Python.framework/Versions/2.6/include/python2.6 -c src/pycurl.c -o 
build/temp.macosx-10.6-universal-2.6/src/pycurl.o 

src/pycurl.c:85:4: warning: #warning "libcurl was compiled with SSL 
support, but configure could not determine which " "library was used; 
thus no SSL crypto locking callbacks will be set, which may " "cause 
random crashes on SSL requests" 

/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/ 
../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ 
ppc/as) for architecture ppc not installed 

Installed assemblers are: 

/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64 

/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386 

src/pycurl.c:85:4: warning: #warning "libcurl was compiled with SSL 
support, but configure could not determine which " "library was used; 
thus no SSL crypto locking callbacks will be set, which may " "cause 
random crashes on SSL requests" 

src/pycurl.c:3906: fatal error: error writing to -: Broken pipe 

compilation terminated. 

src/pycurl.c:85:4: warning: #warning "libcurl was compiled with SSL 
support, but configure could not determine which " "library was used; 
thus no SSL crypto locking callbacks will be set, which may " "cause 
random crashes on SSL requests" 

lipo: can't open input file: /var/tmp//ccspAJOg.out (No such file or 
directory) 

error: command 'gcc-4.2' failed with exit status 1 
+0

gì kiến ​​trúc, x86 hoặc PowerPC? –

+0

Tôi biết điều này không trả lời câu hỏi của bạn, nhưng thay vào đó bạn đã xem xét urllib2 chưa? – jterrace

Trả lời

11

tôi nhận nó làm việc sử dụng này

sudo env ARCHFLAGS="-arch x86_64" pip install pycurl 
+0

"sudo env ARCHFLAGS =" - kiến ​​trúc x86_64 "easy_install pycurl" đã hoạt động đối với tôi. Cảm ơn Mickey! – Tony

0

nếu bạn đang ở trên linux với apt-get:

lnx#> apt-get search pycurl 

Để cài đặt:

lnx#> sudo apt-get install python-pycurl 

nếu trên Linux với yum:

lnx#> yum search pycurl 
I get this on my comp: 
python-pycurl.x86_64 : A Python interface to libcurl 

Để cài đặt tôi đã làm:

lnx#> sudo yum install python-pycurl

Một lựa chọn khác, là sử dụng easy_install:

yum hoặc apt-get, cài đặt setuptools.


Nếu bạn đang sử dụng Holly Windows, sau đó nhận được pycurl từ HERE