Reputation: 121
Answer: https://bradenmacdonald.com/blog/2015/uwsgi-emperor-multiple-python
Original Post:
I started with python2 and uwsgi. Got my Django app running. I installed python3 and now I'm trying to get my app to run using python3.
However it seems uwsgi doesn't want to run using python3 - even if passing it the venv flag for my virtualenv with python3. I have an emperor running a few vassals, if I include the venv flag said vassal doesn't work.
On a test server, I simply removed python2, then aliased /usr/bin/python to python3. Which fixed the issue. But this seems like the wrong solution and would result in more significant downtime on my application.
Whats the best way to get uWSGI to work with python3 without deleting python3? Is it really to create an alias?
Update 1:
Installing pip3 apt install pip3
on the server and installing uwsgi using pip3 install uwsgi
is now getting uwsgi running in python3. However I don't understand this behavior. I'm getting an unrelated error now regarding ImportError: No module named 'encodings'
Update 2: uwsgi is using 3.5 now - while my viortualenv is using python3.6. I created an environment with python3.5 which worked.
How do I make uwsgi build for python3.6? Since the above is a brute force approach.
Upvotes: 2
Views: 1503
Reputation: 11
Add --plugin python3 in the running command and install uwsgi python3 plugin using apt install uwsgi-plugin-python3
Upvotes: 1