manage.py“Couldn't import Django”报错的问题解决
问题分析:
在pyharm中项目可以正常运行但是在终端 终端输入python manage.py runserver首次测试项目时,出现了无法引用Django的错误。
Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named 'django' During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "manage.py", line 14, in <module>
import django
ImportError: No module named 'django' During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "manage.py", line 17, in <module>
"Couldn't import Django. Are you sure it's installed and "
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?
可能出现的问题:
- 有不同版本的Python,当前项目使用了没有安装Django的Python。
- 创建的虚拟环境时,没有导入之前下载的包,导致在环境下搜索不到Django。
- Django版本过低。
解决方案:
将pyharm文件夹下site-packages中所有的文件复制一份到python的Lib文件夹 虚拟环境中。


然后就可以在终端跑起你的项目咯

manage.py“Couldn't import Django”报错的问题解决的更多相关文章
- Django学习(1)——python manage.py startapp app-name新建app报错问题
作为一个刚接触python的小白,开始学习Django注定前路漫漫,记录一下学习过程中的问题和解决方案. 感谢“自强学堂”的无私奉献,根据教程安装了Django 1.9.12后,尝试新建项目,此时使用 ...
- eclipse+PyDev里面import win32api报错的问题解决
windows下面eclipse+PyDev的开发环境,安装了pywin32,写import win32api时老提示错误,在idle里正常执行. 原来是安装python库时,python安装路径下面 ...
- Django报错:OSError: raw write() returned invalid length 4 (should have been between 0 and 2)
在使用Django时Django报错:Django报错:OSError: raw write() returned invalid length 4 (should have been between ...
- 在cmd下import cv2报错——OpenCV实现BRISK
平台:win10 x64 +JetBrains PyCharm 2018.2.4 x64 +Anaconda3(python3.7.0+opencv3.4.5) Issue说明:同学发了个python ...
- Django 报错 Reverse for 'content' not found. 'content' is not a valid view function or pattern name.
Django 报错 Reverse for 'content' not found. 'content' is not a valid view function or pattern name. 我 ...
- appium---【已解决】【Mac】from appium import webdriver报错提示“Unresolved import webdriver”
报错提示: from appium import webdriver提示Unresolved import webdriver 报错原因:没有安装Appium_Python_Client 解决办法: ...
- pycharm 中 import requests 报错
一 , 使用Pycharm来抓取网页的时候,要导入requests模块,但是在pycharm中 import requests 报错. 原因: python中还没有安装requests库 解决办法: ...
- Django报错:提交表单报错---RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and you have APPEND_SLASH set.
Django报错:提交表单报错---RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and ...
- import tensorflow 报错: tf.estimator package not installed.
import tensorflow 报错: tf.estimator package not installed. 解决方案1: 安装 pip install tensorflow-estimator ...
- pycharm import scrapy 报错,No module named 'scrapy'
本地通过下载 pip install scrapy安装成功后,在pychram里面 import scrapy报错 后来在找了各种解决方法,重装wheel,twisted,都不行,最后发现是需要改Pr ...
随机推荐
- ansible系列(26)--ansible的tags标签
目录 1. tags标签 1.1 指定执行某个tags 1.2 指定排除某个tags 1. tags标签 默认情况下, Ansible 在执行一个 playbook 时,会执行 playbook 中所 ...
- 🔥fastposter v2.19.0 一款很哇塞的海报生成器
fastposter v2.19.0 一款很哇塞的海报生成器 fastposter 是一款快速开发海报的工具,已经服务众多电商.分销系统.电商海报.电商主图.行业海报等海报生成和制作场景. 什么是 f ...
- 海康威视web插件安装后,谷歌浏览器还是不能看视频问题
首先要根据弹出的信息提示,下载并安装视频播放插件, 安装完成后重新打开谷歌浏览器,重新登录系统,如果还是不能看视频,请按下面的方法设置: 步骤1:谷歌浏览器,地址栏中输入:chrome://flags ...
- Nifi:Nifi中的Controller Service
Service简介 首先Nifi中的Controller Service 和我们MVC概念中的Controller Service不是一个概念,Nifi中的Controller Service更像是和 ...
- 鸿蒙Blank
Blank组件占剩余空间,类似占位组件一样
- pageoffice 5.x升级到pageoffice 6.x的关键步骤
Vue+Springboot前后端分离项目 将后端Springboot项目中pom.xml文件中对于pageoffice的jar引用升级成6.0版本,以maven中央仓库(https://mvnrep ...
- 使用systemctl管理服务(nginx)
首先调整好路径信息,修改配置文件vim /usr/lib/systemd/system/nginx.service [Unit]Description=The nginx HTTP and rever ...
- vue2遇到的一些错误
一.VUE中的VUEX如何调用modules里面的mutations和state ...mapMutations("workflow",['setApproverConfig' ...
- 【Sqlserver】查看所有数据库的大小 创建日期 名称 版本级别 状态
EXEC sp_helpdb
- Android桌面Launcher源码浅析
在Android启动过程-万字长文(Android14)中介绍了Android系统的启动过程,本篇文章将继续介绍桌面应用Launcher. 一.Launcher介绍 在Android启动过程-万字长文 ...