繁体   English   中英

在Google Cloud Shell中安装了python模块,但是python导入给出了ImportError

[英]Installed python module in google cloud shell but python import is giving ImportError

我尝试在Google Cloud Shell中安装scipy。 该软件包已安装,但是python导入给出了“ ImportError:没有名为scipy的模块”。 截图

我只对scipy有问题。 Tensorflow和numpy都工作正常。

此问题应类似于Google Cloud Shell中消失的已安装软件包

这里的问题是尚未安装scipy 该过程被杀死了99%。 这是由pip尝试安装软件包的方式引起的。 我怀疑您使用的小型VM实例在pip尝试在安装之前将整个文件加载到内存时具有内存限制。

解决方案是使用以下命令安装scipy:

pip --no-cache-dir install scipy

在这里,您要求pip不要缓存文件,这应该可以解决在您的Google Cloud VM上安装scipy的问题。 成功安装后,您应该能够按预期的方式导入scipy模块。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM