python pip无法找到pyodbc [英] Python pip unable to locate pyodbc

查看:96
本文介绍了python pip无法找到pyodbc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用virtualenv并尝试安装pyodbc.我可以找到的所有资源都声称这应该非常简单.在完成MySQL等的所有基本安装之后,只需执行以下操作:

Using virtualenv and just trying to install pyodbc. All resources I can find claim this should be extremely straightforward. After all the basic installs of MySQL, etc., just do:

pip install pyodbc

但是,我看到一个非常奇怪的错误. (据我所知)与丢失的库没有任何关系,并且在长时间搜索此类错误之后,我根本找不到任何有建设性的东西.

However, I am seeing a very strange error. It has nothing (as far as I can tell) to do with missing libraries, and after Googling for this sort of error for a long time, I can't find anything constructive on it at all.

(local-dev)espears@espears-w ~ $ pip install pyodbc
Downloading/unpacking pyodbc
  Could not find any downloads that satisfy the requirement pyodbc
  Some externally hosted files were ignored (use --allow-external pyodbc to allow).
Cleaning up...
No distributions at all found for pyodbc
Storing debug log for failure in /home/espears/.pip/pip.log

所以我尝试使用允许外部"选项,但它没有帮助:

So I tried with the "allow-external" option and it does not help:

(local-dev)espears@espears-w ~ $ pip install --allow-external pyodbc
You must give at least one requirement to install (see "pip help install")

但是帮助文档显示我正在正确使用此选项,例如从运行pip help install的输出中:

But the help documentation makes it appear that I am using this option correctly, e.g. from the output of running pip help install:

Package Index Options:

...

  --allow-external <package>  Allow the installation of externally hosted files

以下是PIP日志文件中的结果:

Here's the result in the PIP log file:

(local-dev)espears@espears-w ~ $ cat /home/espears/.pip/pip.log
Downloading/unpacking pyodbc
  Getting page https://pypi.python.org/simple/pyodbc/
  URLs to search for versions for pyodbc:
  * https://pypi.python.org/simple/pyodbc/
  Analyzing links from page https://pypi.python.org/simple/pyodbc/
    Skipping link http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/); not a file
    Skipping link http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/); not a file
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Not searching http://code.google.com/p/pyodbc/downloads/list (from https://pypi.python.org/simple/pyodbc/) for files because external urls are disallowed.
  Could not find any downloads that satisfy the requirement pyodbc
  Some externally hosted files were ignored (use --allow-external pyodbc to allow).
Cleaning up...
  Removing temporary dir /home/espears/.virtualenvs/local-dev/build...
No distributions at all found for pyodbc
Exception information:
Traceback (most recent call last):
  File "/home/espears/.virtualenvs/local-dev/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/home/espears/.virtualenvs/local-dev/local/lib/python2.7/site-packages/pip/commands/install.py", line 270, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/home/espears/.virtualenvs/local-dev/local/lib/python2.7/site-packages/pip/req.py", line 1157, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/home/espears/.virtualenvs/local-dev/local/lib/python2.7/site-packages/pip/index.py", line 285, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for pyodbc

看来,如果我可以使--allow-external选项起作用,那么它将起作用,因为它清楚地看到了获取pyodbc的通用位置.

It makes it seem that if I can just get the --allow-external option to work, it will work because it clearly sees the common location for getting pyodbc.

但是,当几乎所有有关安装pyodbc的引用都不需要脱离启用外部链接的方式时,我却感到困惑,为什么根本需要这样做.我今天也整天都在安装许多软件包,几乎没有问题,并且在其他情况下当然也没有遇到这种allow-external需求.

But I am puzzled why this is needed at all, when virtually all references to installing pyodbc do not need to go out of the way to enable external links. I've also been installing many packages all day today, with few issues and certainly not encountering this allow-external need in any other case.

我正在Ubuntu 12.04上使用带有Python 2.7.3的pip版本1.5.

I am using pip version 1.5 with Python 2.7.3 on Ubuntu 12.04.

推荐答案

如果PyPI目录结构正确,则运行pip install --allow-external pyodbc --allow-unverified pyodbc pyodbc将起作用.

Running pip install --allow-external pyodbc --allow-unverified pyodbc pyodbc will work if the PyPI directory structure is correct.

基于我最初发布此答案时的pip.log输出,我认为该软件包的网站目录结构已损坏.您始终可以通过指定软件包的URL(例如pip install https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pyodbc/pyodbc-3.0.7.zip)来解决此类问题,此处.

Based on the pip.log output when I originally posted this answer, I think that package's website directory structure was broken. You can always work around this type of problem by specifying the URL of the package like pip install https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pyodbc/pyodbc-3.0.7.zip, links for different versions are described here.

这篇关于python pip无法找到pyodbc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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