uWSGI command not found
Asked Answered
C

5

7

Background:

I am in the process of deploying a Django site and from my understanding and research, I needed to get a web server, a WSGI protocol interface to actually run said python code and 'communicate' with it, and lastly a reverse proxy server to tie the two together and pass HTTP requests through the pipeline to Django. (By virtue of my install method, mod_wsgi is not an option thanks to EasyApache4 and cPanel so I cannot use the mod_wsgi sockets method)

My problem:

I have organized an apache 2 hosting server and managed to install mod_proxy and mod_proxy_uWSGI using the EasyApache4 auto installer. From what I understand, now I need to set up the proxy system to relay HTTP requests through mod_proxy_uWSGI which doubles up and also runs my Django site, however, I cannot access or configure mod_proxy_uWSGI. When I try using the following style command (sorry, I don't want my server URLs floating around the internet):

 uwsgi --http :8000 --wsgi-file test.py

I get an error message:

bash: uwsgi: command not found

Am I missing something?

Coot answered 3/10, 2018 at 8:36 Comment(2)
You actually need to install uwsgi itself using either pip install or apt-getHands
oh wow. I feel like an idiot...Coot
C
5

Thanks to a comment by [@dirkgroten]. To install UWSGI : pip install uwsgi

Coot answered 8/10, 2018 at 17:3 Comment(0)
C
4

After running pip install uwsgi, it's possible that uwsgi was installed someplace not on your PATH. IE, in my case, it got installed to:

/usr/local/opt/python-3.8.6/bin/uwsgi

I was able to fix this by adding a symlink:

sudo ln -s /usr/local/opt/python-3.8.6/bin/uwsgi /usr/bin/uwsgi

(This may be a terrible idea. It may be a much better idea to use a venv, but I'm following a tutorial that specifically told me to avoid using a venv.)

Conventionalize answered 12/10, 2020 at 0:10 Comment(0)
O
2

Adding to @ArtOfWarfare's answer, you can check where pip is installing your packages using this command.

▶ pip show uwsgi
Name: uWSGI
Version: 2.0.21
Summary: The uWSGI server
Home-page: https://uwsgi-docs.readthedocs.io/en/latest/
Author: Unbit
Author-email: [email protected]
License: GPLv2+
Location: /Users/username/Library/Python/3.9/lib/python/site-packages
Requires:
Required-by:

In my case, it is /Users/username/Library/Python/3.9/lib/python/site-packages. So the uwsgi binary will be present in /Users/username/Library/Python/3.9/bin/. Add this location to PATH and you should be good.

Organometallic answered 7/2, 2023 at 13:0 Comment(0)
S
0

In my case, using Docker, I found the binary to be located in:

/home/webappuser/.local/bin
Sigmoid answered 28/10, 2021 at 7:53 Comment(0)
S
0

do not install from apt-get rather install pip install

also symlink if needed

Selene answered 20/6, 2023 at 6:34 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.