You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
cuquantum-24.08) python3
Python 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:36:13) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
import vha
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'vha'
I also get the same error when trying to run a python script that import vha.
The text was updated successfully, but these errors were encountered:
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
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.
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.
The text was updated successfully, but these errors were encountered: