May-05-2020, 05:23 PM
This is my very first post so I do apologise in advance if I break any rules!! I've just spent 4 hours in an online chat to Namecheap to try to get a script to run online in a virtual environment.
I've got: index.php:
Now I need Python 3, so I'm setting up a virtual environment running Python 3.7.3 using a cPanel App called "Setup Python App". So far so good, and I'm associating it with a sub-folder /pythontest/.
My understanding is that any code in the /pythontest/ folder should be running in the virtual environment and hence Python 3.7.3, but no matter what I do or where I upload the two files they seem to be running in Python 2.6.6.
Has anyone had this kind of experience? I'm sure I'm so close to sorting this out, but the support person in the online chat finally gave up.
I've got to the shell which is running 3.7.3 and managed to pip install a couple of modules so I know I've got a shell running 3.7.3, but I just don't know where to upload my files to in the cPanel file manager file structure so that they run in the virtual environment?
I've got: index.php:
<?php // echo $path = exec('pwd'); // exec python script echo exec('python testpython.py'); ?>and testpython.py
# testpython.py import sys print (sys.version_info)If I run these scripts in my public_html folder, in the root url/domain i.e. https//www.website.com/index.php I get, (2, 6, 6, 'final', 0) showing that I'm running Python 2.6.6.
Now I need Python 3, so I'm setting up a virtual environment running Python 3.7.3 using a cPanel App called "Setup Python App". So far so good, and I'm associating it with a sub-folder /pythontest/.
My understanding is that any code in the /pythontest/ folder should be running in the virtual environment and hence Python 3.7.3, but no matter what I do or where I upload the two files they seem to be running in Python 2.6.6.
Has anyone had this kind of experience? I'm sure I'm so close to sorting this out, but the support person in the online chat finally gave up.
I've got to the shell which is running 3.7.3 and managed to pip install a couple of modules so I know I've got a shell running 3.7.3, but I just don't know where to upload my files to in the cPanel file manager file structure so that they run in the virtual environment?