我试图在Debain 8上安装Python 3.6。运行make命令时,发生错误。
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.11 (jessie)
Release: 8.11
Codename: jessie
Run Code Online (Sandbox Code Playgroud)
我运行的命令:
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
tar xvf Python-3.6.3.tgz
cd Python-3.6.3
./configure --enable-optimizations
make -j8 # Error occurs here
sudo make altinstall
python3.6
Run Code Online (Sandbox Code Playgroud)
那是错误
...
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_dbm _gdbm _lzma
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexit pwd time
running build_scripts
copying and adjusting /home/lucas/Python-3.6.3/Tools/scripts/pydoc3 -> build/scripts-3.6
copying and adjusting /home/lucas/Python-3.6.3/Tools/scripts/idle3 -> build/scripts-3.6
copying and adjusting /home/lucas/Python-3.6.3/Tools/scripts/2to3 -> build/scripts-3.6
copying and adjusting /home/lucas/Python-3.6.3/Tools/scripts/pyvenv -> build/scripts-3.6
changing mode of build/scripts-3.6/pydoc3 from 644 to 755
changing mode of build/scripts-3.6/idle3 from 644 to 755
changing mode of build/scripts-3.6/2to3 from 644 to 755
changing mode of build/scripts-3.6/pyvenv from 644 to 755
renaming build/scripts-3.6/pydoc3 to build/scripts-3.6/pydoc3.6
renaming build/scripts-3.6/idle3 to build/scripts-3.6/idle3.6
renaming build/scripts-3.6/2to3 to build/scripts-3.6/2to3-3.6
renaming build/scripts-3.6/pyvenv to build/scripts-3.6/pyvenv-3.6
Segmentation fault
Makefile:586: recipe for target 'sharedmods' failed
make[2]: *** [sharedmods] Error 139
make[2]: Leaving directory '/home/lucas/Python-3.6.3'
Makefile:479: recipe for target 'build_all_generate_profile' failed
make[1]: *** [build_all_generate_profile] Error 2
make[1]: Leaving directory '/home/lucas/Python-3.6.3'
Makefile:460: recipe for target 'profile-opt' failed
make: *** [profile-opt] Error 2
Run Code Online (Sandbox Code Playgroud)
cla*_*de7 -1
sudo apt install python3-gdbm=3.5.1-1 #resolve _gdbm
sudo apt install libgdbm-compat-dev #resolve _dbm
sudo apt install liblzma-dev #resolvde _lzma
Run Code Online (Sandbox Code Playgroud)