【问题标题】:pip install django error using virtualenv使用 virtualenv pip install django 错误
【发布时间】:2017-09-12 05:06:32
【问题描述】:

我已经设置了虚拟环境

(website) username[`/public_html/website]

/public_html/website目录中有django项目

当我尝试使用 pip install django 安装 django 时 出现以下错误

Collecting django 
Could not find a version that satisfies the requirement django (from versions:)
No mathcing distribution for django

我试过which pip 它给了public_html/website/bin/pip

当我尝试python manage.py runserver 时出现错误couldnt import django

我应该如何在 virtualenv 中安装 django 然后运行服务器?

编辑

尝试pip search django时出现以下错误

HTTP error 403 while getting https://pypi.python.org/pypi
Exception:
Traceback (most recent call last):
  File "/home/siddhesh3186/public_html/website/env/lib/python3.4/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/siddhesh3186/public_html/website/env/lib/python3.4/site-packages/pip/commands/search.py", line 45, in run
    pypi_hits = self.search(query, options)
  File "/home/siddhesh3186/public_html/website/env/lib/python3.4/site-packages/pip/commands/search.py", line 62, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "/home/siddhesh3186/.local/lib/python3.4/xmlrpc/client.py", line 1098, in __call__
    return self.__send(self.__name, args)
  File "/home/siddhesh3186/.local/lib/python3.4/xmlrpc/client.py", line 1437, in __request
    verbose=self.__verbose
  File "/home/siddhesh3186/public_html/website/env/lib/python3.4/site-packages/pip/download.py", line 776, in request
    response.raise_for_status()
  File "/home/siddhesh3186/public_html/website/env/lib/python3.4/site-packages/pip/_vendor/requests/models.py", line 862, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
pip._vendor.requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://pypi.python.org/pypi

这是我得到的错误

【问题讨论】:

  • 更新 pip 并重试pip install --upgrade pip

标签: django pip virtualenv


【解决方案1】:

试试这个: pip search django。它显示了什么?

编辑:

尝试创建新的虚拟环境。 如果问题仍然存在,请创建一个没有 pip 的虚拟环境 使用virtualenv --no-pip,然后使用get-pip.py安装pip

【讨论】:

  • 已编辑问题
猜你喜欢
  • 2016-05-13
  • 2014-08-23
  • 1970-01-01
  • 2017-03-13
  • 1970-01-01
  • 2018-05-25
  • 1970-01-01
  • 1970-01-01
  • 2017-02-15
相关资源
最近更新 更多