基本上就是标题所说的。这是 cmd 的一个片段:
C:\Users\Marc>conda activate quantum
(quantum) C:\Users\Marc>py
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Ana
conda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
Type "help", "copyright", "credits" or "license" for more information.
>>> from qiskit import QuantumCircuit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'QuantumCircuit' from 'qiskit' (unknown location
)
>>>
尽管我运行了激活环境的命令 (conda activate quantum
),但仍然如此。基本环境确实有效,但我想激活另一个环境。
对于那些好奇的人,Anaconda navigator 和 pip freeze 都表明 qiskit 安装在这个环境中。
答案 0 :(得分:0)
我意识到了我的错误。我应该输入 print(df)
PE Change
0 38.31 -0.06
来启动解释器。