django - 由于 manage.py 文件中的错误,无法运行 django 项目
问题描述
我正在做 django 项目。我的python版本是2.7.15,django版本是1.11.29。当我试图执行
python manage.py runserver
我收到如下错误 -
File "manage.py", line 17
) from exc
^
SyntaxError: invalid syntax
为了解决这个问题,我从 exc中删除并再次运行,然后它会引发如下错误 -
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 13, in main
"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?
可能是stackoverflow本身已经有类似的问题,但这些解决方案在我的情况下不起作用,因此我问我的问题。请建议我如何解决它?提前致谢。
解决方案
推荐阅读
- python - 如何使用 Flask/Jinja2 连续渲染项目?
- php - 从 Android 手机获取 userAgent
- javascript - 多维默认数组
- r - 如何对 qwrap2 summary_table 的输出列进行排序
- javascript - 访问车把模板中的环境变量
- python - 如何在 Django 中创建从 AbstractUser 继承的多个 UserProfile?
- php - 图片上传到 TMP 文件位置不正确
- ruby-on-rails - Rails 6 + 纱线 + 数据表问题
- sql - 如何修复递归 CTE 以基于 sys.foreign_keys 建立表依赖关系?
- android - 根据 JSON 数据移动到多个活动