I am new to working with system administration tasks but I am trying to eventually (if I ever figure this out) install software onto a dedicated server. This particular software requires a virtualenv which in any case requires python at least 2.7 or greater. Guess what? Godaddy gave me python 2.6.6 and an operating system that will drop support in 2020, CentOS 6.10... So! besides all that I am trying to install python 3.6.2 following this walkthrough: https://help.dreamhost.com/hc/en-us/articles/115000702772-Installing-a-custom-version-of-Python-3
(I know it's for dreamhost, closest I could find with decent instructions)
Well I thought i'd get smart and create a virtual machine with Centos 6 on it. So I did, followed all the instructions on that website and many others, to finally install the service I need and ran it. Wonderful! So I figured I was confident enough to do it on my server without ruining it. (I made a backup anyway just in case)
Anyway on my VM I had issues with sqlite3 so I had to recompile python and do all this crazy nonsense, which I don't think that i needed to do on the server because it came with sqlite 2.4.7 I think, but I installed the sqlite3 anyway just to make sure, which I assumed the one I downloaded was a higher version than the one installed by default. Then I downloaded python 3.6.2, unpacked it and ran:
[server]$ ./configure --prefix=$HOME/opt/python-3.6.2 --enable-loadable-sqlite-extensions
[server]$ make
[server]$ make install
from the tutorial, with a little extra spice. I assumed this would do great and get me what I needed for the other things without running into too much error.
Well the next step was to edit the path variables. So I opened the .bash_profile with vi and the content was as such:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
~
~
~
~
...
And so I put a few new lines under the export PATH
line and then added:
export PATH=$HOME/opt/python-3.6.2/bin:$PATH
Assuming this would work I hit esc
and then :wq
to exit.
Then ran which python3
. Got this error:
/usr/bin/which: no python3 in (/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X12R5/bin:/usr/local/bin:/usr/X12R5/bin:/root/bin:/opt/bin:/opt/cpanel/composer/bin:/root/bin)
Realized I skipped a step:
[server]$ . ~/.bash_profile
And tried which python3
again. Same error as before.
I could have attempted to troubleshoot and stuff but as I said before I don't really want to ruin anything and NEED to restore the backup... That would be rather irritating and unfortunate. Can anyone help me or guide me through this process? or maybe explain the error to me and how to fix it? once python 3 is installed I think I can handle it. After that i am installing twisted, creating venv, and going from there so...