如何添加路径?
!export CUDA_HOME = / usr / local / cuda
!export PATH = $ PATH:$ CUDA_HOME / bin'
!. /root/.bashrc
输出:
/ bin / sh:13:/root/.bashrc:shopt:not found / bin / sh:21:/root/.bashrc:shopt:not found
试试这个
import os
os.environ['PATH'] += ':/usr/local/cuda/bin'