PRO
oisin.cawley
Ireland
Asked
— Edited
I tried following the instructions at https://synthiam.com/Support/python-api/add-custom-python-modules but ran into issues so I uninstalled ARC and reinstalled. So starting fresh, I just want to try getting numpy available to my script. I created a new python script in ARC as follows: import sys print(sys.version) print(sys.executable) import numpy
I get the following output:
The import and calls to SYS work (even though executable is empty for some reason), but I would expect to see something along the line of "module not found" for the numpy import. Why am I seeing the above error and what does it mean here?
Thanks Oisin
Related Hardware EZ-B v4
Just as an fyi, the screenshot you posted can't be read by Athena AI. You'd have to provide a copy and paste in text. In addition, you have not posted example code. Please provide information, such as the code you're executing and the steps you took to get there
I did but your webpage squashed it all up into the following line: import sys print(sys.version) print(sys.executable) import numpy
Further to this I note that the command "add_dll_directory" only came in in python 3.8, so why do I see it here in ARC's version 3.4?
It seems like you're encountering an issue with importing the
numpy
module in ARC's Python scripting environment. Let's address your concerns step by step:Python Version in ARC: ARC uses a specific version of Python that might not support all the latest features or modules. The
add_dll_directory
function is indeed available from Python 3.8 onwards, and if ARC is using Python 3.4, this function won't be available.Installing Python Modules in ARC: To use external Python modules like
numpy
in ARC, you need to ensure that the module is installed in the Python environment that ARC uses. Here’s a general approach to do that:sys.executable
is not providing the path.pip
to installnumpy
. For example:Troubleshooting:
sys.executable
is empty, it might indicate an issue with how ARC is configured to use Python. Ensure that ARC is correctly set up to use its Python environment.numpy
, please share them here. They can provide more insight into what might be going wrong.Alternative Solutions:
If you continue to face issues, please provide any error messages or additional details, and I'll be happy to assist further!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
So I think I have the following issue happening: I try import numpy and it tells me "No module named 'numpy'". All good.
I run the following install: pip install numpy --target="C:\Users\oisin\Documents\ARC\Python Modules"
It installs numpy version 2.3.1 in the above directory. When I try import it in a script I get "invalid syntax". I am assuming that this is because ARC uses Python 3.4.1 for which I would need an earlier version of numpy?
So I deleted the files from "Python Modules" and tried the following install: pip install numpy==1.16.0 --target="C:\Users\oisin\Documents\ARC\Python Modules" But this generates errors and does not install. This might be because I have Python 3.10.10 installed on my machine. Does all this make sense and if so do I have to downgrade my machine to 3.4.1 and then run the installs?