Ubuntu安装python环境的问题
https://www.studyjava.cn/post/1180
https://www.jb51.net/article/179878.htm
异常问题:
root@aaa:/data/data/python/logs# tail -f watch_stdout.log
from torchvision import datasets
File "/usr/local/python3/lib/python3.8/site-packages/torchvision/datasets/__init__.py", line 1, in <module>
from .lsun import LSUN, LSUNClass
File "/usr/local/python3/lib/python3.8/site-packages/torchvision/datasets/lsun.py", line 10, in <module>
from .utils import verify_str_arg, iterable_to_str
File "/usr/local/python3/lib/python3.8/site-packages/torchvision/datasets/utils.py", line 11, in <module>
import lzma
File "/usr/local/python3/lib/python3.8/lzma.py", line 27, in <module>
from _lzma import *
ModuleNotFoundError: No module named '_lzma'
^C
root@ffalcon-OptiPlex-7060:/data/data/python/logs# tail -f watch_stdout.log
from torchvision import datasets
File "/usr/local/python3/lib/python3.8/site-packages/torchvision/datasets/__init__.py", line 1, in <module>
from .lsun import LSUN, LSUNClass
File "/usr/local/python3/lib/python3.8/site-packages/torchvision/datasets/lsun.py", line 10, in <module>
from .utils import verify_str_arg, iterable_to_str
File "/usr/local/python3/lib/python3.8/site-packages/torchvision/datasets/utils.py", line 11, in <module>
import lzma
File "/usr/local/python3/lib/python3.8/lzma.py", line 27, in <module>
from _lzma import *
ModuleNotFoundError: No module named '_lzma'
解决方法:https://www.jianshu.com/p/dd4532457b9f
>>> import sys
>>> 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/p
>>> exit()
缺少 _sqlite3 _lzma 可以去别的linux服务器上找到对应的so库,用上面链接的方法找,so库都在/usr/lib/python3.8/lib-dynload目录下,然后复制过来即可
路径1: /usr/lib/python3.8/lib-dynload
路径2: /usr/local/python3/lib/python3.8/lib-dynload