When running my Flask application on my Ubuntu 16.04.3 x64 web server, I get the following error when trying to import the Flask-OpenID library v1.2.5:
File "/usr/local/lib/python2.7/dist-packages/openid/oidutil.py", line 17, in <module>
from urllib.parse import urlencode
ImportError: No module named parse
I understand that this is happening because this module is getting loaded in using python 2.7.5 (which I have installed on my machine) instead of 3.5.2 (also have it installed).
Checking the version of python verifies that it is installed on the machine:
>> python -V
Python 3.5.2
The virtual environment was initialized with python 3:
python3 -m venv env
The Flask app still seems to be using files from the python 2.7.5.
If this is indeed the issue, is there any way to set a default or to make sure Flask uses the correct version of python? My app runs with no errors in my development environment on my PC.