I installed the mahotas library as the site says to but i keep getting the same error when i try to import the module:
Could not import submodules (exact error was: DLL load failed: The specified module could not be found.).
There are many reasons for this error the most common one is that you have
either not built the packages or have built (using `python setup.py build`) or
installed them (using `python setup.py install`) and then proceeded to test
mahotas **without changing the current directory**.
Try installing and then changing to another directory before importing mahotas.
Someone knows what i'm doing rong?
You seem to be on Windows.
For that platform, I recommend you try these compiled packages: http://www.lfd.uci.edu/~gohlke/pythonlibs/
(I'm the author of mahotas)
Related
I'm working on linux ubuntu 20.04. I opened new python project using Pycharm IDE, and I've installed a package called aihwkit, the documentation and the source.
When running the examples given with the source code, which use modules imported from a directory called inference such as example 06_lenet5_hardware_aware.py I'm getting an error:
ModuleNotFoundError: No module named 'aihwkit.inference'
although other folders, in the same directory as inference are imported as well and they work well. I'm trying to import this manually, but not sure how to do it.
This is the hierarchy of the folders: I'm calling inference like this:
from aihwkit.inference import PCMLikeNoiseModel
from the file examples/06_lenet5_hardware_aware.py when the module PCMLikeNoiseModel source code lies in the following path: src/aihwkit/inference/noise/pcm.py
please note that the problem is that the name aihwkit.inference is not found, while other names such as aihwkit.nn do not raise any error, and they reside in similar path to inference.
I'm adding a picture of the hierarchy in case it helps:
how can I import this folder manually?
Thank you
Since you're on Linux, you can try to install your package before importing it with:
sudo apt-get install python-#name_of_your_package
written in your terminal, or you can try to install it with pip
I downloaded a project and am running through and installing all dependencies. At first I had errors regarding No module named utm and No module named paho. I solved these issues by going to C:\Users\me and using pip install paho-mqtt and pip install utm. Easy enough.
I then have this line "from mfa_msgs import Mission, WaypointList, MissionControl, ControlCommand, Status" and am getting a No module error here. mfa_msgs is a folder found in the project I downloaded that contains the Mission, WaypointList, etc. files. Where do I need to put the mfa_msgs folder in order to be able to access them?
Appreciate your time!
I'm working in Windows 10 with Python 3.8.6 and using PyInstaller 4.0 to compile my script as an executable for distribution. I just added a feature today that required importing win32clipboard. PyInstaller finishes compiling without any errors, but the excecutable fails to load due to:
ImportError: DLL load failed while importing win32clipboard: The specified module could not be found.
I attempted to compile the program again using the hidden-import flag:
pyinstaller myscript.py --onefile --hidden-import win32clipboard
This produced the same result and an ImportError upon trying to load the program (no errors during compiling).
I know that win32clipboard is part of pywin32 and my program compiled and ran without any issues prior to the code changes that required importing it. It still runs fine out of IDLE and functions as intended when using the win32clipboard-enabled features.
Is there some way to manually direct PyInstaller to import this correctly, or some other way to fix this issue and get the executable working again?
I was able to work around this issue by importing pywintypes into my script before win32clipboard.
import pywintypes
import win32clipboard
Found the suggestion in an old GitHub bug report for an issue people were having importing win32api with PyInstaller and decided to give it a try. I was able to compile and run my program without any issues after doing this.
Working with PyInstaller: 5.1, Python: 3.8.12 (conda), and Platform: Windows-10.
In addition to the solution from #DJT of importing pywintypes before win32clipboard, I solved the same error by downgrading my pywin32 from version 228 to version 225. Just type the following command with the building environment active:
pip install --upgrade --user pywin32==225
I know this subject has been brought up before, I've tried all the fixes I've found to no avail. When i try to import cv2 i get the message:
DLL load failed: %1 is not a valid Win32 application.
I'm running python 2.7 on windows 7, 64bit. I've tried installing cv2 using:
python -m pip install cv2
as well as installing the .whl file (opencv_python-2.4.12-cp27-none-win_amd64.whl) the same way. Both times, cmd prompt tells me they've installed correctly, but I still can't import cv2.
The next thing i tried was downloading the latest version of opencv and following the directions here to install it.
I also tried including the paths to the .pyd file in my environment variables:
c:\opencv\build\python\2.7\x64; c:\Python27\Lib\site-packages
I still get the error upon trying to import cv2:
DLL load failed: %1 is not a valid Win32 application.
next, i tried the solved fix proposed in this thread next, I've tried the solved fix proposed in this thread ImportError: DLL load failed: %1 is not a valid Win32 application
However, i had no opencv binaries path that looked like (C:\opencv\build\bin\Release) so i added two paths, c:\opencv\build\x64\vc12\bin and c:\opency\build\vc11\bin to my PATH environment variables. However, this has no effect either and i still get the error upon trying to import cv2. what could i be doing wrong?
Have you tried the wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv ?
There is a 2.4.13 available, maybe that will fix things?
The default version of python (ie, one that opens on typing "python" in command line) is 2.6 on my server. I also have 2.7 installed. How do I import a module, in this case numpy, in python2.7? When I try to import right now, it gives me an error -
ImportError: No module named numpy
Is there any workaround, apart from downloading the package and doing a build install?
I agree with the comment above. You will have to compile it separately. I once tried a hack of importing and modifying the sys.path however I ran into issues with the .so files.