Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
977 views
in Technique[技术] by (71.8m points)

python - Having trouble installing pycurl on windows

I'm having trouble getting pycurl installed on my windows computer. At first I tried pip, but ran into the “Please specify --curl-dir=/path/to/built/libcurl” error, and have since tried installing curl before running it again.

I downloaded curl from http://curl.haxx.se/download.html and have extracted it into it's own folder.

I tried the following:

D:Downloadspycurl-7.19.5.1pycurl-7.19.5.1>python setup.py install --curl-dir="D:Downloadscurl-7.40.0curl-7.40.0"

But received the following error.

Using curl directory: D:Downloadscurl-7.40.0curl-7.40.0
libcurl.lib does not exist at D:Downloadscurl-7.40.0curl-7.40.0liblibcurl.lib.
Curl directory must point to compiled libcurl (bin/include/lib subdirectories):

I can't find this libcurl.lib file that it's looking for.

Any help would be appreciated.

UPDATE:

Have re-downloaded a new library from the same website, curl-7.40.0-win64, which contains a libcurl.lib file.

D:Downloadspycurl-7.19.5.1pycurl-7.19.5.1>python setup.py install --curl-dir=
"D:Downloadscurl-7.40.0-win64curl-7.40.0-win64"
Curl directory does not exist: D:Downloadscurl-7.40.0-win64curl-7.40.0-win64"


D:Downloadspycurl-7.19.5.1pycurl-7.19.5.1>python setup.py install --curl-dir=
"D:Downloadscurl-7.40.0-win64curl-7.40.0-win64lib"
Using curl directory: D:Downloadscurl-7.40.0-win64curl-7.40.0-win64lib
libcurl.lib does not exist at D:Downloadscurl-7.40.0-win64curl-7.40.0-win64l
ibliblibcurl.lib.
Curl directory must point to compiled libcurl (bin/include/lib subdirectories):
D:Downloadscurl-7.40.0-win64curl-7.40.0-win64lib

D:Downloadspycurl-7.19.5.1pycurl-7.19.5.1>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It is frustrating how much time i spent looking for a solution to this problem on internet, and finally found all my answers in the official pycurl website

in my arch linux system i have no problem installing pycurl, but found all this hassle when trying to install pycurl on windows using pip, giving errors:

“Please specify --curl-dir=/path/to/built/libcurl” error

and trying to fix this error with same steps as in "op" question and getting exact errors.

.

Solution for windows:

[EDIT] unfortunately, option 1 below doesn't work anymore,link for binaries is down, and reference removed from pycurl documentation.

1- the easy way is to download a ready made official packages, zip, exe, or msi, as mentioned here, official downloads from here, make sure to choose the link with the same version of your installed python

for example: pycurl-7.43.0.2.win-amd64-py3.6.exe is an installer for pycurl 7.43.0.2 on windows 64bit, with python 3.6 installed

2- the hard way: Building From Source, as quoted from their website it is not a good idea to do so but still possible,

Building PycURL from source is not for the faint of heart due to the multitude of possible dependencies and each of these dependencies having its own directory structure, configuration style, parameters and quirks. Additionally different dependencies have different settings for MSVCRT usage, and an application must have all of its parts agreeing on a single setting.

if you continue reading here you will find a detailed instructions how to build from source

Finally: i recommend using a ready made package which i think it should be made available to be automatically installed by pip and avoid all this hassle


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...