sudo make altinstall
и тут ошибка.running install_scripts
copying build/scripts-3.7/idle3.7 -> /usr/local/bin
copying build/scripts-3.7/pydoc3.7 -> /usr/local/bin
copying build/scripts-3.7/pyvenv-3.7 -> /usr/local/bin
copying build/scripts-3.7/2to3-3.7 -> /usr/local/bin
changing mode of /usr/local/bin/idle3.7 to 755
changing mode of /usr/local/bin/pydoc3.7 to 755
changing mode of /usr/local/bin/pyvenv-3.7 to 755
changing mode of /usr/local/bin/2to3-3.7 to 755
rm /usr/local/lib/python3.7/lib-dynload/_sysconfigdata_m_linux_x86_64-linux-gnu.py
rm -r /usr/local/lib/python3.7/lib-dynload/__pycache__
/usr/bin/install -c -m 644 ./Misc/python.man \
/usr/local/share/man/man1/python3.7.1
if test "xupgrade" != "xno" ; then \
case upgrade in \
upgrade) ensurepip="--altinstall --upgrade" ;; \
install|*) ensurepip="--altinstall" ;; \
esac; \
./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Traceback (most recent call last):
File "/home/timosha/cpython-3.7/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/timosha/cpython-3.7/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/timosha/cpython-3.7/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/home/timosha/cpython-3.7/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/home/timosha/cpython-3.7/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/home/timosha/cpython-3.7/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip._internal
File "/tmp/tmpv8cl2p7b/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 42, in <module>
File "/tmp/tmpv8cl2p7b/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/cmdoptions.py", line 16, in <module>
File "/tmp/tmpv8cl2p7b/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 25, in <module>
File "/tmp/tmpv8cl2p7b/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/download.py", line 39, in <module>
File "/tmp/tmpv8cl2p7b/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>
File "/home/timosha/cpython-3.7/Lib/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Makefile:1132: ошибка выполнения рецепта для цели «altinstall»
make: *** [altinstall] Ошибка 1
P.S.: Все команды выполнялись от имени root'а (sudo) _-| Ubuntu 16.04.4 LTS |-_ python3.7 -v
python3 -v
which python3.7; which python3
apt-get install -y \
build-essential git libexpat1-dev libssl-dev zlib1g-dev \
libncurses5-dev libbz2-dev liblzma-dev \
libsqlite3-dev libffi-dev\
libffi-dev tcl-dev linux-headers-generic libgdbm-dev \
libreadline-dev tk-dev \
libdb-dev \
libmpdec-dev \
libncursesw5-dev
cd /tmp
git clone https://github.com/python/cpython.git
cd cpython
git checkout 3.7
--prefix=$HOME/.local/bin
а --prefix=$HOME/.local
Инсталлер создаст такие диры ${prefix}/{bin,include,lib,share}
tree .local
до и после make install
, тогда не возникнет вопросов, что поставил питон./configure --help
--with-lto
может сильно ускорить процесс ./configure --prefix=$HOME/.local --enable-optimizations
make -j4
make install
├── bin
│ ├── 2to3 -> 2to3-3.7
│ ├── 2to3-3.7
│ ├── easy_install-3.7
│ ├── idle3 -> idle3.7
│ ├── idle3.7
│ ├── pip3
│ ├── pip3.7
│ ├── pydoc3 -> pydoc3.7
│ ├── pydoc3.7
│ ├── python3 -> python3.7
│ ├── python3.7
│ ├── python3.7-config -> python3.7m-config
│ ├── python3.7m
│ ├── python3.7m-config
│ ├── python3-config -> python3.7-config
│ ├── pyvenv -> pyvenv-3.7
│ └── pyvenv-3.7
├── include
│ └── python3.7m
├── lib
│ ├── libpython3.7m.a
│ ├── pkgconfig
│ └── python3.7
│ └── man
which python3.7
не дает результата - проверьте наличие в PATH ~./local/bin$ grep "$HOME/.local/bin:" <<< "$PATH"
/home/sim3x/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:
timosha@timosha-UbuntuPC:~$ cd cpython-3.7
sudo ./configure --prefix=$HOME/.local --enable-optimizations
sudo make
.python3.7 -V
. Если говорит, что не найден пакет, то переходим в окно терминала, где собирался Python и пишем -> sudo make install
(в папке cpython-3.7).python3.7 -V
.Python 3.7.0+
.python3.7 -m pip