Because you want to remotely access the company's servers without sudo permissions, you cannot install some Python packages in the default path (for example, a/usr/local/lib/-prefix path).
Generally use Easy_install or pip to install the default in Pathonpath site-packages below, such as/usr/lib64/python2.7/site-packages.
With Pip
pip install --user package_name
With Easy_install
easy_install --prefix=$HOME/local package_name
This will be installed into the $home/local/lib/pythonx.y/site-packages.
Don't forget that this path must be added to the environment variable pythonpath, or it will not be found after the import module.
- PIP Specifies the path:
sudo pip install six --upgrade --target="/usr/lib/python2.7/dist-packages"
When I install TensorFlow, I find Sys.path will find/usr/lib/python2.7/dist-packages first, but PIP is installed by default in/usr/local/... Below, so it is necessary to specify target, otherwise it may not be upgraded even if the library that was found in Python execution is still upgrade.
Small gift to go
McDull Fat Times
Links: https://www.jianshu.com/p/92a109ddf695
Source: Pinterest
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Install Python module or package and pip to install the specified path as a non-root identity