金华网站建设电话,网站服务器 免费,深圳尚石设计有限公司,彭水网站建设推广环境#xff1a;虚拟机Ubuntu20.04#xff0c;vscode无法安装pycairo和PyGObject
虚拟机Ubuntu20.04#xff0c;vscode中运行Anaconda搭建的vens 的Python3.8.10 首先在vscode中点击ctrlshiftp#xff0c;选择Python3.8.10的环境#xff0c;自动激活Python
最近在搞无人…环境虚拟机Ubuntu20.04vscode无法安装pycairo和PyGObject
虚拟机Ubuntu20.04vscode中运行Anaconda搭建的vens 的Python3.8.10 首先在vscode中点击ctrlshiftp选择Python3.8.10的环境自动激活Python
最近在搞无人机精准降落网上下载的一段代码总是报错搞了三四天终于把环境搭好了 其中一段代码如下总是报错 原因就是没有wheel然后pycairo和PyGObject安装不上去
import gi
gi.require_version(Gst, 1.0)
from gi.repository import Gst报错先是 ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects 然后接着 ERROR: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly
然后参考
ERROR: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly #45ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects
安装pycairo
新建Ubuntu终端输入
sudo apt-get install sox ffmpeg libcairo2 libcairo2-dev
sudo apt-get install texlive-full完成以后基本可以安装pycairo1.21.0 在vscode的Python终端输入
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pycairo1.21.0如果不行的话先输入
pip3 install manimlib # or pip install manimlib
pip3 install manimce # or pip install manimce然后再次输入
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pycairo1.21.0安装PyGObject
新建Ubuntu终端输入
sudo apt install libgirepository1.0-dev然后在vscode输入
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple PyGObject3.42.2如下图
笔者采用这种办法解决长久折磨我的问题然后import gi 和Gst都不报错了如果还是不成功可以点进我参考的GitHub网址https://github.com/gfduszynski/cm-rgb/issues/45 找寻其他人成功的方法