0

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...

Pixelknight1398
  • 537
  • 2
  • 10
  • 33
  • Unrelated, but why 3.6.2 rather than the latest version 3.7.0? – Aaron Sep 27 '18 at 18:34
  • Good question! No particular reason. I suppose I should install 3.7.0 instead if I find a solution here. I was just following the walkthrough I mentioned. And either version is still better than 2.6... – Pixelknight1398 Sep 27 '18 at 18:39
  • perhaps check calling `python3` from `/opt/python-3.6.2/bin` to make sure the build went okay? – Aaron Sep 27 '18 at 18:55
  • Huh... Strange. I went into `/opt/python-3.6.2/bin` and ran `python3`, though it said command not found. Here is the results of `dir`: `2to3 easy_install-3.6 idle3.6 pip3.6 pydoc3.6 python3.6 python3.6m python3-config pyvenv-3.6 2to3-3.6 idle3 pip3 pydoc3 python3 python3.6-config python3.6m-config pyvenv` You can see that python3 is in there – Pixelknight1398 Sep 27 '18 at 18:59
  • log out then in again? maybe bash needs a refresh.. – Aaron Sep 27 '18 at 19:00
  • Still nothin :/ – Pixelknight1398 Sep 27 '18 at 19:08
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/180903/discussion-between-aaron-and-pixelknight1398). – Aaron Sep 27 '18 at 19:11

0 Answers0