Aliyun CentOS7 Apache deployment django project uses python2.7 by default

A novice is on the road. Not long after using Aliyun, he wants to deploy the django project he has done before to apache for a demonstration.

python2.7, is installed by default in Aliyun. I downloaded python3.5 and compiled and installed it according to the method on the Internet. After deploying the django project to apache, I ran the error 500 at the beginning, saying that the django framework was not installed under root users.

I switched to the root user and reinstalled the django framework. After running it, I began to report an error, saying that it was a coding problem, and then I found that I was using python2.7,. How can I make apache use python3.5?

because some modules of my project cannot be run under python2.7, I found that there is no solution for this on the Internet.

this is an error message

Mar.18,2021

in the first line of your .py file, add -sharphammer code code 3.5 (or < sharp >-sharphammer pyron3 , or the location of your python3 binaries)

, or the location of your sharpblade binaries)

, or the location of your sharpblade binaries)

, or the location of your sharpblade binaries)

the following solutions are not recommended:

cd /usr/bin
mv python python2.7_bak
ln -s python3.5 python
Menu