在gcp vm上安装matplotlib

2024-06-12 09:23:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在gcp vm上安装matplotlib(第三方库),但失败了。你知道吗

gcp vm python dochumantation说use pip install -t lib/ <library_name>,但实际上,它们真正的意思是:i.g.use pip install matplotlib -t lib/ <library_name>,它不起作用

我试过:

sudo pip install matplotlib -t env/gcplib

结果:

"**Failed building wheel for subprocess32**"

"Command "/usr/bin/python -u -c "import setuptools, 
tokenize;__file__='/tmp/pip-install-Rpkv8i/subprocess32/setup.py
';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __fi
le__, 'exec'))" install --record /tmp/pip-record-x4Y1E4/install-record.txt --single-version-externally-managed --co
mpile" **failed with error code 1** in /tmp/pip-install-Rpkv8i/subprocess32/"

我将非常感谢任何帮助


Tags: installpipnamematplotlibuseliblibrarycode
1条回答
网友
1楼 · 发布于 2024-06-12 09:23:07

在尝试安装matplotlib之前,您需要安装python-dev。你没有提到你的虚拟机是什么操作系统,但如果是Ubuntu,你会用:

sudo apt-get install python-dev

相关问题 更多 >