• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question How do I get python script running under Apache to use python 3.6?

captainhook

Basic Pleskian
Hi all,

I have the following script for example:
Code:
#!/usr/bin/python3.6
import platform


print('Content-Type: text/plain')
print('')
print('Hello, world!')
print(platform.python_version())

The output there shows '2.7.5'. How can I get scripts running in Plesk to use Python3.6?

edit: ok it looks like it uses the version of python mod_python is built with. There was some work to get python 3 support for mod_python (mod_python 3.5.0 (with support for Python 3!) available for pre-release testing. · Issue #9 · grisha/mod_python), but I'm not sure that's complete or working yet.
I may just need to spin up a separate VM to get this running.
 
Last edited:
Thank you, Ales. I will play around with Phusion Passenger to learn for future.
For this, I'm leaning towards Docker-ising instead given it uses Flask.
 
If it helps, we're using Nginx and Passenger to run Python applications using Django, Web2py and Flask frameworks. Before that, we were using mod_wsgi and Apache.

But we use separate VPS'es with standalone installations, without Plesk. Those apps are too big to be on a shared hosting, so no point in having Plesk there.
 
Back
Top