Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法安装程序包';请求';对于Python_Python_Django_Ubuntu_Pip_Python Requests - Fatal编程技术网

无法安装程序包';请求';对于Python

无法安装程序包';请求';对于Python,python,django,ubuntu,pip,python-requests,Python,Django,Ubuntu,Pip,Python Requests,我尝试在我的Ubuntu 10.04服务器上安装python请求包,使用: $ pip install requests 但我不断得到回报: 下载/解包请求无法获取URL :将跳过URL (…url…)查找下载链接时 for请求无法获取URL(…URL…): 意志 查找下载时跳过URL(…URL…) 请求的链接无法获取索引基URL (…url…)找不到需求请求,或者 获取存储完整登录的索引URL(…URL…) ./pip-log.txt 请原谅我在上面使用“(…url…”,因为StackOve

我尝试在我的Ubuntu 10.04服务器上安装python请求包,使用:

$ pip install requests
但我不断得到回报:

下载/解包请求无法获取URL :将跳过URL (…url…)查找下载链接时 for请求无法获取URL(…URL…): 意志 查找下载时跳过URL(…URL…) 请求的链接无法获取索引基URL (…url…)找不到需求请求,或者 获取存储完整登录的索引URL(…URL…) ./pip-log.txt

请原谅我在上面使用“(…url…”,因为StackOverflow不允许我发布超过2个链接

以下是pip-log.txt中的回溯:

Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/pip.py", line 252, in main
    self.run(options, args)
File "/usr/lib/python2.6/dist-packages/pip.py", line 08, in run
    requirement_set.install_files(finder, force_root_egg_info=self.bundle)
File "/usr/lib/python2.6/dist-packages/pip.py", line 1750, in install_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.6/dist-packages/pip.py", line 996, in find_requirement
    url_name = self._find_url_name(Link(self.index_urls[0]), url_name, req)
File "/usr/lib/python2.6/dist-packages/pip.py", line 1073, in _find_url_name
    raise DistributionNotFound('Cannot find requirement %s, nor fetch index URL %s' % (req, index_url))
DistributionNotFound: Cannot find requirement requests, nor fetch index URL (...url...)
我知道pip工作得很好,因为我已经通过它安装了许多其他软件包。我也尝试过使用easy_install和从源代码安装,但两者都有相同的问题。我是Python/Django的新手,有人能帮我指出问题所在的正确方向吗

您可以尝试:

  • 像这里解释的那样使用镜子

  • 正如@sigmavirus24所建议的,第二个选项是使用Python包索引的
    Base URL

    pip install -i https://crate.io requests 
    
  • 直接从git安装包源代码

    pip install -e git+https://github.com/kennethreitz/requests#egg=requests
    

  • 尝试1-有时我有同样的问题,当我有不良的互联网连接或pip是关闭

    回答我自己的问题


    事实证明,这与软件包的安装方式无关,尽管错误消息似乎在说什么。问题是,我从另一个终端窗口运行我的开发服务器,但从未关闭它。。。(
    $python manage.py运行服务器[:]:8000
    )。奇怪的是,错误输出没有提到这一点

    还有比从git安装更好的第二种选择(因为我们试图保持它的稳定性,但它可能包含意外的、迄今为止有文档记录的更改。更好的第二种选择是使用crainte.io,即,
    pip安装-ihttps://crate.io 请求
    感谢各位的建议,我发现解决方案与我下载软件包的方式无关.我在下面提交了答案:)
    pip install -e git+https://github.com/kennethreitz/requests#egg=requests