Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project does not load #1

Open
jwoehr opened this issue Nov 19, 2021 · 8 comments
Open

Project does not load #1

jwoehr opened this issue Nov 19, 2021 · 8 comments

Comments

@jwoehr
Copy link

jwoehr commented Nov 19, 2021

Cell #1:

import numpy as np

import matplotlib.pyplot as plt

from docplex.mp.model import Model

​

from qiskit import BasicAer

from qiskit.algorithms import QAOA, NumPyMinimumEigensolver

from qiskit_optimization.algorithms import CplexOptimizer, MinimumEigenOptimizer

from qiskit_optimization.algorithms.admm_optimizer import ADMMParameters, ADMMOptimizer

from qiskit_optimization import QuadraticProgram

from qiskit_optimization.converters import QuadraticProgramToQubo

from qiskit.algorithms.optimizers import COBYLA

​

%matplotlib inline 

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-b46b0ffba0ae> in <module>
      5 from qiskit import BasicAer
      6 from qiskit.algorithms import QAOA, NumPyMinimumEigensolver
----> 7 from qiskit_optimization.algorithms import CplexOptimizer, MinimumEigenOptimizer
      8 from qiskit_optimization.algorithms.admm_optimizer import ADMMParameters, ADMMOptimizer
      9 from qiskit_optimization import QuadraticProgram

ModuleNotFoundError: No module named 'qiskit_optimization'

@alejomonbar
Copy link
Owner

Hi @jwoehr, you should have the latest version of qiskit. you can try with

  • pip uninstall qiskit
  • pip install qiskit

The current version that I'm using is Qiskit 0.17.4

@alejomonbar
Copy link
Owner

Additionally, I will update the Jupyter notebook with the Qiskit version information. I completely forget about it. @jwoehr

@alejomonbar
Copy link
Owner

At the end of the README file is the version of the different libraries of Qiskit used. @jwoehr

@jwoehr
Copy link
Author

jwoehr commented Nov 19, 2021

$ python
Python 3.8.9 (default, Aug  3 2021, 19:21:54) 
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from qiskit import __qiskit_version__
>>> print(__qiskit_version__)
/Users/jwoehr/work/Qiskit/qrel_env/lib/python3.8/site-packages/qiskit/aqua/__init__.py:86: DeprecationWarning: The package qiskit.aqua is deprecated. It was moved/refactored to qiskit-terra For more information see <https://github.com/Qiskit/qiskit-aqua/blob/main/README.md#migration-guide>
  warn_package('aqua', 'qiskit-terra')
{'qiskit-terra': '0.18.3', 'qiskit-aer': '0.9.1', 'qiskit-ignis': '0.6.0', 'qiskit-ibmq-provider': '0.18.0', 'qiskit-aqua': '0.9.5', 'qiskit': '0.32.0', 'qiskit-nature': None, 'qiskit-finance': None, 'qiskit-optimization': '0.2.3', 'qiskit-machine-learning': '0.2.1'}

@alejomonbar
Copy link
Owner

Oh, I see. I have the "qiskit-optimization" version '0.3.0'. Did you try uninstalling and reinstalling the Qiskit package? @jwoehr

@alejomonbar
Copy link
Owner

Better if you try this one pip install qiskit-optimization

@jwoehr
Copy link
Author

jwoehr commented Nov 19, 2021

I uninstalled qiskit-optimization then did this:

$ pip install qiskit-optimization
...
Successfully installed qiskit-optimization-0.2.3

Are you installing qiskit-optimization by building from main branch of a checkout?

@alejomonbar
Copy link
Owner

Yes, I'm using the latest version because I'm doing some contributions to the Qiskit optimization library. But, you should be able of executing those libraries with qiskit_optimization version 0.2.3. I tried it using the IBM Quantum lab which has version 0.2.3 and it works. A suggestion is to use directly the IBM quantum Lab to execute the notebook or maybe you have to restart your kernel. @jwoehr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants