Ubuntu18.04 Pycharm下ModuleNotFoundError: No module named 'deeplab'

1. According to https://www.cnblogs.com/zmbreathing/p/deeplab_v3plus.html after a successful run in the terminal deeplab the test file, the problem occurs in pycharm:

/home/mingzhou/anaconda3/bin/python3 /home/mingzhou/PycharmProjects/deeplab_model_test/deeplab_model_test.py
Traceback (most recent call last):
File "/home/mingzhou/PycharmProjects/deeplab_model_test/deeplab_model_test.py", line 20, in <module>
from deeplab import common
ModuleNotFoundError: No module named 'deeplab'

 

The https://blog.csdn.net/pipisorry/article/details/39909057#t9 set environment variables in a ~ / .profile method of invalid

But in the environment variable pycharm's already PYTHONPATH = / home / user / models / research /: / home / user / models / research / slim

Also found that if you use bash pycharm.sh start only above PYTHONPATH, if there is no direct start

第二天直接打开pycharm也有上述PYTHONPATH,但在user的bashrc和profile均修改了PYTHONPATH,此处还是不变

 

最后发现:

用快捷方式(sh方式)启动pycharm时,无论是修改~/.bashrc中还是~/.profile中的环境变量,pycharm中显示的系统环境变量都不变
但将电脑重新启动后,pycharm中显示的系统环境变量就会变为~/.profile中的环境变量

用bash方式启动pycharm时,pycharm中显示的系统环境变量变为~/.bashrc中的环境变量(需要重进终端)

 

3.发现conda没有安装jupyter、matplotlib、PrettyTable

输入conda install jupyter

conda install matplotlib

conda install PrettyTable

安装PrettyTable时出现错误

根据https://blog.csdn.net/ewba_gis_rs_er/article/details/84671406成功解决此问题

anaconda search -t conda PrettyTable

anaconda show lightsource2-tag/prettytable

conda install --channel https://conda.anaconda.org/lightsource2-tag prettytable

 

但还是没有解决No module问题

 

4.按照官方文档https://github.com/tensorflow/models/blob/master/research/deeplab/g3doc/installation.md将PYTHONPATH设为

export PYTHONPATH=$PYTHONPATH:/home/user/models/research:/home/user/models/research/slim

 出现以下错误

 

若按https://www.cnblogs.com/zmbreathing/p/deeplab_v3plus.html第5点将PYTHONPATH设为

export PYTHONPATH=$PYTHONPATH=/home/user/models/research:/home/user/models/research/slim

会再次出现No module named 'deeplab'问题

 

5.见https://www.cnblogs.com/zmbreathing/p/pycharm_cannot_import_monitoring_deeplab.html解决4中

ImportError:cannot import name 'monitoring'问题

Guess you like

Origin www.cnblogs.com/zmbreathing/p/pycharm_no_module_deeplab.html