1

I am trying to install Python 3.9 on Linux 4.4 in Cloudera Data Science Workbench (cdsw).. I do not have sudo rights and I wont be able to connect to any websites.
The current version of python is 3.6
Following the procedure as mentioned here.

However, on step "sudo make altinstall" I get the error "permission denied" on /usr/local/bin

Is there any workaround to make this step work? This is the last step of the whole procedure.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Amy Jack
  • 55
  • 10
  • 1
    Why are you installing from source (2) and not from apt (1)? With deadsnakes ppa added, it's all a breeze and you'll be able to install newer (or older) versions without any additional steps, just using apt. Source is useful only if you want to customise your build (even linuxize says so) – h4z3 Aug 19 '21 at 07:48

1 Answers1

2

You can use the method on top and install using apt... It's the best way to do it,

sudo apt update
sudo apt install software-properties-common

Followed by adding the repository,

sudo add-apt-repository ppa:deadsnakes/ppa

Accept the changes, then

sudo apt install python3.9

Now, whenever you want to use python3.9 you have to invoke python3.9 instead of python3.

If you are using cloudera, cdsw, you cannot get sudo rights, you need to follow this guide to install packages,

https://docs.cloudera.com/documentation/data-science-workbench/1-8-x/topics/cdsw_extensible_engines.html

Follow the guide above, then change the docker file like this


# Dockerfile

FROM docker.repository.cloudera.com/cdsw/engine:8
RUN rm /etc/apt/sources.list.d/*

RUN apt-get update
RUN apt install software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt install python3.9 python3-pip \
   && rm /etc/apt/sources.list.d/*
RUN pip install pandas numpy

Then follow the rest of the guide for steps 2-4, you should be able to get your desired outcome.

Zlemini
  • 4,827
  • 2
  • 21
  • 23
anarchy
  • 3,709
  • 2
  • 16
  • 48