Run multiple Python versions on system

When using CyberPanel on Google Cloud VPS, I have encountered some Python errors:

I believe the reason is that Google Cloud VPS has automatically installed python-urllib3, python-requests … (generally, interfering with the “python” of the system out of our control)
That made CyberPanel unable to login:

ImportError: can not import name UnrewindableBodyError

I think you should create a new python version for your CyberPanel system to use, (in another location) it will not depend on the python available on the Centos 7 system (python 2.7.5 is too old). Install a newer version of Python like 3.6.5 or 2.7.15, which can be referenced here:

Centos 7. ?

Centos 7. ?

Yes, Centos 7.(4-5) - Python 2.7.5

So, is that feasible or problematic? :slight_smile:
When the system’s python crashes, the Cyberpanel can still run if it has a separate python program, you can proactively upgrade this seperate python or configure it to use resources more appropriately.
Sometimes upgrading to a newer version of Cyberpanel, you can get in trouble at step:

cd /usr/local/CyberCP
python makemigrations
python migrate

I believe using a separate Python will fix that

So GCP python version is upgraded to 3.x? I noticed that DO also remove Centos 7.4 with 7.5 and it still uses Python 2.7.

I am getting same issue once I do cantos YUM update ! , I think need to give an instruction for the solution to avoid such situation

pip uninstall requests
pip uninstall urllib3
yum remove python-urllib3
yum remove python-requests

yum install python-urllib3
yum install python-requests

This should solve your issue, I notice that GCP have not updated python version, just some libraries.

still not accessible how to force cyberpanel using ver 3 ?
where to change the paths ?

Django Version: 1.11.13
Exception Type: ImportError
Exception Value:
No module named ‘requests.packages.urllib3’
Exception Location: /usr/lib/python2.7/site-packages/requests/packages/ in load_module, line 95
Python Executable: /usr/bin/python
Python Version: 2.7.5
Python Path:

Submit a ticket, will have a look.