Python 无法使用 pip 安装 pycurl

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22754649/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 01:35:59  来源:igfitidea点击:

Can't install pycurl with pip

pythoninstallationpippycurl

提问by mrgloom

Can't install pycurl with pip, win xp x32, python 2.7.

无法使用 pip、win xp x32、python 2.7 安装 pycurl。

here is the log

这是日志

pip install pycurl
Downloading/unpacking pycurl
  Downloading pycurl-7.19.3.1.tar.gz (116Kb): 116Kb downloaded
  Running setup.py egg_info for package pycurl
    Please specify --curl-dir=/path/to/built/libcurl
    Complete output from command python setup.py egg_info:
    Please specify --curl-dir=/path/to/built/libcurl

----------------------------------------
Command python setup.py egg_info failed with error code 10 in C:\Documents and S
ettings\User\build\pycurl
Storing complete log in C:\Documents and Settings\User\Application Data\pip\pi
p.log

回答by Mickael_Paris

So has said by Hai Vu you need to install cURL first. Here is the dowload page : http://curl.haxx.se/download.htmlI suggest you install it in your C:/ directory, or if you already installed it elsewhere copye the curl.exe file to your c:/

Hai Vu 说你需要先安装 cURL。这是下载页面:http: //curl.haxx.se/download.html我建议您将其安装在 C:/ 目录中,或者如果您已经在其他地方安装了它,请将 curl.exe 文件复制到您的 c:/

When done, you can try it by going to the cmd prompt :

完成后,您可以通过转到 cmd 提示符来尝试:

cd c:/
curl "your-curl-request"

If it works then curl is correctly installed and you can install pycurl with pip.

如果它有效,那么 curl 已正确安装,您可以使用 pip 安装 pycurl。

回答by reggie

I had the same problem. I was able to install it with easy_install instead:

我有同样的问题。我可以使用 easy_install 安装它:

easy_install pycurl

For easy_install, see setuptools.

对于 easy_install,请参阅setuptools

回答by dlewin

This is a problem indeed. No need to update pip or easy install as it's often advised, well it won't hurt to update but you will still have the problem until you :

这确实是个问题。无需像通常建议的那样更新 pip 或轻松安装,更新不会有什么坏处,但您仍然会遇到问题,直到您:

  1. install libcurl4-gnutls-dev librtmp-dev packages
  2. pip install pycurl
  1. 安装 libcurl4-gnutls-dev librtmp-dev 包
  2. pip安装pycurl

Worked the same in Linux

在 Linux 中工作相同

回答by stegnerd

Here are easy steps I did to get around this:

以下是我为解决此问题所做的简单步骤:

  1. Download the wheel of the version you want here: https://www.lfd.uci.edu/~gohlke/pythonlibs/

  2. then you can pip install that like so:

    pip install C:\sample\sample_dir\whl_file_downloaded

  1. 在这里下载你想要的版本的轮子:https: //www.lfd.uci.edu/~gohlke/pythonlibs/

  2. 然后你可以像这样 pip install :

    pip 安装 C:\sample\sample_dir\whl_file_downloaded

You should know be able to import in your python files

你应该知道能够在你的 python 文件中导入

回答by Yash Bhardwaj Shukla

steps to follow :

要遵循的步骤:

  1. brew install openssl

  2. PYCURL_SSL_LIBRARY=openssl LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" pip install --no-cache-dir pycurl

  1. brew install openssl

  2. PYCURL_SSL_LIBRARY=openssl LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" pip install --no-cache-dir pycurl

回答by kali prasad deverasetti

install pycurl using conda, conda will install all dependencies, Hope it works

使用 conda 安装 pycurl,conda 将安装所有依赖项,希望它有效

conda install -c anaconda pycurl

conda install -c anaconda pycurl

回答by r0m

Following the steps one mentioned above, solved my problem.

按照上面提到的步骤一,解决了我的问题。

sudo apt install libcurl4-gnutls-dev librtmp-dev

pip install pycurl