I am using PyCharm. I have a python script in the following location:
C:\Users\XYZ\PycharmProjects\Project1\playground.py
playground.py
only has a line of code as shown below:
import PyTbl
In the Project1
folder there's another file:
C:\Users\XYZ\PycharmProjects\Project1\PyTbl.pyd
When I run the Python script playground.py
I get the following error:
ImportError: numpy.core.multiarray failed to import
Traceback (most recent call last):
File "C:/Users/XYZ/PycharmProjects/Project1/playground.py", line 1, in <module>
import PyTbl
SystemError: initialization of PyTbl raised unreported exception
If I hover my mouse over the line of Python code in playground.py
in the PyCharm editor I get the following error message:
"No module named PyTbl"
Any idea how should I import a .pyd
file into a Python script?
__init__.py
file in the directory? This is a empty file that is needed to import .py files that aren't in the default libraries. – Shimmery.pyd
file. But it isn't Python, it is object code, probably originally C. If the DLL doesn't load, that usually because (1) it is trying to load another DLL that is missing or not findable; or (2) you have a 32-bit system and your code is trying to load a 64-bit DLL, or vice versa. – Alessandro__init__.py
in the directory as well. – Glossography