在 Windows 上安装 pycurl 时遇到问题 [英] Having trouble installing pycurl on windows

查看:56
本文介绍了在 Windows 上安装 pycurl 时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 计算机上安装 pycurl 时遇到问题.起初我尝试了 pip,但遇到了请指定 --curl-dir=/path/to/built/libcurl"错误,此后我尝试安装 curl,然后再次运行.

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.

我从 http://curl.haxx.se/download.html 下载了 curl 并且已将其解压缩到它自己的文件夹中.

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

我尝试了以下方法:

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

但收到以下错误.

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

我找不到它要找的 libcurl.lib 文件.

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

任何帮助将不胜感激.

更新:

从同一网站重新下载了一个新库 curl-7.40.0-win64,其中包含一个 libcurl.lib 文件.

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

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


D:\Downloads\pycurl-7.19.5.1\pycurl-7.19.5.1>python setup.py install --curl-dir=
"D:\Downloads\curl-7.40.0-win64\curl-7.40.0-win64\lib"
Using curl directory: D:\Downloads\curl-7.40.0-win64\curl-7.40.0-win64\lib
libcurl.lib does not exist at D:\Downloads\curl-7.40.0-win64\curl-7.40.0-win64\l
ib\lib\libcurl.lib.
Curl directory must point to compiled libcurl (bin/include/lib subdirectories):
D:\Downloads\curl-7.40.0-win64\curl-7.40.0-win64\lib

D:\Downloads\pycurl-7.19.5.1\pycurl-7.19.5.1>

推荐答案

我花了多少时间在网上寻找这个问题的解决方案,终于在官方 pycurl 中找到了我所有的答案 网站

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

在我的 arch linux 系统中,我安装 pycurl 没有问题,但是在尝试使用 pip 在 windows 上安装 pycurl 时发现所有这些麻烦,并给出错误:

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

并尝试使用与op"问题中相同的步骤修复此错误并获得确切的错误.

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

.

Windows 解决方案:

1- 最简单的方法是下载现成的官方软件包、zip、exe 或 msi,如上所述这里,从这里官方下载,确保选择与您安装的python版本相同的链接

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

例如:pycurl-7.43.0.2.win-amd64-py3.6.exe 是 pycurl 7.43.0.2 在 windows 64bit 上的安装程序,安装了 python 3.6

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- 艰难的方式:从源代码构建,正如从他们的网站引用的那样,这样做不是一个好主意,但仍有可能,

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

从源代码构建 PycURL 并不适合胆小的人,因为存在大量可能的依赖项,并且这些依赖项中的每一个都有自己的目录结构、配置样式、参数和怪癖.此外,不同的依赖项对 MSVCRT 的使用有不同的设置,并且应用程序的所有部分都必须就一个设置达成一致.

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

最后:我建议使用现成的包,我认为它应该可以由 pip 自动安装并避免所有这些麻烦

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

这篇关于在 Windows 上安装 pycurl 时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆