pythonamibroker

Python Error 99 while integrating Amibroker with Python


I am trying to integrate Amibroker 6.41 (64-bit) with Python. Currently, I have Python 3.11.1 (64-bit) stand-alone installed along with NumPy, and pandas installed using pip in the python library.

I have installed AmiPy.dll into the Amibroker plugin folder and Amibroker acknowledged its presence.

Need your advice on the following error received while trying to set up cointegration afl using python.

Error 99. Error occurred during Python execution: *ModuleNotFoundError: No Module named '_ctypes' *callback:

It seems to me that it is unable to import the following:

from ctypes._endian import BigEndianStructure, LittleEndianStructure
from ctypes._endian import BigEndianUnion, LittleEndianUnion

On further investigation, it seems that somehow my latest Python 3.11.1 doesn't have ctypes installed. Hence the AmiPy Dll is unable to import the above files.

Unable to decide what should be my next step to resolve this issue.


Solution

  • Finally solved the issue by uninstalling Python 3.11.1 and installing Python 3.10.8 as Python 3.11.1 is broken. The issue is highlighted in the bug report on GitHub (link given below)

    So suggest all not to install or use Python version 3.11.1 due to DLLs not being added to sys.path in embedded startup on Windows.

    [[1]: https://github.com/python/cpython/issues/100320][1]