Comments (10)
How exactly are you trying to install the package?
I've run into a similar issue when trying to build form source; installing the generated wheel to the system or user pip gave this error, but installing to a virtualenv worked fine.
from qiskit-aer.
I installed using pip; specifically, using "pip install qiskit" (i.e., without the --user flag).
from qiskit-aer.
Hui @sumeetkhatri , just to make sure everything is clean before installing, could you try this?
$ conda create -y -n qiskit python=3.6
$ conda activate qiskit
$ pip install qiskit
... which basically installs qiskit
in a clean virtual env.
from qiskit-aer.
Is there a way to do this without having to install anaconda?
from qiskit-aer.
Sure:
$ virtualenv -p python3.6 envname
$ source envname/bin/activate
$ pip install qiskit
from qiskit-aer.
I get the following error upon executing those three lines:
Collecting qiskit
Using cached https://files.pythonhosted.org/packages/7a/4a/bc00cc835794bb5247146d895586284759fe8e726648cfbb2f977e484bec/qiskit-0.7.2.tar.gz
Collecting qiskit-terra<0.8,>=0.7 (from qiskit)
Using cached https://files.pythonhosted.org/packages/af/61/b54f52ada993927c93adf8fea565951456f4ea691d6b0adca9ef52a04060/qiskit_terra-0.7.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting qiskit-aer<0.2,>=0.1 (from qiskit)
Using cached https://files.pythonhosted.org/packages/19/51/c93d33f5154305d177754507f05d113e13695a93500db38e1224633b9035/qiskit_aer-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting marshmallow-polyfield<4,>=3.2 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/fa/ba/6406b8cce3e42b2838d234310c3605627083bbb8f71dcc312c616480fe92/marshmallow_polyfield-3.2-py2.py3-none-any.whl
Collecting marshmallow<3,>=2.16.3 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/9a/3c/4cc463c53136dc503f9ee234c4a6592e1c7411cb362f844e80df70361f29/marshmallow-2.18.0-py2.py3-none-any.whl
Collecting scipy!=0.19.1,>=0.19 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/7f/5f/c48860704092933bf1c4c1574a8de1ffd16bf4fde8bab190d747598844b2/scipy-1.2.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting jsonschema<2.7,>=2.6 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/77/de/47e35a97b2b05c2fadbec67d44cfcdcd09b8086951b331d82de90d2912da/jsonschema-2.6.0-py2.py3-none-any.whl
Collecting networkx>=2.2 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/f3/f4/7e20ef40b118478191cec0b58c3192f822cace858c19505c7670961b76b2/networkx-2.2.zip
Collecting ply>=3.10 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/a3/58/35da89ee790598a0700ea49b2a66594140f44dec458c07e8e3d4979137fc/ply-3.11-py2.py3-none-any.whl
Collecting sympy>=1.3 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/dd/f6/ed485ff22efdd7b371d0dbbf6d77ad61c3b3b7e0815a83c89cbb38ce35de/sympy-1.3.tar.gz
Collecting numpy>=1.13 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/f5/bf/4981bcbee43934f0adb8f764a1e70ab0ee5a448f6505bd04a87a2fda2a8b/numpy-1.16.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting pillow>=4.2.1 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/85/5e/e91792f198bbc5a0d7d3055ad552bc4062942d27eaf75c3e2783cf64eae5/Pillow-5.4.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting requests>=2.19 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl
Collecting requests-ntlm>=1.1.0 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/03/4b/8b9a1afde8072c4d5710d9fa91433d504325821b038e00237dc8d6d833dc/requests_ntlm-1.1.0-py2.py3-none-any.whl
Collecting psutil>=5 (from qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/6e/a0/833bcbcede5141cc5615e50c7cc5b960ce93d9c9b885fbe3b7d36e48a2d4/psutil-5.5.0.tar.gz
Collecting decorator>=4.3.0 (from networkx>=2.2->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/f1/cd/7c8240007e9716b14679bc217a1baefa4432aa30394f7e2ec40a52b1a708/decorator-4.3.2-py2.py3-none-any.whl
Collecting mpmath>=0.19 (from sympy>=1.3->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/ca/63/3384ebb3b51af9610086b23ea976e6d27d6d97bf140a76a365bd77a3eb32/mpmath-1.1.0.tar.gz
Collecting urllib3<1.25,>=1.21.1 (from requests>=2.19->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests>=2.19->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.19->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.19->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl
Collecting cryptography>=1.3 (from requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/98/71/e632e222f34632e0527dd41799f7847305e701f38f512d81bdf96009bca4/cryptography-2.5-cp34-abi3-manylinux1_x86_64.whl
Collecting ntlm-auth>=1.0.2 (from requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/8e/5b/4047779fb456b0de503c4acb7b166becf2567efb772abb53998440791d3c/ntlm_auth-1.2.0-py2.py3-none-any.whl
Collecting six>=1.4.1 (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting cffi!=1.11.3,>=1.8 (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/6d/c0/47db8f624f3e4e2f3f27be03a93379d1ba16a1450a7b1aacfa0366e2c0dd/cffi-1.11.5-cp36-cp36m-manylinux1_x86_64.whl
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit)
Using cached https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz
Building wheels for collected packages: qiskit, networkx, sympy, psutil, mpmath, pycparser
Building wheel for qiskit (setup.py) ... done
Exception:
Traceback (most recent call last):
File "/home/sumeet/envname/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 179, in main
status = self.run(options, args)
File "/home/sumeet/envname/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 355, in run
session=session, autobuilding=True
File "/home/sumeet/envname/lib/python3.6/site-packages/pip/_internal/wheel.py", line 980, in build
python_tag=python_tag,
File "/home/sumeet/envname/lib/python3.6/site-packages/pip/_internal/wheel.py", line 813, in _build_one
python_tag=python_tag)
File "/home/sumeet/envname/lib/python3.6/site-packages/pip/_internal/wheel.py", line 821, in _build_one_inside_env
wheel_path = builder(req, temp_dir.path, python_tag=python_tag)
File "/home/sumeet/envname/lib/python3.6/site-packages/pip/_internal/wheel.py", line 898, in _build_one_legacy
return os.path.join(tempd, sorted(os.listdir(tempd))[0])
IndexError: list index out of range
from qiskit-aer.
There's something wrong in your environment, try updating pip
in the first place:
pip install --upgrade pip
And then run again:
pip install --no-cache-dir qiskit
from qiskit-aer.
Ok, the import statement now works.
The solution isn't entirely satisfactory. Why do I need to run it in a virtual environment?
from qiskit-aer.
You don't need to, actually. But this is a common good practice in the Python realm, because otherwise there could be other packages that require different versions of your depedencies that could potentially conflict with yours, so there's this recommendation to create "isolated" environments where you install exactly what you need in a controlled way.
Unfortunately, there's nothing much we con do about it.
I just wanted to make sure that from the point of view of the package (qiskit) everything was right, and it is.
from qiskit-aer.
I'm closing this issue, feel free to reopen it whenever you want.
from qiskit-aer.
Related Issues (20)
- Should be possible to pass a backend to the Aer primitives HOT 3
- Missing `cp39-cp39-macosx_11_0_arm64` wheels since `0.14.1` HOT 3
- Performance difference for generating the unitary of a circuit using AerSimulator vs quantum_info.Operator HOT 3
- Control flow is not working after I upgrade to 0.14.1 HOT 1
- qiskit-aer-gpu throws an error when using AerSimulator(method='tensor_network', device='GPU') HOT 1
- Typo in docstring for qiskit_aer
- DeprecationWarning about Provider
- AerSimulator does not support expr.shift_left (Binary.Op.SHIFT_LEFT)
- Remove standalone
- Remove qobj
- Unavailability of Probabilities in result after successfull simulation HOT 4
- Progress bar for qiskit-aer
- Error when building cvxpy dependency in Ubuntu 22.04 HOT 2
- `QuantumCircuit.reverse_bits()` affects the state vector but not the density matrix HOT 2
- Some fake simulators throw NoiseError when running an empty circuit
- qiskit-aer not getting imported HOT 2
- Qiskit-aer-gpu does not work as expected HOT 3
- TypeError: (): incompatible function arguments. AerConfig, arg0: list[list[tuple[tuple[int, int], list[float]]]]) -> None HOT 4
- Qiskit is deprecating `qiskit.providers.models`, which it is used by Aer HOT 2
- MPI execution related information missing from results metadata
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qiskit-aer.