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

查看:1543
本文介绍了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找不到项目的插入对象。

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是:

/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在此环境中不可导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆