为什么不起作用? Django.tar.gz直接来自PyPi 如果我尝试“ python -m pip install”,则可以,但是会全局安装python。
(newenv) [root]# pip install paczki/Django-2.0.7.tar.gz
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Processing ./paczki/Django-2.0.7.tar.gz
Requirement already satisfied: pytz in ./newenv/lib/python3.6/site-packages (from Django==2.0.7)
Installing collected packages: Django
Running setup.py install for Django ... done
Successfully installed Django-2.0.7
(newenv) [root]# python3
Python 3.6.0 (default, May 22 2018, 12:59:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'django'
>>>
答案 0 :(得分:0)
弄清楚了。之前有人设置了系统范围的别名,该别名将python别名为“ / A / B / python”之类的特定路径,因此即使在venv中使用python时也是如此。 :哪个python:可能会产生误导-id不会检查别名,因此:哪个python:和:python:没有指向同一个。