[英]When running my django project in python3 manage.py run server i get this error ModuleNotFoundError: No module named 'pip._vendor.urllib3.connection'
After i run python3 manage.py runserver i get the following error:运行 python3 manage.py runserver 后,出现以下错误:
Traceback (most recent call last): File "manage.py", line 11, in main from django.core.management import execute_from_command_line File "/Users/luiseduardo/Practice/nova/nova_venv/lib/python3.8/site-packages/django/core/management/ init .py", line 12, in from django.conf import settings ImportError: cannot import name 'settings' from 'django.conf' (unknown location)回溯(最后一次调用):文件“manage.py”,第 11 行,主要来自 django.core.management import execute_from_command_line 文件“/Users/luiseduardo/Practice/nova/nova_venv/lib/python3.8/site-packages /django/core/management/ init .py",第 12 行,从 django.conf 导入设置 ImportError: cannot import name 'settings' from 'django.conf' (unknown location)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 13, in main
raise ImportError(
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
(nova_venv) Luiss-MacBook-Pro:novadjango luiseduardo$ pip install django
Traceback (most recent call last):
File "/Users/luiseduardo/Practice/nova/nova_venv/bin/pip", line 6, in <module>
from pip._internal import main
File "/Users/luiseduardo/Practice/nova/nova_venv/lib/python3.8/site-packages/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/Users/luiseduardo/Practice/nova/nova_venv/lib/python3.8/site-packages/pip/_vendor/urllib3/__init__.py", line 7, in <module>
from .connectionpool import (
File "/Users/luiseduardo/Practice/nova/nova_venv/lib/python3.8/site-packages/pip/_vendor/urllib3/connectionpool.py", line 30, in <module>
from .connection import (
ModuleNotFoundError: No module named 'pip._vendor.urllib3.connection'
Im using mac and i do have my virtualenv activated.我正在使用 mac,我确实激活了我的 virtualenv。
I had the same issue and this solved for me: pip install --upgrade pip
我有同样的问题,这为我解决了: pip install --upgrade pip
Go to virtual env by following command: .\<your virtual env name>\Scripts\activate
Go 通过以下命令到虚拟环境: .\<your virtual env name>\Scripts\activate
and type pip list
.并输入pip list
。 If you didn't saw django, please install django by: pip install django
如果您没有看到 django,请安装 django by: pip install django
If you still get this error or new one please edit post and put your setting.py source.如果您仍然收到此错误或新错误,请编辑帖子并输入您的 setting.py 源。 Thanks谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.