My system(ubuntu) has python 2.6.5 version (globally installed in /usr/bin/).
I want to use python 2.7.3 .
For this, I tried creating a virtualenv using this answer Is it possible to install another version of Python to Virtualenv? (didnt do any simlinking from answers) . I succeeded in this and when I activated env and used 'python manage.py shell' it worked great .
Problem is : We use uwsgi for running server . Till now, we are directly using the system wide python(2.6.5) . As I have installed everything newly in a virtualenv, I added the option
'-H /path/to/virtualenv'
while running the uwsgi server.
I got the error "no module named 'os' " while executing line "import os" . (Found error from error logs)
So, I added import sys; print sys.path commands before the command 'import os' . Then, when it printed the path, it had something like :
/home/name/venv/bin/python/lib/python2.6/ #(one of the items in the array sys.path)
But, when I looked at my venv folder, there is nothing like python2.6 in the 'lib' folder. ,My lib folder of venv contains only 'python2.7' .
My requirement is, uwsgi should use python 2.7(of venv) , not 2.6 (global).
Also, in my sh file, I used command 'which python' which showed me that it is using global version. So, I have to tell the shell file first to use python from the virtualenv, not the default global one. I tried 'source /path/to/activate' but said command not found.
pip install uwsgi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With