使用pip安装cvxopt包后,导入该包不起作用:
% sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H15
% python3 --version
Python 3.7.2
% pip3 install cvxopt
Collecting cvxopt
Using cached cvxopt-1.2.6-cp38-cp38-macosx_10_9_x86_64.whl (3.1 MB)
Installing collected packages: cvxopt
Successfully installed cvxopt-1.2.6
% cat testcvxopt.py
import cvxopt
print("hi")
% python3 testcvxopt.py
Traceback (most recent call last):
File "testcvxopt.py", line 1, in <module>
import cvxopt
ModuleNotFoundError: No module named 'cvxopt'
我已经阅读并尝试了有关安装cvxopt的大部分内容,但没有找到任何有效的方法。有什么建议吗?谢谢
默认的
python3
是3.7,但pip3
在Python 3.8下运行。选择要使用的Python并使用该Python要么跑
然后使用
python3.7
运行脚本或者以同样的方式使用
python3.8
相关问题 更多 >
编程相关推荐