87

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.

Chaminda Bandara
  • 2,067
  • 2
  • 28
  • 31
johnmic07
  • 1,225
  • 2
  • 10
  • 14

7 Answers7

110
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

user1046783
  • 1,137
  • 1
  • 7
  • 5
  • 5
    I followed the procedure and I don't get this output from the compiler. Do you know where can I find that configuration under ubuntu? I can't find it under /etc – stelios Nov 12 '16 at 16:54
  • 3
    I had the same problem but on CentOS. I installed `gcc*` and `pcre-devel` instead of `libpcre3` and `libpcre3-dev` and UWSGI works fine now. – axplusb Dec 06 '16 at 10:14
  • You can also reinstall in one action with pip using `sudo /opt/storwizerest-venv/bin/pip install --force-reinstall -U --no-deps uwsgi`. `--force-reinstall` will make `-U` reinstall the same version (and confusingly, `--force-reinstall` does nothing without `-U`), and `--no-deps` will prevent trying to update all dependencies. – Taywee Nov 20 '17 at 18:26
  • what if one uses an alpine distribution? – EsseTi Feb 27 '18 at 14:10
  • 1
    @EsseTi: The guy is smart enough to figure how to find and install the libs on his distro: `apk install pcre pcre-dev` – alanjds Feb 27 '18 at 17:38
  • @alanjds if i knew that was the name then yes, i haven't figured out where i can find the package names of alpine, and just trying out is not the best effort-solution. – EsseTi Feb 28 '18 at 08:22
  • Alpine packages index: https://pkgs.alpinelinux.org/packages?name=pcre&branch=edge (searched for `pcre` there) – alanjds Feb 28 '18 at 20:26
  • I did not receive any of the output, but the solution did work for me. – Mike Williamson Jul 04 '18 at 22:36
  • This answer worked for me but needed to also add `--no-cache-dir` flag to the `pip install` from @alanjds 's answer – wuliwong Oct 01 '18 at 14:42
86

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.

alanjds
  • 3,972
  • 2
  • 35
  • 43
11
pip uninstall uwsgi

sudo apt-get install libpcre3 libpcre3-dev

pip install uwsgi

I solved it with the above commands.

Zhu Xiaohu
  • 589
  • 6
  • 8
8

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

diveinsky
  • 165
  • 2
  • 8
4

Did you try:

pip install uwsgi -I 

The -I flag will force it to reinstall

leech
  • 8,293
  • 7
  • 62
  • 78
  • ran the command and uwsgi reinstalled fine. But when I run it, i still get the same message about rebuilding with PCRE support. – johnmic07 Feb 11 '14 at 06:31
  • 1
    @johnmic07 libpcre3-dev is enough and it's unlikely you need the routing – jwalker Feb 11 '14 at 14:51
  • If you have a virtualenv setup (and I hope you do), your system might be confused between the local uwsgi, the global uwsgi (when you install with `sudo pip`), and perhaps the system (like `apt-get`) package. I would build it in a virtualenv and then look for `pcre = yes` in the build output and find the program in the virtualenv `bin` directory – leech Feb 11 '14 at 18:35
  • And, as jwalker said, if you don't use internal routing, you really don't need this. – leech Feb 11 '14 at 18:37
  • 1
    I don't use internal routing so I won't worry about it. Hopefully no one else out there needs it either ;) – johnmic07 Feb 15 '14 at 16:41
  • And with this particular setup (i was just going through a tutorial) I was not using virtualenv so I don't think that was the problem. Thanks though! – johnmic07 Feb 15 '14 at 16:42
  • Use ``--no-cache-dir`` and ``-I`` and it will recompile. – alanjds Jul 06 '16 at 16:23
2

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
ashishmohite
  • 1,120
  • 6
  • 14
0

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

莫昌钦
  • 104
  • 1
  • 2