Tencent cloud server Ubuntu 20 already has Python 3.8. Download the installation package from Huawei cloud. After installing Python 3.9, an error is reported
solve:
Copy the dependent files from the existing 3.8 to 3.9, and then rename them. The command is as follows
ubuntu@esoaru-net ~/github/aiopathlib
☺ python3.8 -c 'import _sqlite3;print(_sqlite3.__file__)' master ✗
/usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so
ubuntu@esoaru-net ~/github/aiopathlib
☺ which python3.9 master ✗
/usr/local/bin/python3.9
ubuntu@esoaru-net ~/github/aiopathlib
☺ cp /usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so /usr/lib/python3.9/lib-dynload/ master ✗
cp: cannot create regular file '/usr/lib/python3.9/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so': Permission denied
ubuntu@esoaru-net ~/github/aiopathlib
☹ sudo cp /usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so /usr/lib/python3.9/lib-dynload/ master ✗
ubuntu@esoaru-net ~/github/aiopathlib
☺ python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)' master ✗
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named '_sqlite3'
ubuntu@esoaru-net ~/github/aiopathlib
☹ cd /usr/lib/python3.9/lib-dynload master ✗
ubuntu@esoaru-net /usr/lib/python3.9/lib-dynload
☺ sudo mv _sqlite3.cpython-38-x86_64-linux-gnu.so _sqlite3.cpython-39-x86_64-linux-gnu.so
ubuntu@esoaru-net /usr/lib/python3.9/lib-dynload
☺ python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)'
/usr/lib/python3.9/lib-dynload/_sqlite3.cpython-39-x86_64-linux-gnu.so
☹ sudo cp /usr/lib/python3.9/lib-dynload/* /usr/local/lib/python3.9/lib-dynload/
Summary:
It’s actually a line of command
sudo cp /usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so /usr/lib/python3.9/lib-dynload/_sqlite3.cpython-39-x86_64-linux-gnu.so
Read More:
- Python:ImportError: No module named indexes.base
- No module named numpy error in Python code
- Essay (19) Ubuntu 16 + python2.7 update PIP report error no module named typing
- Error handling method of “no module named ‘stringio’” in Python 3
- Solve the problem that the newly installed CodeBlocks cannot be compiled and run
- About the problem of calling tools library by running Python program under Mac OS X, modulenotfoundererror: no module named ‘tools‘
- Tensorflow operation report error modulenotfounderror: no module named ‘tensorflow. Python. Types’ solution
- Importerror: no module named typing error reporting solution (python2 PIP needs to be backed back from 21)
- How to Fix gdb error: Failed to import the site module,No module named ‘_sysconfigdata_m’
- Error occurred when Python installed the pocketsphinx module (package): Command‘ swig.exe “Failed: no such file or directory
- ModuleNotFoundError: No module named ‘apt_pkg‘
- matplotlib error – no module named tkinter
- ImportError: No module named indexes.base
- Unable to call numpy in pychar, module notfounderror: no module named ‘numpy’
- ModuleNotFoundError: No module named ‘notebook‘
- Modulenotfounderror: no module named ‘CV2’ – (version problem)
- ModuleNotFoundError: No module named ‘numpy.testing.nosetester‘
- Importerror: the perfect solution of no module named CV2!!! (not too good)
- Mmdet error modulenotfounderror: no module named ‘mmcv_ ext‘
- Create a new project in pycharm: modulenotfounde rror:No module named ‘distutils.util‘