Dreamhost installing a custom python version installes python 2.7

I used this tutorial to install a custom python version:
Installing a custom version of Python 3 – DreamHost Knowledge Base

i followed the tutorials, and then I checked the python version, and it returned it was python 2.7.
Looking in links: /tmp/tmpfc7y9rrc Collecting setuptools Collecting pip Installing collected packages: setuptools, pip Successfully installed pip-19.2.3 setuptools-41.2.0 [ps623849]$ cd ~ [ps623849]$ . ~/.bash_profile [ps623849]$ which python3 /usr/bin/python3 [ps623849]$ python3 --version Python 3.5.3 [ps623849]$ pip install django -bash: pip: command not found [ps623849]$ . ~/.bash_profile [ps623849]$ which python3 /home/dh_vfxqwc/opt/python-3.8.1/bin/python3 [ps623849]$ python --version Python 2.7.13 [ps623849]$

this is my bash after all of the installation thing was complete.

can you help me please

The custom Python is installed in your home directory at ~/opt/python-3.8.1 and the PATH changes recommended by the KB article mean that the python3 command maps to the custom version, rather than DH’s default python3 in /usr/bin. The custom install doesn’t have a python command, so it still maps to DH’s copy of the Python 2 (also in /usr/bin).

You could use python3 to access your custom install, or you could setup a symbolic link in ~/opt/python-3.8.1/bin to point python to python3. DH’s python command is itself a symbolic link to Python 2.7:

$ ls -l /usr/bin/python*
 lrwxrwxrwx 1 root root       9 Apr 16  2018 /usr/bin/python -> python2.7
 -rwxr-xr-x 1 root root 3628976 Sep 30 09:38 /usr/bin/python2.7

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.