In the PyCharm editor, I have a python application named project3
with the following directory structure. The file load.py
just has a function (not class py file) def read():
, mip.py
is a py class file, and has own function method.
Project
|
+---- project1
|
+---- project2
|
+---- project3
|
+---- cnn.py
+---- load.py
+---- mip.py
In the cnn.py
, I want to import the load
and mip
file which I intend to use. My import code is as follows;
import load
from mip import f1
But I get the error:
No module named load
Unresolved reference 'mip'
In pycharm you must add project3
(and any other directories containing modules) as a root containing sources.
Right click on your project3
directory and in the context menu select: Mark Directory as > Sources Root
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With