Hi ,
I have built a docker image using ubuntu.
It installs python 3.5.2
But when I open the interactive container using /bin/bash and re-check the python version.
I have observed that it is set to default python version
/usr/bin/python =>2.7.12
I would like to know, how can I set it to python 3.5.2 using the Dockerfile.
Can you please give more details, on how you installed python 3.5.2 and it would be great if you can share the Dockerfile so that we will be able to help you better.
RUN mkdir -p /opt
WORKDIR /opt
RUN make
RUN make install
WORKDIR /opt/nipype
RUN pip3 install -U pip
RUN pip3 install networkx
RUN pip3 install traits
RUN pip3 install nose
RUN pip3 install future
RUN pip3 install simplejson
RUN pip3 install prov RUN python3 setup.py install
When I look into the container, I observe the path /usr/bin/python is set to default python 2.7.12
But i want it to be set at the new installed python 3.5.2
Can I do this using the dockerfile?
RUN rm -f /usr/bin/python && ln -s /usr/bin/python /usr/bin/python3
However, depending on your platform this may have adverse side effects. For instance, on Redhat family systems, yum is written in Python 2, so swapping python for Python 3 may cause it to stop working. In your Dockerfile, don’t make this change until you are done using other things such as yum which might depend on Python 2.