pycharm not find module

Problems discovered

ModuleNotFoundError: No module named ‘common’
Here Insert Picture Description

My thinking

This should be the time I created the environment, the original creation of the virtual environment, no problem. Now change the local environment, the discovery could not find the module. Code is no problem, that's for sure, because previously possible. So, I would not be surprised, why change the pycharm python module suddenly can not find it. So we started to look for to find, in the end what happened.

My actions

View Settings:
Here Insert Picture DescriptionAnalysis:
here has replaced local path, therefore we can not find common path. I think the configuration environment variable can solve the problem, or every time before the common path of the temporary plus references. We take the second approach.
Practice case:
Here Insert Picture Descriptionadd a statement:

sys.path.append(r"D:\360MoveData\Users\lenovo\Desktop\startProject\OAS.Cloud.PAAS_Interface")

We found no errors. Sometimes you think about it, what I'm really he's a genius!

Published 25 original articles · won praise 0 · Views 2667

Guess you like

Origin blog.csdn.net/weixin_43431593/article/details/104071342