I have a software which installs its own local Python 3.9. Included in its python39/lib/site-packages is Crypto package, which causes errors and seems old and incompatible with Python 3.9. It includes long integers, like 1L, which I fixed by removing the “L”. But I’m still getting the error below, even though the file exists. For now, I’m trying to fix
Tag: package
Not able to import a class from a another package in python
I’m trying to import a class from somename.py into nicename.py. At first I created the the __init__.py file and left it empty. Then I wrote (in nicename.py): and I also tried the command without double points at first. It returns: ModuleNotFoundError: No module named ‘getdir’ Answer Maybe not the most elegant but you can add the path in sys.path before
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
Running unittest with modules that must import other modules
Our Python 3.10 unit tests are breaking when the modules being tested need to import other modules. When we use the packaging techniques recommended by other posts and articles, either the unit tests fail to import modules, or the direct calls to run the app fail to import modules. The other posts and articles we have read do not show
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
I installed package, but python said No moudel any packages I try to install it
I try using pip and pip3 and python -m pip and all ways to install. The terminal says the packages already installed after the first try to install, but when I try to import the package I had error no moudel name. I feel the peoblem coming form here But I am not sure And when I go to packages
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