I am unable to use the Ximea API (python) on linux. The documentation makes it seem like I only have to install the software package (documentation link 1/2) and the library will be available for import in any python script (documentation link 2/2). This is not the case. In windows, one can just copy-past the library from the installation folder. This is not possible in linux : the folder /opt/XIMEA
does contain the python example scripts, but it does not contain the library folder itself.
Where can I find the python library folder for linux? How should I go about installing this in conda or another virtual environment?
Regards, Jan
The answer was provided to me via the XIMEA helpdesk.
Hello,
You are right that the python xiapi is not usable after installation without further steps to ensure so in some cases. There seems to be a compatibility issue with the latest version of python and our software package installation script, because of which the files aren't copied correctly to the right location. We will work on analyzing and fixing this, and to do so, we would appreciate if you could provide us with a few more information. Please send us a xiCOP report, version of Python you are using, and the output of the software package installation script if possible. These may help us find out where exactly the problem is. Thank you for your feedback, it is helping us greatly to improve our products.
Meanwhile, in the next steps I'll help you copy the files manually to get the API to work right now:
- Locate the downloaded and unzipped folder "XIMEA_Linux_SP" from the first step of our software package installation guide (for me it was on Desktop but this may differ for you).
- Navigate to the /XIMEA_Linux_SP/package/api/Python/ folder and go to either "v2" or "v3" folder according to the python version you're using. There you'll find a folder "ximea" inside of which are the xiapi library files.
- Locate the folder for python packages on your system (for me it was at /lib/python3/dist-packages/ but it may differ for you).
- Copy the whole "ximea" folder from step 2. into your python packages folder (you will probably encounter permission issues, please use sudo or similar workaround to solve this).
- Your python scripts should work now.
I found the right folder by using conda info
. This way I could find my conda environments in /home/jan/miniconda3/envs/<ENV NAME>/lib/python3.10/
. By simply copy-pasting the ximea
folder to this folder, everything worked.