stlehmann / pyads

Python wrapper for TwinCAT ADS
MIT License
253 stars 94 forks source link

Could not find module 'TcAdsDll' with python 3.8.0 #105

Closed yannickasselin closed 4 years ago

yannickasselin commented 4 years ago

Hi, Running pyads in python 3.7.5 works fine but when trying to import pyads in python 3.8.0 I get this error:

FileNotFoundError: Could not find module 'TcAdsDll'. Try using the full path with constructor syntax.

klauer commented 4 years ago

Python 3.8 changed how Windows DLL paths work with ctypes, only loading from trusted locations.

See: https://docs.python.org/3/whatsnew/3.8.html#ctypes https://docs.python.org/3/whatsnew/3.8.html#changes-in-the-python-api (search for DLL)

yannickasselin commented 4 years ago

I'm sorry. I'm really just a beginner. What do I need to do to make it work?

stlehmann commented 4 years ago

OK, seems we need to use add_dll_directory here to allow loading the DLL from working directory.

disgustingBot commented 3 years ago

Hi, I'm having this same problem, using Windows, python version is: 3.9.5, and pyads version is 3.3.7 what should I do to allow the usage of the dll file?? I also ran a search throughout the whole OS for "TcAdsDll.dll" and got no result.

any advise?

stlehmann commented 3 years ago

Hey Sofia, did you install TwinCAT on Windows?

miklg commented 1 year ago

Hi @stlehmann It's 100% necessary to have installed TwinCAT in Windows to communicate with Beckhoff PLC via pyads?

chrisbeardy commented 1 year ago

@miklg Yes it is, or at least just the ADS version, see my stack opverflow answer: https://stackoverflow.com/questions/76305160/windows-10-python-pyads-library-error-could-not-find-module-tcadsdll-dll