[英]Python cannot find a module while it is installed
I have a code as below:我有如下代码:
#!/bin/env python3
from PyGMO import *
hv = hypervolume([[2,1,1] , [1,2,1], [1,1,2]])
print(hv.compute(r = [3.5]*3, algorithm = hv_algorithm.hv3d()))
Although I have certainly installed the 'pygmo' module, I will face the following error when I run this script.虽然我已经安装了 'pygmo' 模块,但是当我运行这个脚本时我会遇到以下错误。
*Traceback (most recent call last):
File "/root/PycharmProjects/pythonProject/venv/Hype1.py", line 3, in <module>
from PyGMO import *
ModuleNotFoundError: No module named 'PyGMO'*
Note that when "python3 -v", the below list will appear:请注意,当“python3 -v”时,会出现以下列表:
On our linux server I get the same error typing:在我们的 linux 服务器上,我输入相同的错误:
from PyGMO import *
But I get no error when typing:但是我输入时没有错误:
from pygmo import *
Linux is key sensitive, so it makes a difference if you use capital letters. Linux 是键敏感的,所以如果你使用大写字母会有所不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.