Django安装问题

时间:2019-01-19 05:43:29

标签: django

我刚刚开始学习Django。 我运行以下命令来安装Django:

1. download and unpack Django-2.1.5.tar.gz in /u01
2. cd /u01/Python-3.7.2/bin
3. ./python3 -m venv ./python3 -m venv /u01/django  
4. source /u01/django/bin/activate
5. cd /u01/django/bin
6. ./pip3 install -e /u01/Django-2.1.5  
Obtaining file:///u01/Django-2.1.5
Collecting pytz (from Django==2.1.5)
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe464ed25c0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/pytz/
...
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe464ed2278>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/pytz/
  Could not find a version that satisfies the requirement pytz (from Django==2.1.5) (from versions: )
No matching distribution found for pytz (from Django==2.1.5)

所以我下载并安装了最新的pytz-2018.9:

$ cd /u01/Python-3.7.2/bin
$  ./pip3 install ../../pytz-2018.9
Processing /home/alelai/pytz-2018.9
Installing collected packages: pytz
  Running setup.py install for pytz ... done
Successfully installed pytz-2018.9

,然后重新执行上述步骤2-6。发生相同的错误。

1 个答案:

答案 0 :(得分:0)

将PYTHONPATH设置为pytz位置后问题解决了