0

It seems there are problems in importing cvxpy. I have tried uninstalling and reinstalling but no difference. Before, it works but several times without changing anything it suddenly stopped to work and could not import cvxpy. Then, the problem has been solved without any changes. But, this time the problem remain and I could not solve. Any suggestions or solutions would be greatly appreciated.

Error:

ImportError: cannot import name 'SolvingChain' from 'cvxpy.reductions.solvers.solving_chain' (/opt/anaconda3/lib/python3.7/site-packages/cvxpy/reductions/solvers/solving_chain.py)

OS:

macOS High Sierra 10.13.4 (17E199)-Retina

Python 3.7.6 (default, Jan 8 2020, 13:42:34)

Spyder 4.1.1

CVX:

cvxpy 1.0.29 pypi_0 pypi

Output:

Traceback (most recent call last):
File "/Users/niloofar/EV.py", line 12, in
import cvxpy as cp
File "/opt/anaconda3/lib/python3.7/site-packages/cvxpy/init.py", line 22, in
from cvxpy.problems.problem import Problem
File "/opt/anaconda3/lib/python3.7/site-packages/cvxpy/problems/problem.py", line 23, in
from cvxpy.reductions.solvers.solving_chain import construct_solving_chain
File "/opt/anaconda3/lib/python3.7/site-packages/cvxpy/reductions/solvers/solving_chain.py", line 4, in
from cvxpy.reductions import (Chain, ConeMatrixStuffing, EvalParams,
File "/opt/anaconda3/lib/python3.7/site-packages/cvxpy/reductions/init.py", line 32, in
from cvxpy.reductions.solvers.solving_chain import SolvingChain
ImportError: cannot import name 'SolvingChain' from 'cvxpy.reductions.solvers.solving_chain' (/opt/anaconda3/lib/python3.7/site-packages/cvxpy/reductions/solvers/solving_chain.py)
William Miller
  • 9,839
  • 3
  • 25
  • 46
F E
  • 1

1 Answers1

0

Solution: change the cvxpy version from 1.0.29 to 1.0.28

F E
  • 1