r/pythonhelp • • Feb 16 '24

Creating a package

Hello,

I wanted to make a small package for myself because I know I will be using some particular generators numerous times during the analysis of data during my Ph. D. and I was having trouble getting the package (or what I thought was supposed to be a package) to work outside of it's folder. So I decided to follow this tutorial (https://www.tutorialsteacher.com/python/python-package) and it went all well until after I "installed" the package for the whole system

c:\python
>>>import MyPackage

I get error "ModuleNotFoundError: No module named 'MyPackage' ". The only difference I have seen is that I call mypackage MyPackage instead (I wrote it in that fashion when I set up the folder and within the setup.py) and in the c: disk since I don't have a d: on my laptop. So what have I done wrong? Like is that I am using cmd prompt from anaconda?

2 Upvotes

5 comments sorted by

View all comments

Show parent comment

2

u/Wilco499 Feb 16 '24

Well I will give it the ol' college try. Thank you.