Import fails in terminal but works in PyCharm
问题 I'm using PyCharm for a project with the following file hierarchy: And I'm running main.py in PyCharm with the following configurations: Working Directory: /Users/me/longpath/project/amlproject/pca_mixtures . When I try to run in terminal, it fails: ~/longpath/project/amlproject/pca_mixtures$ python main.py Traceback (most recent call last): File "main.py", line 2, in <module> from pca_mixtures.funcs import PCAMixture ModuleNotFoundError: No module named 'pca_mixtures' and nothing changes if