Problem with reading *.pyd in Anaconda!

740 views
Skip to first unread message

bijan SayyafZadeh

unread,
Nov 8, 2023, 12:28:31 PM11/8/23
to cython-users
Hi everyone,

I have created a package that its .py files using cythonize have been converted to .pyd files. When users that downloaded Python from Python.org, install and use the mentioned package there is no problem and package work fine and .pyd files that are imported in __init__ are working great.

BUT

In anaconda environment, after installing package, the following error appears for users when they call the package:

ImportError: DLL load failed while importing PlotModel: The specified module could not be found.
To get ensure that the problem is not because of dependencies, I created a simple function in a .py file and convert it to .pyd using cythonize and the I got same error. Please if you can guide me what is the problem!

da-woods

unread,
Nov 11, 2023, 5:28:48 AM11/11/23
to cython...@googlegroups.com
It's difficult to say but there could be a few things:
* Cython pyd files are tied to a specific version of Python. So If you're running Python 3.9 normally and your anaconda version is Python 3.10 then they won't work.
* You could be mixing 32 bit and 64 bit.
* You could be missing something like visual c++ redistributables.

You might try using dlltracer to debug it (https://pypi.org/project/dlltracer/) - I've successfully used this in the past to work out what's missing.
--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cython-users/702d4c36-8323-4092-bc2a-c56a4b341481n%40googlegroups.com.


bijan SayyafZadeh

unread,
Nov 11, 2023, 2:29:27 PM11/11/23
to cython-users
Thanks D Woods

I will test it and tell you the results. 

With all the best,
Bijan

bijan SayyafZadeh

unread,
Nov 12, 2023, 11:34:44 AM11/12/23
to cython-users
Dear D Woods

using your explanations my problem solved. really and really appreciate and thank you so much.

With all the best,
Bijan



On Saturday, November 11, 2023 at 1:58:48 PM UTC+3:30 D Woods wrote:

Ian Bell

unread,
Nov 12, 2023, 9:34:39 PM11/12/23
to cython...@googlegroups.com
More generally, wheels are tied to particular combinations of python versions and platforms. You should use https://cibuildwheel.readthedocs.io/en/stable/ if you need to support multiple platforms and python versions. 

Reply all
Reply to author
Forward
0 new messages