Search code examples
pythoncygwin

Import *.pyd file Cygwin Python


I'm having an issue where my Cygwin Python installation does not recognize *.pyd files. It receives an ImportError: No module named 'understand' when attempting to import the *.pyd file. It is able to detect the file with os.path.exists().

I've experimented with other *.pyd files and have the same No module named XXX issue. I don't think it's a path issue as I tried putting .py files in the folder and was able to call them for other folders. What could I do to troubleshoot this issue?

(Mon Nov-11 4:42:49pm)-(CPU 27.4%:0:Net)-(ssia:/cygdrive/c/Program Files/SciTools/bin/pc-win64/python)-(11M:2)
 python3
Python 3.4.5 (default, Oct 10 2016, 14:41:48)
[GCC 5.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
import understand
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'understand'
 import os
 os.path.exists("understand.pyd")
True

Solution

  • Hm, solved.... In some sense.

    Cygwin's python does not allow the import of *.pyd files. I was forced to install a new version of python and use that instead.