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 在此环境中不可导入


- 我如何透明地重定向一个Python导入? 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01