DataSpell: Module not found error import from directory

472 views Asked by At

I have two files in the same folder:

-- my folder
   - myfunct.py
   - merge.py

In merge.py I import myfunct.py. I use conda venv, when I run directly from terminal:

conda activate da
python merge.py 

everything works. When instead I run from DataSpell (with the same interpreter of that virtual environment) it gives ModuleNotFoundError: No module named 'myfunct'

I have the root folder in path and the same virtual environment, the two files are in the same folder... Everything works as usual also by setting up PyCharm, what am I missing? What can I check in DS to be sure everything is setup properly?

2

There are 2 answers

0
Polina Popova On
0
user1689987 On

Also note the Python file naming restrictions of not having dashes, special characters, or extra periods in the file name, though an underscore is fine.