Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash

# 编译Python文件为pyc
python -m compileall -b .

# 启动Flask应用
gunicorn -w 4 -b 127.0.0.1:5000 flask_:app &

# 启动master脚本

conda config --set auto_activate_base false

```
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
```

如何编译支持ffmpeg和自编译的python的OpenCV

从源编译Python3

1.更新apt

建议换成国内源

sudo apt update
sudo apt upgrade

安装依赖

dpkg: error processing package nvidia-dkms-525(--configure):
 installed nvidia-dkms-525 package post-installation script subprocess returned error exit status 10

Examining the /var/lib/dkms/nvidia/525.78.01/build/make.log reveals multiple
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’

SOLVE:

sudo apt purge *nvidia* && sudo apt autoremove

HOME:Ctrl + A
END:Ctrl + E

  1. install Anaconda
  2. conda env -name your_env_name python=3.11
  3. conda activate your_env_name
  4. install git bash from official
  5. install visual build tools
https://github.com/bycloudai/InstallVSBuildToolsWindows

6.install torch torchaudio torchvision

Use another iso.
I use a new iso named "Ubuntu_23.10_live_server_arm64.iso"
Install desktop for it

sudo apt update
sudo apt install ubuntu-desktop
sudo dpkg --configure -a