9 Python
9.1 tips
- PEP 8 compliance
py.test --pep8 main.py
- Spyder project must have
.spyproject
folder. I suggest add.spyproject/encoding.ini
to Git since it’s quiet stable.
9.2 cuda error
sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm
if rmmod: ERROR: Module nvidia_uvm is in use
,
lsof 2> /dev/null | grep nvidia.uvm
# then kill the process
9.2.1 setting
python3 -E -c 'import sys; print(sys.path)'
python3 -s -E -c 'import sys; print(sys.path)'
python3 -S -s -E -c 'import sys; print(sys.path)'
#> ['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']
#> ['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']
#> ['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload']