When will Cpanel migrate to Python3 and how to install safely Py3

d3stroyah

Member
Oct 30, 2020
5
0
1
italy
cPanel Access Level
Root Administrator
Hello,
long time whm+cpanel user.
I googled so much, I'd like a very straightforward answer about the title. WHM and Cpanel are based on python 2.7 which is already out of support.
I need python 3 for my applications, I totally can't afford to mess up my whm and server, my life depends on it.

So my questions are simple:
  1. can i simply install python 3 with "yum install python3"? (found in a thread in this forum with a moderator validating it) I tried this in my second VPS with whm+cpanel and i could not find obvious issues, I can call python 2 as "python" and python 3 as "python3" same for pip and pip3. If this is not the right way, is there a very explicit "cpanel suggested way"? I believe there should be a HUGE FAQ with this explained in clear detail.
  2. Will this way potentially mess up something in the future?
  3. What will happen when whm will try to upgrade to python3 finding another one already installed? Will this ever happen? Why nobody talks about this? It's definitely not possible imagining whm using 2.7 in 2022!
  4. Are python installations totally independent this way? So i can totally remove python3 without compromising anything server side?
I'm sure many of you can have a definitive answer, googling I came up with so many OLD threads!
thanks
 
Last edited:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,447
697
313
cPanel Access Level
Root Administrator
Hey there! Lots of good questions here, and I'll see if I can answer them all for you.

The main thing to remember with any of the internal cPanel tools is that there are internal versions of the software running. For example, you can still access WHM and cPanel when PHP and Apache are offline due to internal cPanel versions of PHP that are separate from the public webserver version.

With that in mind, let's go through and answer these:

Question 1 - can i simply install python 3 with "yum install python3"? (found in a thread in this forum with a moderator validating it) I tried this in my second VPS with whm+cpanel and i could not find obvious issues, I can call python 2 as "python" and python 3 as "python3" same for pip and pip3. If this is not the right way, is there a very explicit "cpanel suggested way"? I believe there should be a HUGE FAQ with this explained in clear detail.

Answer: Installing packages through Yum like this will not change the internal Python used for applications like mailman or other tools. Those are all controlled by /usr/local/cpanel/3rdparty/bin/python, while a "yum install python" command will update data in /usr/bin/python. As you've found, "yum install python3" will get you a completely separate version that you can call directly.

Question 2 - Will this way potentially mess up something in the future?
Answer: This is the one I'm not sure I can answer. It's just not possible for us to say how something custom could interfere with something in the future that hasn't been developed yet. However, as mentioned in the answer to Question 1, the internal Python tools are separate from what you'll install with Yum.

Question 3 - What will happen when whm will try to upgrade to python3 finding another one already installed? Will this ever happen? Why nobody talks about this? It's definitely not possible imagining whm using 2.7 in 2022!
Answer: I've reached out to one of our development teams to see if there has been any discussion about getting this updated yet. I'll keep this thread marked as "new thread" so I can come back to it later with a more detailed answer for this one.

Quesiton 4 - Are python installations totally independent this way? So i can totally remove python3 without compromising anything server side?
Answer: That's correct.
 
  • Like
Reactions: cPanelMichael