Rebuild uwsgi with pcre support

PcreUwsgi

Pcre Problem Overview


When running uwsgi I got the following message:

!!! no internal routing support, rebuild with pcre support !!!

I already have installed pcre (I think) with the following command:

sudo apt-get install libpcre3 libpcre3-dev

Why am I still getting this message even after I have installed the pcre package, if I need to reinstall uwsgi and activate pcre, how do I do it?

Also, does internal routing matter?

I assume it does or else the makers of uwsgi wouldn't have made the message come up. I am running Ubuntu 12.04 LTS.

Pcre Solutions


Solution 1 - Pcre

pip install uwsgi -I

Won't recompile the uwsgi binary, it just reinstalls the python egg. You need to rebuild the uwsgi binary with the pcre libraries.

sudo apt-get install libpcre3 libpcre3-dev

I think the easiest way is just to uninstall uwsgi and then run the pip installer again.

pip uninstall uwsgi
sudo apt-get remove uwsgi

then

pip install uwsgi

you should see pip run the setup.py script and a bunch of compiler messages. The last message should show you something like this:

################# uWSGI configuration #################

pcre = True
kernel = Linux
malloc = libc
execinfo = False
ifaddrs = True
ssl = True
zlib = True
locking = pthread_mutex
plugin_dir = .
timer = timerfd
yaml = embedded
json = False
filemonitor = inotify
routing = True
debug = False
capabilities = False
xml = libxml2
event = epoll

############## end of uWSGI configuration #############

notice how pcre = true now

Solution 2 - Pcre

pip install uwsgi -I --no-cache-dir

It reinstalls (-I) as @leech said, but ignores the compiled cache (--no-cache-dir) and recompiles the thing with the new libs.

Solution 3 - Pcre

pip uninstall uwsgi

sudo apt-get install libpcre3 libpcre3-dev

pip install uwsgi

I solved it with the above commands.

Solution 4 - Pcre

Completing @alanjds answer, following is the process to add pcre support to your already installed uWSGI.

sudo apt-get install libpcre3 libpcre3-dev
pip install uwsgi -I --no-cache-dir

You do not need to uninstall uWSGI

Solution 5 - Pcre

Did you try:

pip install uwsgi -I 

The -I flag will force it to reinstall

Solution 6 - Pcre

For those who want to fix this on amazon linux 2 or any red hat family distros

First, Uninstall the uwsgi package

pip uninstall uwsgi

Then, Install pcre and pcre-devel

yum install pcre pcre-devel

Then, Reinstall the uwsgi package

pip install uwsgi

Solution 7 - Pcre

If you have tried all above but it is still have the same error and with the below ones, please check your command parameters, particular the --http-socket /path/to/your.sock. That is the path = '/path/to' must be existed

thunder lock: disabled (you can enable it with --thunder-lock)
bind(): No such file or directory [core/socket.c line 230]

Solution 8 - Pcre

Maybe you can check the uid & gid, I got this ERROR when I set them wrong.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionjohnmic07View Question on Stackoverflow
Solution 1 - Pcreuser1046783View Answer on Stackoverflow
Solution 2 - PcrealanjdsView Answer on Stackoverflow
Solution 3 - PcreZhu XiaohuView Answer on Stackoverflow
Solution 4 - PcrediveinskyView Answer on Stackoverflow
Solution 5 - PcreleechView Answer on Stackoverflow
Solution 6 - PcreashishmohiteView Answer on Stackoverflow
Solution 7 - PcreDat TTView Answer on Stackoverflow
Solution 8 - Pcre莫昌钦View Answer on Stackoverflow