我刚刚开始学习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。出现相同的错误。
发布于 2019-01-19 14:32:07
将PYTHONPATH设置为pytz位置后的问题解决
https://stackoverflow.com/questions/54264412
复制相似问题