Installing pip locally without root privileges

前端 未结 3 1230
孤街浪徒
孤街浪徒 2020-12-10 22:33

I am working on a compute server which runs a linux. The machine is used by several users so I don\'t have and won\'t get root privileges. I need to install Keras

相关标签:
3条回答
  • 2020-12-10 22:48

    I had the similar case as you and I chose the Anaconda. You can download Anaconda file from this page using wget. You will happily find the file to be a .sh file.

    Use the following command to install Anaconda (for Python3):

    bash ./Anaconda3-5.0.1-Linux-x86_64.sh
    

    Use the following command to install other software (SOFTWARE_NAME) by pip:

    anaconda3/bin/pip install SOFTWARE_NAME
    

    Hope it could help you.

    0 讨论(0)
  • 2020-12-10 23:08

    For installing pip as user without sudo access, check: How to install pip (python) to user without root access.


    Also, you need a virtual environment and for that you may use virtualenv. As the virtual environment doc says:

    A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.

    How it fits you?

    1. You don't need to be root, in order to use it
    2. You may install multiple versions of libraries in different virtual environment without worrying about the version conflicts.
    3. You need not to worry about the libraries you install to mess up with the configuration of the other users using the system
    0 讨论(0)
  • 2020-12-10 23:15

    Here is the up-to-date version to install pip (python) to user without root access method:

    `wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py --user`
    
    0 讨论(0)
提交回复
热议问题