From 4059171c1687323d53b3c550579cd9c8fea09763 Mon Sep 17 00:00:00 2001 From: Frank Sauerburger <frank@sauerburger.com> Date: Tue, 8 Aug 2017 10:36:47 +0200 Subject: [PATCH] Use pip --user without sudo Remove superuser privileges from pip and install packages in ~/.local. This also prevents hiding pip's packages by system packages, since user packages have precedence. --- Dockerfile | 4 ++-- README.md | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index d5d67ed..5f9fdb3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,5 +10,5 @@ RUN apt-get update && apt-get install -y \ && rm -rf /var/lib/apt/lists/* # install doxec -RUN git clone https://srv.sauerburger.com/esel/doxec.git && cd doxec && git checkout v0.1.1 && python3 setup.py install - +RUN git clone https://srv.sauerburger.com/esel/doxec.git && cd doxec && git checkout b0ce804f && python3 setup.py install +RUN echo "" | adduser --disabled-password student diff --git a/README.md b/README.md index a0ebe3f..cc194a0 100644 --- a/README.md +++ b/README.md @@ -23,15 +23,8 @@ can run the following command line. ```bash sudo apt-get install python3 python3-pip -sudo pip3 install numpy scipy matplotlib +pip3 install --user numpy scipy matplotlib ``` - -This installs the most recent versions these three packages. If you install the -packages via ubuntus package manager, you will get older version. Ubuntu's -packages can hide the more up-to-date ones installed by pip3. My personal -recommandations is to always use pip and never install python packages via -ubuntus package manager if you want to use recent version of the packages. - <!-- Doxec in a docker container needs a slightly different command, please keep them in-sync. @@ -40,7 +33,8 @@ in-sync. ```bash $ apt-get update $ apt-get -y install python3 python3-pip -$ pip3 install numpy scipy matplotlib +$ su student +$ pip3 install --user numpy scipy matplotlib ``` --> -- GitLab