Python Error 99 while integrating Amibroker with Python - 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.

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]

Related

Python Perforce module Error: No module named 'P4'

I got the P4 python module for win10 via the installer on their page: https://www.perforce.com/downloads/helix-core-api-python
Its for python 3.9, though I have tested it with both Python 3.10 and 3.9 and it always throws the error: No module named 'P4' when I try to use it inside visual code.
Interpreter is set up correctly (tried 310 and 39).
Im a bit lost here and would love some help.
The installer package installed the following files into site-packages:
P4.py
P4API.cp39-win_amd64.pyd
and a folder with 4 metadata files in it
P4.py on itself looks good, no errors.
Edit: Im trying to use it with Blender. Currently shipped python version within that is 3.10.2. Also tried a older blender version which uses 3.9.7.
Both wont work.
Visual studio code is known for it's bugs with python. You could try using "PyCharm". Make sure to install the modules from Pycharm's settings instead of terminal.
(I'm not sure if this is the reason, but it's worth the try. Had the same issue and the mentioned way solved it.)

import error even after installing the utils in python3.6

I am trying to run an image recognition code. Even after installing 'utils' I am still getting error that module not found. What should I change?
Check if your python version is compatible. According to docs it's up to python 3.4 and you seem to be using 3.6. Source - https://pypi.org/project/python3-utils/#data

ImportError: No module named 'resource'

I am using python 3.5 and I am doing Algorithms specialization courses on Coursera. Professor teaching this course posted a program which can help us to know the time and memory associated with running a program. It has import resource command at the top. I tried to run this program along with the programs I have written in python and every time I received ImportError: No module named 'resource'
I used the same code in ubuntu and have no errors at all.
I followed suggestions in stackoverflow answers and I have tried adding PYTHONPATH PYTHONHOME and edited the PATH environment variable.
I have no idea of what else I can do here.
Is there any file that I can download and install it in the Lib or site-packages folder of my python installation ?
resource is a Unix specific package as seen in https://docs.python.org/2/library/resource.html which is why it worked for you in Ubuntu, but raised an error when trying to use it in Windows.
I ran into similar error in window 10. Here is what solved it for me.
Downgrade to the Apache Spark 2.3.2 prebuild version
Install (or downgrade) jdk to version 1.8.0
My installed jdk was 1.9.0, which doesn't seem to be compatiable with spark 2.3.2 or 2.4.0
make sure that when you run java -version in cmd (command prompt), it show java version 8. If you are seeing version 9, you will need to change your system ENV PATH to ensure it points to java version 8.
Check this link to get help on changing the PATH if you have multiple java version installed.
Hope this helps someone, I was stuck on this issue for almost a week before finally finding a solution.

Python GDal installation

Having some problems with Gdal installation with python 2.7 on Windows 7 32bit. I am running MSVC 2010. I have followed the instruction from the blog website
http://cartometric.com/blog/2011/10/17/install-gdal-on-windows/
The installation is fine. At the end of it, I am able to run ogr2ogr in the MS-DOS and have gotten the similar screen as listed in the blog.
However, when I am trying to use the command "import osgeo" on the Python IDLE GUI shell. A series of error message is released, reading like the following
"DLL error:.........."
I believe that this might mean that the python binding is of wrong version. I have cleared up my installation by removing the following: Python-Gdal binding, Gdal, Python 2.7
After removing them, I have retried my installation with Python 3.2.3 instead and loaded the Gdal package and python binding accordingly. However, the same error returns.
Is there any intermediate steps that I could take to verify the installation. Any other advice I could have to have the bindings installed? Or is my reinstallation method correct?
I have tried to install FWTools too. It doesnt seem to work either. I have run the Python shell from EV-shell and type in "import osgeo". Have gotten the message "no module exist...."
Thanks
Get the precompiled gdal from here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
I have some other notes on setting up postgres and postgis 2.0 here if you need it:
http://monkut.webfactional.com/blog/archive/2012/5/2/using-django-14-with-gdal-19-and-postgis-20/

RuntimeWarning: in python 2.6 while importing python-pycrypto-2.3-1.el3.pp

I have installed "python-pycrypto-2.3-1.el3.pp" and "python-paramiko-1.7.6-1.el3.rf" in red hat linux and using python2.6 version.
And when I import paramiko, I get below RuntimeWarning mismatch:
/usr/local/lib/python2.6/site-packages/Crypto/Random/Fortuna/SHAd256.py:38:
RuntimeWarning: Python C API version mismatch for module Crypto.Hash.SHA256: This Python has API version 1013, module Crypto.Hash.SHA256 has version 1011.
please help how to resolve this problem.
The EL3 packages are for EL3 Python. Since you've installed Python from source yourself, perform a source installation of those modules.

Categories

Resources