Having trouble installing pycurl on windows

前端 未结 3 1545
天涯浪人
天涯浪人 2021-01-12 05:30

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 hav

相关标签:
3条回答
  • 2021-01-12 05:44

    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:

    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

    0 讨论(0)
  • 2021-01-12 05:46

    Try to download sources and build it by yourself: as result you will have to get directories like:

    • libcurl-vc12-x86-release-dll-ipv6-sspi-winssl
      • bin
        • curl.exe
        • libcurl.dll
      • include
        • *.h
      • lib
        • libcurl.lib

    (or you can search for prebuilt binaries/headers with same directory structure) And then you have to point your setup.py script this directory, such as:

    python setup.py install --curl-dir="D:\..\libcurl-vc12-x86-release-dll-ipv6-sspi-winssl
    

    And it will be built successfully.

    0 讨论(0)
  • 2021-01-12 05:48

    Another simple way to resolve the problem is to use Christoph Gohlke's collection of Python Extension Package for Windows.

    You could use Ctrl+F and search for pycurl.

    Or click here.

    0 讨论(0)
提交回复
热议问题