I am trying to install the PyLZJB.pyd file from here:
https://code.google.com/p/pylzjb/downloads/list
I have downloaded the file and placed it in my Python27/DLLs folder where I also see some other .pyd files. I am on Windows.
I have tried
import PyLZJB.pyd
and
import PyLZJB
Based on another answer I also tried:
import sys
sys.path.append("C:\Python27\DLLs")
before the import.
I continue to get the message:
ImportError: DLL load failed: The specified module could not be found.
There's only dlls built for Python-2.6 in the site.
You cannot use dll built for Python2.6 in Python 2.7.
Find the dll built for your system (platform, python version should match). Or build it yourself.
Related
I have a dll file that I need to import in Python. However when I try to load the assembly I get the error:
ModuleNotFoundError: No module named 'TEST_NET'
The assembly dll file is located in C:\Program Files\TEST APP\APP 7.0 under the name TEST_NET.Core.dll
My code is the following:
app_version = "7.0"
app_library = "C:\Program Files\TEST APP\APP 7.0"
# load app assemblies... replace the path below with the installation
# installation folder for your app installation.
# Import from .NET assemblies (both App and system)
sys.path.append(app_library)
clr.AddReference('TEST_NET.Core')
from TEST_NET.Core import*
The code was working well with a previous app version. But the new app that contains the file has return this issue where the module is not found when trying to import. Any idea what might be wrong here?
Thanks!
use ctypes to import a dll
import ctypes
dll = ctypes.WinDLL (r"C:\Program Files\TEST APP\APP 7.0\TEST_NET.Core.dll")
I am running python 3.6, I have already installed the correct version of dotnet from the official site. When I launched python console and import dotnet, I got the following error:
File "...\lib\site-packages\dotnet\moduleloader.py", line 24, in <module>
from dotnet import PyDotnet as _dotnet
ImportError: DLL load failed: The specified module could not be found.
Spotted one of the comment from this post, if you rename boost_python3-vc141-mt-1_64.dll to boost_python3-vc150-mt-1_64.dll it will solve the issue, reason is unknown. The dll should site under Lib/site-packages/dotnet.
I'm trying to run a Python script from the Windows shell, but when I do
python path\to\file\script.py
I get an error "DLL load failed: The specified module could not be found" and it traces back to the line where I import numpy.
C:\Users\Admin>python path\to\file\script.py
Traceback (most recent call last):
File "path\to\file\script.py", line 8, in <module>
import numpy as np
File "C:\Users\Admin\Anaconda3\lib\site-packages\numpy\__init__.py", line 140, in <module>
from . import _distributor_init
File "C:\Users\Admin\Anaconda3\lib\site-packages\numpy\_distributor_init.py", line 34, in <module>
from . import _mklinit
ImportError: DLL load failed: The specified module could not be found.
The weird part is that when I run it in an editor like Spyder, numpy imports just fine. Can someone help me?
Thanks
It's fixed Anaconda path issue. Check your %PATH% if it's correctly defined.
Source: https://github.com/numpy/numpy/issues/12957
This is a common problem when installing python packages, mainly in windows.
Numpy and other packages have bindings to C++ code that require some special dependencies.
Rather than trying to get the dependencies exactly right for compiling the package, you can use a precompiled "wheel" file from one of several sources.
I use Chris Gholke's site
download the .whl file and install using
pip install directory/path/package.whl
edit: and as a note, the python environment you access from powershell or cmd is different from the anaconda environment in spyder. One of the differences between conda and pip is that conda installed precompiled packages while pip does not.
I solved my issues with Numpy DLL load issues by replacing Anaconda3 with WinPython.
I installed wmi with the installer here http://timgolden.me.uk/python/wmi/index.html
but I can't get the module to import.
Here is my code:
import wmi
c=wmi.WMI()
for os in c.Win32_OperatingSystem():
print(os.Caption)
and here is the error:
Traceback (most recent call last):
File "C:/Python33/Programs/WMI trial.py", line 1, in <module>
import wmi
File "C:\Python33\lib\site-packages\wmi.py", line 88, in <module>
from win32com.client import GetObject, Dispatch
ImportError: No module named 'win32com'
Any idea why this isn't working? I have a 64 bit system but that hasn't affected running 32 bit python at all.
Any help is greatly appreciated!
you are missing the 'Python For Windows Extensions' (pywin32).
WMI module requires pywin32.
run the appropriate installer for pywin32, then try WMI again.
The "No module named 'win32com'" error is because it can't find the winm32com module (which is installed as part of pywin32 package.)
What worked for me is:
i downloaded the source named: WMI-1.4.9.zip from https://pypi.python.org/pypi/WMI/
Extracted all files from that zip file and saved it in a folder named: WMI-1.4.9 and then copied that folder to C:\Python27\Lib\site-packages.
After that I navigated to that folder C:\Python27\Lib\site-packages\WMI-1.4.9 and did a shift + right click -> Open Command line here and ran: python setup.py install
That's it, after that it worked for me like charm. No issues.
p.s - While installing exe I had some weird Access Denied errors, I tried by running the exe as Administrator even then I could get through it. Hence that didn't at all work for me.
Edit:
Also I had pywin32 installed from here:
http://sourceforge.net/projects/pywin32/files/ (select the correct file - 'bittedness' and python version wise)
I'm trying to add win32com to Python 2.7. After looking at this, I added the directory with the _init file (Python27\Lib\site-packages\win32com) but I still get it. I went so far as to try to add a bunch of different folders to the path that seem to have to deal with win32com but I still get the error. If it knows where the file is and I added that folder to PYTHONPATH, why is this happening? I'm using PyDev with Eclipse Juno. My code:
import win32com.client
print("hello world")
when I try to run this, i get this error
Traceback (most recent call last):
File "C:\Users\Daniel\EclipseWorkspace\PhotoScript\src\scriptLaunch.py", line 1, in <module>
import win32com.client
File "C:\Python27\Lib\site-packages\win32com\__init__.py", line 5, in <module>
import win32api, sys, os
ImportError: DLL load failed: The specified module could not be found.
in my case typing in cmd:
python C:\Python27\Scripts\pywin32_postinstall.py -install
cmd Windows
I hope this helps
Try installing ActivePython, it includes win32com:
The Python for Windows Extensions (PyWin32 version 214).
The interface to the Win32 API (win32api).
The interfaces to Win32 COM (win32com and win32comext).
The Pythonwin Development Environment.
*ActivePython is fully binary compatible with python.org Python builds to ensure that 3rd-party binary extensions just work*
Try to install python for windows extensions:
https://sourceforge.net/projects/pywin32/files/pywin32/Build%20210/