I don't know if it's possible to do it that way, but you can build any version of python in your home drive that you can then use for development. What you do need is the development tools installed for your distribution i.e. GCC, etc.
Step 1: Download the source code and extract it somewhere.
Step 2: Create a directory in your home directory (in this example ~/opt
)
Step 3: Open a terminal and cd
into the directory where you expanded the source files.
Step 4: Execute the following: ./configure --prefix=/home/your_username/opt/python
Step 5: Execute make
Step 6: Execute make install
Step 7: Check that it works by executing ~/opt/python/bin/python
. You should get the following:
Python 3.4.3 (default, Apr 27 2015, 16:41:03)
[GCC 4.9.2 20150212 (Red Hat 4.9.2-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Do what you like with it, just remember you need to point to it.
You can have as many private versions of python as you like without making changes to the main system's versions - just change the --prefix
.
Added info:
For pip to get built, you need openssl-devel
installed on the system.
To build your environment, run
~/opt/python/bin/python3 -m venv directory_name