PIP无法找到满足SQLAlchemy要求的任何下载

Dee*_*end 23 ubuntu proxy pip pypi ubuntu-12.04

  • Ubuntu 12.04
  • Apache 2.2.22

pip已停止在我的ubuntu服务器上运行,并在我尝试下载任何内容时给出以下错误.

$ sudo pip install SQLAlchemy
Downloading/unpacking SQLAlchemy
  Cannot fetch index base URL http://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement SQLAlchemy
No distributions at all found for SQLAlchemy
Storing complete log in /home/user/.pip/pip.log
Run Code Online (Sandbox Code Playgroud)

以下所有也不起作用

$ sudo pip install --upgrade pip 
$ sudo apt-get install build-essential
Run Code Online (Sandbox Code Playgroud)

/etc/environment有以下设置,以前工作.

http_proxy="http://myproxyhere:portnumberhere/"
HTTP_PROXY="http://myproxyhere:portnumberhere/"
Run Code Online (Sandbox Code Playgroud)

我的 /home/user/.pip

------------------------------------------------------------
/usr/bin/pip run on Sat Jun  7 20:08:38 2014
Downloading/unpacking SQLAlchemy

  Getting page http://pypi.python.org/simple/SQLAlchemy
  Could not fetch URL http://pypi.python.org/simple/SQLAlchemy: <urlopen error [Errno 111] Connection refused>
  Will skip URL http://pypi.python.org/simple/SQLAlchemy when looking for download links for SQLAlchemy
  Getting page http://pypi.python.org/simple/
  Could not fetch URL http://pypi.python.org/simple/: <urlopen error [Errno 111] Connection refused>
  Will skip URL http://pypi.python.org/simple/ when looking for download links for SQLAlchemy
  Cannot fetch index base URL http://pypi.python.org/simple/

  URLs to search for versions for SQLAlchemy:
  * http://pypi.python.org/simple/SQLAlchemy/
  Getting page http://pypi.python.org/simple/SQLAlchemy/
  Could not fetch URL http://pypi.python.org/simple/SQLAlchemy/: <urlopen error [Errno 111] Connection refused>
  Will skip URL http://pypi.python.org/simple/SQLAlchemy/ when looking for download links for SQLAlchemy
  Could not find any downloads that satisfy the requirement SQLAlchemy

No distributions at all found for SQLAlchemy

Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 223, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 948, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/usr/lib/python2.7/dist-packages/pip/index.py", line 152, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for SQLAlchemy
Run Code Online (Sandbox Code Playgroud)

有谁知道可能出了什么问题?

u_L*_*td. 27

答:升级点.

我安装了1.1版.随着sudo pip install --upgrade pip我得到版本8.1.2和我想要正确安装的软件包.

  • 这就是我最终用来解决问题的方式! (3认同)

Ivo*_*Ivo 11

您需要通过HTTPS获取pypi,而不是HTTP.

出于某种原因,您的pip配置为从http://pypi.python.org/simple/而不是https://pypi.python.org/simple/检索

  • 有[〜/ .pypirc](https://docs.python.org/3/distutils/packageindex.html?highlight=pypirc#pypirc)或$ PIP_INDEX_URL或[pip.conf](https://pip.pypa. IO/EN /最新/ user_guide.html#配置文件) (6认同)
  • 你知道我可以改变的地方和方式吗? (2认同)

小智 8

您没有使用自2013年底以来一直使用的https连接.

您可以使用--index选项来更正索引URL.见http://pip.readthedocs.org/en/latest/reference/pip_wheel.html#index-url

  • 链接失效了,请在回答中补充相关信息 (2认同)

小智 6

您可以通过以下方式传递特定的索引网址-i:

sudo pip install SQLAlchemy -i https://pypi.python.org/simple
Run Code Online (Sandbox Code Playgroud)


Edu*_*omo 6

解决方案1:升级 pip

sudo pip install --upgrade pip -i https://pypi.python.org/simple
Run Code Online (Sandbox Code Playgroud)

那么,你可以pip用作:

sudo pip install SQLAlchemy
Run Code Online (Sandbox Code Playgroud)

解决方案2:使用特定索引URL -i

sudo pip install SQLAlchemy -i https://pypi.python.org/simple
Run Code Online (Sandbox Code Playgroud)