My system (ubuntu) has a version of python 2.6.5 (globally installed in / usr / bin /).
I want to use python 2.7.3.
To do this, I tried to create virtualenv using this answer. Is it possible to install another version of Python in Virtualenv? (did not make any sympathetic answers). I succeeded, and when I activated env and used the "python manage.py shell", it worked fine.
The problem is this: We use uwsgi to start the server. So far, we have directly used system python (2.6.5). When I installed everything new in virtualenv, I added a parameter
'-H /path/to/virtualenv'
when starting the uwsgi server.
I got an error "there is no module named" os "during the execution of the line" import os ". (An error was found from the error logs)
So, I added import sys; print sys.path before the "import os" command. Then, when he typed the path, he had something like:
/home/name/venv/bin/python/lib/python2.6/
But, when I looked at my folder in venv, there is nothing like python2.6 in the "lib" folder. , My lib folder from venv contains only "python2.7".
My requirement: uwsgi should use python 2.7 (from venv) and not 2.6 (global).
Also, in my sh file, I used the "what python" command, which showed me that it was using the global version. So, I must first tell the shell file to use python from virtualenv, and not the default global one. I tried 'source / path / to / activate' but the specified command was not found.
source share