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
{{ message }}
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.
Operating system: Windows 10 21H2 (19044.1766) and Ubuntu 22.04 LTS
What is the current behavior?
When I install qiskit using this command line:
Windows --> path/to/bin/python.exe -m pip install qiskit -t path/to/custom/folder
Ubuntu --> sudo path/to/bin/python3.10 -m pip install -t path/to/custom/folder
The installation seems to go through all the steps as intended. No error message shows up.
However, the qiskit folder located at path/to/custom/folder/qiskit is almost empty. The folder only contains one file named __init__.pxd.
It is then impossible to use qiskit (no modules found on import).
Steps to reproduce the problem
Create a new conda env: conda create -n "test_qiskit_install" python=3.10
Run: conda activate test_qiskit_install
Run: pip install wheel
Run: pip install qiskit --upgrade --no-cache-dir -t "path/to/custom/folder" (for me it is "C:\Users\felix\miniconda3\envs\test_qiskit_install\Lib\site-packages"
What is the expected behavior?
The expected behavior is to have qiskit installed properly (with all modules in the qiskit folder).
Suggested solutions
The text was updated successfully, but these errors were encountered:
This looks like a rather unusual mixture of different packaging solutions, and extra complication. Qiskit is installed as a namespace package, and I suspect that supplying the -U option in conjunction with -t causes this to fail. The solution is simply to not use either option (or just -U, if you need to upgrade, and not to suppress the warning that arose from qiskit install -t qiskit). Running pip install qiskit should work just fine, even within a conda environment.
Ok, I see. When using an anaconda environment, it is ok. But when I use a local python distribution (like in Blender which comes with its own python distribution), I would need to precise the site-packages folder to prevent installing it in an unintended location.
Do you know another way to precise where to install qiskit using pip if the "-t" can't work?
You generally do not need the -t option to pip, if you make sure you're using the pip from the distribution or virtual environment you're trying to install into. -t also seems to be a more low-level/specific form of --prefix, if you're intending to use a particular Python distribution - you probably want --prefix, if it's necessary to use anything.
pip install -t <dir> was never intended for use with namespace packages, so there's not really anything we can do on the Qiskit side for this. You can see some more discussion here: pypa/pip#10110.
Informations
What is the current behavior?
When I install qiskit using this command line:
Windows -->
path/to/bin/python.exe -m pip install qiskit -t path/to/custom/folder
Ubuntu -->
sudo path/to/bin/python3.10 -m pip install -t path/to/custom/folder
The installation seems to go through all the steps as intended. No error message shows up.
However, the qiskit folder located at
path/to/custom/folder/qiskit
is almost empty. The folder only contains one file named__init__.pxd
.It is then impossible to use qiskit (no modules found on import).
Steps to reproduce the problem
conda create -n "test_qiskit_install" python=3.10
conda activate test_qiskit_install
pip install wheel
pip install qiskit --upgrade --no-cache-dir -t "path/to/custom/folder"
(for me it is"C:\Users\felix\miniconda3\envs\test_qiskit_install\Lib\site-packages"
What is the expected behavior?
The expected behavior is to have qiskit installed properly (with all modules in the qiskit folder).
Suggested solutions
The text was updated successfully, but these errors were encountered: