Skip to content

Tag: package

What is the correct way to import this class?

I have the following repository structure: In moduleB.py I need to import MyClass, I use the following command: When I run the main() function in moduleB.py I have the following error: ModuleNotFoundError: No module named ‘directoryA’ I run the moduleB.py from directoryB in the following way: How …

Imported package searches for modules in my code

Can someone explain me what is going on here and how to prevent this? I have a main.py with the following code: I outsourced some functions into a module named utils.py: When I run this I get the following output: So it seems like the torch package I imported has also a utils resource (package) and searches f…

How to install the package scikit-geometry?

I am trying to compute a class of Minkowski sums for some mathematical work, but there are too many to do by hand in a reasonable amount of time. I found this documentation for a package called scikit-geometry, but when I write import skgeom as sg as in the examples in the documentation, VSCode can’t fi…

Python Package Creation

I have a package i am trying to create. The directory hierarchy looks like this. I have some other file main.py that is not in the package and inside I have put The output from this is however I was expecting to see “Part1”, “Part2”, and “Part3” in this list. I also tried a…