Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling Python 3.4 is not copying pip

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?

like image 634
Rui Lima Avatar asked Mar 23 '14 15:03

Rui Lima


People also ask

Does Python 3.4 have pip?

PIP is automatically installed with Python 2.7. 9+ and Python 3.4+ and it comes with the virtualenv and pyvenv virtual environments.

Why does Python not install pip?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.

How do I enable pip in Python?

Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process.


2 Answers

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.

like image 173
Rui Lima Avatar answered Sep 30 '22 18:09

Rui Lima


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

yum install openssl-devel -y
like image 44
Bekzot Asimov Avatar answered Sep 30 '22 17:09

Bekzot Asimov