How to install python modules without root access with Python?

Sometimes, we want to install python modules without root access with Python.

In this article, we’ll look at how to install python modules without root access with Python.

How to install python modules without root access with Python?

To install python modules without root access with Python, we can set the package to install in a directory that we have write access to.

For instance, we run

pip install --install-option="--prefix=$HOME/local" package_name

to install the package_name package with the --install-option set to "--prefix=$HOME/local" to install the package in the local directory in the home directory.

Conclusion

To install python modules without root access with Python, we can set the package to install in a directory that we have write access to.