I am trying to use Gunicorn to provide a WSGI server for a simple python3 application on mac os X but it's using python2. I tried installing gunicorn with:
pip install gunicorn
and
pip3 install gunicorn
which worked but I got a "command not found" error when I tried to run gunicorn (for example with gunicorn -w 4 echo:app
). I also tried installing gunicorn3 with pip and pip3 and brew but got an error with each. I was able to get gunicorn to install and run using:
easy_install gunicorn
however, it seems to be running python2. I tried
easy_install gunicorn3
but got an error. How can I use gunicorn with python3 on Mac OS X?
Edit: I was completely wrong in thinking the errors I was seeing were due to the use of python2. It's actually running 3.9 which is producing problems since so many packages are missing. I had earlier reverted to python 3.8. Is there a way to get gunicorn to use python3.8 as well? There error I'm seeing is:
Traceback (most recent call last):
File "/usr/local/bin/gunicorn", line 33, in <module>
sys.exit(load_entry_point('gunicorn==20.0.4', 'console_scripts', 'gunicorn')())
File "/usr/local/bin/gunicorn", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
File "/usr/local/Cellar/[email protected]/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/metadata.py", line 524, in distribution
return Distribution.from_name(distribution_name)
File "/usr/local/Cellar/[email protected]/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/metadata.py", line 187, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: gunicorn
question from:
https://stackoverflow.com/questions/65924061/how-can-i-use-gunicorn-with-python3-8-instead-of-python3-9-on-mac-os-x 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…