phpy示例

安装python

加速pip

  • 阿里源(可搭配清华源一起用)
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple 
pip config set install.trusted-host mirrors.aliyun.com
# pip config set global.extra-index-url "https://pypi.tuna.tsinghua.edu.cn/simple"

安装环境

安装驱动

安装php和phpy扩展

wsl2环境变量参考

# cuda
export PATH=$PATH:/usr/local/cuda-12.3/bin
export LD_LIBRARY_PATH=/usr/local/cuda-12.3/lib64
export CUDA_HOME=/usr/local/cuda

# wsl
export LD_LIBRARY_PATH="/usr/lib/wsl/lib:$LD_LIBRARY_PATH"

# tensorrt
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/src/TensorRT-8.6.1.6/lib