Pycharm 错误 Django 在此环境中不可导入

Pycharm error Django is not importable in this environment(Pycharm 错误 Django 在此环境中不可导入)

本文介绍了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 在此环境中不可导入

基础教程推荐