常用安装方法

无root安装ffmpeg

1
conda install ffmpeg -c conda-forge

无root安装mesh库

  1. 创建虚拟环境版本:3.8
  2. 激活,安装boost库
1
conda install -c conda-forge boost
  1. 下载mesh库源代码

  2. 修改Makefile文件中的--install-option--config-setting

  3. BOOST_INCLUDE_DIRS=/data1/users/xxx/anaconda3/envs/codetalker/include/boost/ make all编译安装

  4. 测试时如果出现

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
----- [ mesh_package ] Performing import tests
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/data1/users/fengxiang/anaconda3/envs/codetalker/lib/python3.8/site-packages/psbody/mesh/__init__.py", line 10, in <module>
from .meshviewer import MeshViewer, MeshViewers
File "/data1/users/fengxiang/anaconda3/envs/codetalker/lib/python3.8/site-packages/psbody/mesh/meshviewer.py", line 49, in <module>
from OpenGL import GL, GLU, GLUT
File "/data1/users/fengxiang/anaconda3/envs/codetalker/lib/python3.8/site-packages/OpenGL/GL/__init__.py", line 4, in <module>
from OpenGL.GL.VERSION.GL_1_1 import *
File "/data1/users/fengxiang/anaconda3/envs/codetalker/lib/python3.8/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 14, in <module>
from OpenGL.raw.GL.VERSION.GL_1_1 import *
File "/data1/users/fengxiang/anaconda3/envs/codetalker/lib/python3.8/site-packages/OpenGL/raw/GL/VERSION/GL_1_1.py", line 7, in <module>
from OpenGL.raw.GL import _errors
File "/data1/users/fengxiang/anaconda3/envs/codetalker/lib/python3.8/site-packages/OpenGL/raw/GL/_errors.py", line 4, in <module>
_error_checker = _ErrorChecker( _p, _p.GL.glGetError )
AttributeError: 'NoneType' object has no attribute 'glGetError'
make: *** [Makefile:11: import_tests] Error 1

执行conda install -c anaconda pyopengl降级该包的版本

复杂虚拟环境

最外层一个conda虚拟环境,内层套多个venv虚拟环境
https://blog.csdn.net/BetrayFree/article/details/132723113

python3 pickle无需安装

pip 安装 torch 无合适版本

使用官网安装命令

1
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html

Vscode自定义调试(通过bash启动python等情况)

  1. pip install debugpy安装debugpy库
  2. launch.json中添加以下设置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"version": "0.2.0",
"configurations": [

{
"name": "Python: Attach",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": xxxx #此处为空闲端口号
}
}
]
}
  1. 脚本里启动python程序时,添加如下设置-m debugpy --listen localhost:xxxx --wait-for-client(注意与原有参数顺序是否冲突,eg -u -m等等)
1
2
3
python -m debugpy --listen localhost:xxxx --wait-for-client \
main.py \ # 要运行的文件
--其余参数 \

bash 里设置启动conda环境

1
2
PYTHON=/users/fengxiang/anaconda3/envs/xxxx/bin/python3
$PYTHON test.py ---参数

无root安装mesa(pyrender后端)

https://pyrender.readthedocs.io/en/latest/install/index.html#installmesa

https://blog.csdn.net/Python_0011/article/details/132514019#:~:text=本文介绍了如何在Py

安装完后如果报错:

1
cannot import name ‘OSMesaCreateContextAttribs’ from ‘OpenGL.osmesa’

更新pyopengl的版本:

1
pip install --upgrade pyopengl==3.1.4

无root如何安装apt get安装的软件

https://blog.csdn.net/YanqiangWang/article/details/113685209#:~:text=1、apt-get简

1 下载

1
apt-get download your-package-name

2 安装

1
dpkg -x your-package.deb your-dir

3.一般会在指定目录下产生usr/bin/目录 添加路径到.bashrc文件

1
2
3
vim ~/.bashrc # 输入i进入编辑模式
export PATH=$PATH:/your_dir/usr/bin/ # 在.bashrc文件最后面,添加该路径,按esc 输入:wq 保存并退出
source ~/.bashrc # 路径生效

常用安装方法
https://fengxiang777.github.io/2024/08/02/常用安装方法/
作者
FengXiang777
发布于
2024年8月2日
许可协议