请问一下如何在部署django的时候,指定python的运行版本?阿里云默认的是使用python2.7的版本,但是我开发用的python3,但是我部署在apache上,老是运行2.7(因为是默认的),很多包和库都不兼容 很麻烦.
所以特此来求教一下!
Install python3 firstand then set up the soft link
ln -s /usr/bin/python3 /usr/bin/python
Compile and install Python 3 by yourself, and then use it to install django.
Finally just specify it in the apache configuration file
WSGIScriptAlias / /my/app/path/wsgi.py WSGIPythonPath /my/app:/path/to/the/virtual/env/lib/python3.3/site-packages
PS: Python 3 support requires Django 1.6+ and mod_wsgi 3.4+link: http://stackoverflow.com/questions/5930585/how-to-use-python-3-and-django-with-apache/
python3 yourCmdor you can consider virtualenv
It is recommended to use virtualenv, you can specify the python version when creating
Install python3 first
and then set up the soft link
Compile and install Python 3 by yourself, and then use it to install django.
Finally just specify it in the apache configuration file
PS: Python 3 support requires Django 1.6+ and mod_wsgi 3.4+
link: http://stackoverflow.com/questions/5930585/how-to-use-python-3-and-django-with-apache/
python3 yourCmd
or you can consider virtualenv
It is recommended to use virtualenv, you can specify the python version when creating