Pycharm error Django is not importable in this environment(Pycharm 错误 Django 在此环境中不可导入)
问题描述
我在 Pycharm 中遇到以下错误.
I'm getting the following errors in Pycharm.
错误:Django 在此环境中不可导入
Error: Django is not importable in this environment
它曾经运行良好,但我将项目和 virtualenv 移动到其他目录并出现错误.这很奇怪,因为如果我运行项目而忽略了我得到的配置设置警告,那么工作正常.
It used to work well but I moved the project and virtualenv to other directory and the error appeared. It's weird because if I run the project ignoring the configuration settings warning that I get, works fine.
问题是,现在 Pycharm 没有找到项目的interperter.
The problem is that now, Pycharm is not finding the project interperter.
Pycharm 正在运行的命令是:
The command that Pycharm is running is:
/Users/plorenzo/../gestorSchools/venv/bin/python3.4 /Users/plorenzo/../gestorSchools/schoolsManager/manage.py runserver 8000
virtualenv 已激活.
The virtualenv is activated.
我的 $PATH 是:
My $PATH is:
/Users/plorenzo/../gestorSchools/venv/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
还有我的 $PYTHONPATH:
and my $PYTHONPATH:
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4
我花了几天时间试图找到解决方案,但找不到.
I spent a few days trying to find the solution but I couldn't find it.
推荐答案
我终于找到了错误.问题是 virtualenv 路径中的一个文件夹名称带有重音符号.
I finally found the error. The problem was that one folder name in the virtualenv path had an accent.
这是旧路径:
/Users/plorenzo/../telefónica/gestorSchools/venv
这是新的有效的:
/Users/plorenzo/../telefonica/gestorSchools/venv
这篇关于Pycharm 错误 Django 在此环境中不可导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Pycharm 错误 Django 在此环境中不可导入


基础教程推荐
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 包装空间模型 2022-01-01