Hello,
I was trying to use some APIs in bitstruct package (from: https://pypi.org/project/bitstruct/) in the Jython script file running under Arm Development Studio (ADS) v2021.2 (using "source dump_reg.py" command), the dump_reg.py is like as below:
HiMy name is Stephen and I work at Arm.Have you installed the Python package?Arm DS comes with Python 2.7, so you should be able to install it with e.g.:python -m pip install <module>Hope this helpsStephen
python -m pip install <module>
Hi Stephen,
Yes, I did install the Python package, and bitstruct worked on Python without any issue, but got that error message with Arm DS.
The only thing I am not sure is that my Python version is 3.11, not 2.7
Thanks
Xiaoming
Hi XiaomingI suggest you try installing the Python package into the Python 2.7 that comes with Arm DS.To do so, first open an Arm DS Command Prompt:
then install it with
Stephen
My system is Windows 10, under Arm DS Command Prompt, the path setting for ADS is in front of others:
PATH=C:\Program Files\Arm\Development Studio 2021.2\bin;C:\Program Files\Arm\Development Studio 2021.2\sw\java\bin;C:\ProgramData\Oracle\Java\javapath; ...
With this, the python used is the one installed outside ADS, its version is 3.X, and it says that module is already installed.
For Python 2.7 that comes with Arm DS, is there any path needs be specified?
Hi again Xiaoming,Apologies for not getting back to you sooner. I had mistakenly thought that "pip install" would work, but I can now see that it doesn't.Jython in Arm DS is v2.7.2. Is there 2.x-compatible version of bitstruct available? It appears to be for CPython 3 only.If not, then I'm afraid there isn't an easy way to import the package into Arm DS.The only workaround I can think of is to copy the relevant bitstruct code into your Jython project. That seemed to work for me.Hope this helpsStephen
Thank you for your help, it worked for me either.