Install python packages for local user without sudo
Introduction
Sometimes we don't have the superuser competence on a server machine, but we need to install some packages in Python. How can we achieve this?
Download Python
Find the desired Python version in Python ftp site and download it to a local file.
Change the access permission of the execution file in Python to executable.
Install Python
Configure the installation directory.
Change bash run command file
Add the path of Python to the shell script that Bash runs whenever it is started interactively.
Concate the path of local Python in front of the path variable.
Reload the shell script.
Install pip locally
Get the get-pip.py file from the web. And install pip for local user.
Add the path of Python to the shell script that Bash runs whenever it is started interactively.
Concate the path of local Python in front of the path variable.
Reload the shell script.
Install packages without sudo
Now, the pip command can be used without sudo and the Python packages can be installed locally.
Conclusion
After installation of local Python packages, now we can install any packages freely without influencing other users on the same machine.