Open TomasBezdek-Research opened 1 week ago
There is a mistake in /home/cuquantum/entrypoint.sh, that prevents the proper Conda environment from being loaded. Please try to fix it as below and try again. It worked for me when I added some extra pip packages to the relevant conda environment. I hope it works for your case.
add below line to the /home/cuquantum/entrypoint.sh
CONDA_ENV_NAME=cuquantum-24.08
Cuquantum appliance: Can´t install and run own python package package in Cuquantum appliance when using apptainer
I am a user of Cuquantum appliance 24.08 with apptainer container on HPC cluster, and I need to install my own local package VHA which has dependency on Qiskit and Qiskit Aer. After installation of this package by pip install --no-deps ./VHA, if I use pip show, the package is successfully found, but after running python script or interactive python console when trying to import VHA, I get module not found error, see below for more details.
Setting up the container
To ensure the container works properly with apptainer, and that correct conda environment is activated on every use, i build a container from following .def file.
And after that, I run
and in the interactive shell, i use
I also tried to install the local package directly to .sif image, but get the same result, i build this image from following .def file.
Trying to use package
After setting the container, in both cases I get a same result. I tried just to import the VHA package with following steps.
Activate container
Use pip show to ensure VHA is installed, and get positive result. This for installing the vha during building container.
This for installing the VHA after build
I also get the same error when trying to run a python script that import vha.