我已将虚拟环境设置为
(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然后再运行runserver?
修改
尝试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
这是我得到的错误
答案 0 :(得分:0)
试试这个:
pip search django
。它显示了什么?
编辑:
尝试创建新的虚拟环境。
如果问题仍然存在,请创建一个没有pip的虚拟环境
使用virtualenv --no-pip
,然后使用get-pip.py