変更するべきことがわからないので、教えていただきたいです。
1.cvxoptのインストール
conda install -c anaconda cvxopt
2.cvxoptのインポート(ここでエラーが出ました)
import numpy as np
import cvxopt
P = cvxopt.matrix(np.array([[2, 1], [1, 2]], dtype=np.float64))
q = cvxopt.matrix(np.array([2, 4], dtype=np.float64))
sol = cvxopt.solvers.qp(P, q)
print(np.array(sol["x"]))
print(np.array(sol["primal objective"]))
発生したエラー
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-8-17f1cd3f2d8e> in <module>
1 import numpy as np
----> 2 import cvxopt
3
4 P = cvxopt.matrix(np.array([[2, 1], [1, 2]], dtype=np.float64))
5 q = cvxopt.matrix(np.array([2, 4], dtype=np.float64))
ModuleNotFoundError: No module named 'cvxopt'
1で表示されたメッセージ(上部10行)
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
-failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
回答1件
あなたの回答
tips
プレビュー