Compiling Python 3.4 is not copying pip

…衆ロ難τιáo~ 提交于 2019-11-29 10:45:15

问题


I have compiled Python 3.4 from the sources on Linux Mint, but for some reason it is not copying pip to its final compiled folder (after the make install).

Any ideas?


回答1:


Just sorted it out. Here it is how to compile python from the sources.

$ ./configure --prefix=/home/user/sources/compiled/python3.4_dev --with-ensurepip=install
$ make
$ make install

If you get "Ignoring ensurepip failure: pip 1.5.4 requires SSL/TLS" error:

$ sudo apt-get install libssl-dev openssl 
$ ls
2to3              idle3    pip3.5    python3           python3.5m         pyvenv
2to3-3.5          idle3.5  pydoc3    python3.5         python3.5m-config  pyvenv-3.5
easy_install-3.5  pip3     pydoc3.5  python3.5-config  python3-config

As you can see pip is copied into target folder, the --with-ensurepip=install is important.




回答2:


If you are in Redhat linux (centos, fedora) install following package.

yum install openssl-devel -y



回答3:


According to PEP 453 -- Explicit bootstraping of pip in Python installation:

Installing from source

Just as the prebuilt binary installers will be updated to run python -m ensurepip by default, a similar change will be made to the make install and make altinstall commands of the source distribution. The directory settings in the sysconfig module should ensure the pip components are automatically installed to the expected locations.

After installing from source code, I found that pip3.4 is put in the destination. (No pip nor pip3)



来源:https://stackoverflow.com/questions/22592686/compiling-python-3-4-is-not-copying-pip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!