I have a project which I'm trying package with conda, install, and run.
I cannot import the module by name, although installed. I can however import the module main.py
and execute it's function print_hi
. Demonstrated below.
Python 3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import myfuncondaproject
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'myfuncondaproject'
>>> import main
>>> main.print_hi("Liam")
Hi, Liam
My project structure.
myfuncondaproject/
├── __init__.py
├── main.py
└── setup.py
Seems to be in line with suggested file structures, although I'm assuming the problem lies in the structure.