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 在此环境中不可导入
基础教程推荐
- 尝试制作WhatsApp机器人 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
