Skip to content
Advertisement

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 could I fix this problem? Answer The best you can do to organizing

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 for a module

How to migrate all packages, settings, user data etc. after updating to a newer Python version?

I’ve just installed Python 3.10 on Windows 10 and none of my scripts are working. For instance, when doing jupyter notebook I get I’ve been using Python 3.9 and all the scripts are still located in C:Program FilesPython39Scripts. However, there is nothing in C:Program FilesPython310Scripts (besides pip). As a first attempt to solve the problem, I uninstalled Python 3.10 leaving

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 find the module. The documentation

Including External Python Packages with Python Executable

I have made my own Executable from a python script which I want to run on a computer that does not have Python installed on it. My only problem is there are packages I have included which are not default python packages (e.g. pynput). Otherwise, the Executable would run fine without Python installed. Is there a way to include Python

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 and I got an attribute error: Package

Advertisement