Rebuild uwsgi with pcre support - pcre

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.

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

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.

pip uninstall uwsgi
sudo apt-get install libpcre3 libpcre3-dev
pip install uwsgi
I solved it with the above commands.

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

Did you try:
pip install uwsgi -I
The -I flag will force it to reinstall

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

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

Related

legacy-install-failure error for sentence piece in jac

We recently had to reset our virtual environment, and thus had to reinstall jaseci_ai_kit via pip install jaseci_ai_kit. This commands runs fine for everyone in our group with a windows computer, but those of us with a mac receive a "legacy-install-failure" error for a package called sentencepiece. We were having trouble debugging this error ourselves (and sadly can't use any intent transitions until we do)
For linux you solve it by using this command
sudo apt update
sudo apt -y upgrade
sudo apt -y install --no-install-recommends git g++ build-essential pkg-config cmake

Cannot load VSCode

I cannot load VSCOde onto my old Toshiba laptop using Fedoa23. I follow the instructions from the web and finally get the message "No package code availale". I have previously installes VSCode on an old computer using Fedora23 but this time it does not work? Where do I go wrong?
Thanks.
Don't know, but this works for me.
You can use these step to install VSCode:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
Then update the package cache and install the package using dnf (Fedora 22 and above):
dnf check-update
sudo dnf install code
Or on older versions using yum:
yum check-update
sudo yum install code

error while loading shared libraries: libfontconfig.so.1 on cent os

I am newbie for Cent os. Installing phantomjs on Cent os. Followed below steps but still facing issue.
Steps :
curl -O https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-i686.tar.bz2.
tar xvf phantomjs-1.9.1-linux-i686.tar.bz2
cp phantomjs-1.9.1-linux-i686/bin/phantomjs /usr/local/bin
sudo yum install freetype
sudo yum install fontconfig
Above all steps completed successfully but when I try to hit phantomjs, it shows error "phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory."
Thanks in advance.
Just make sure you successfully run
yum install fontconfig freetype freetype-devel fontconfig-devel libstdc++
and then try to install as usual.
To remove this error.
# sudo yum install fontconfig
If you are still facing the error, Run
# sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6
Note :
If you are using ubuntu or debian, use apt-get install to install this package.
centos, NodeJS, html-pdf
sudo yum install fontconfig (worked for me)

Linux: How to install DBD::Pg module?

Postgres DB is already installed. I'm not using system perl I have installed another perl in "/srv/data203806/Migration/CPAN/localperl/bin". When I'm trying to install, It is asking for PATH TO pg_config:
[root1#frmrszvwb023 bin]# ./cpan install DBD::Pg
Reading '/root/.cpan/Metadata'
Database was generated on Fri, 07 Mar 2014 03:53:02 GMT
Running install for module 'DBD::Pg'
Running make for T/TU/TURNSTEP/DBD-Pg-3.0.0.tar.gz
Checksum for /root/.cpan/sources/authors/id/T/TU/TURNSTEP/DBD-Pg-3.0.0.tar.gz ok
CPAN.pm: Building T/TU/TURNSTEP/DBD-Pg-3.0.0.tar.gz
Configuring DBD::Pg 3.0.0
Path to pg_config?
No POSTGRES_HOME defined, cannot find automatically
Warning: No success on command[/srv/data203806/MUXmh-Migration/CPAN/localperl/bin/perl Makefile.PL]
'YAML' not installed, will not store persistent state
TURNSTEP/DBD-Pg-3.0.0.tar.gz
/srv/data203806/MUXmh-Migration/CPAN/localperl/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites
Please help me to install DBD::Pg? How to get path to pg_config?
Just ran into this issue, and on Ubuntu 16.04 Xenial the package you're looking for is:
apt-get install libdbd-pg-perl
You have to install libpq-dev, e.g. on Ubuntu:
sudo apt-get install libpq-dev
On CentOS/RH you can fix it by installing perl-DBD-Pg package with yum
sudo yum install perl-DBD-Pg
From the README:
INSTALLATION:
Before installing, please use the "cpansign -v" program to
cryptographically verify that your copy of DBD::Pg is complete and
valid. The program "cpansign" is part of Module::Signature, available
from CPAN.
By default Makefile.PL uses App::Info to find the location of the
PostgreSQL library and include directories. However, if you want to
control it yourself, define the environment variables POSTGRES_INCLUDE
and POSTGRES_LIB, or define just POSTGRES_HOME. Note that if you have
compiled PostgreSQL with SSL support, you must define the POSTGRES_LIB
environment variable and add "-lssl" and "-lcrypto" to it, like this:
export POSTGRES_LIB="/usr/local/pgsql/lib -lssl -lcrypto"
The usual steps to install DBD::Pg:
perl Makefile.PL
make
make test
make install
Do steps 1 to 2 as a normal user, not as root!
If the script cannot find the pg_config information itself, it will
ask you for the path to it. Enter the complete path to the pg_config
file here, including the name of the file itself.
If you want to use a module, read the documentation.
Before installing perl module, you must install client for accessing Postgres DB. I just install server and header files:
sudo apt-get install postgresql
sudo apt-get install libpq-dev
You can try:
locate pg_config
This will show something like:
/usr/pgsql-10/bin/pg_config
/usr/pgsql-10/include/ecpg_config.h
/usr/pgsql-10/include/ecpg_config_x86_64.h
Then run:
POSTGRES_HOME=/usr/pgsql-10 ./cpan install DBD::Pg
UPD
If you still encounter issues with pg_config, you may need to add it to your PATH, e.g.:
export PATH=$PATH:/usr/pgsql-x.x/bin
where x.x is your version, such as /usr/pgsql-9.2./bin.
Fedora 29, plenv, perl v5.18.0
Once I got plenv working, I was able to install DBD::Pg with cpanm using these commands:
sudo dnf install postgresql postgresql-devel
cpanm --quiet --notest DBD::Pg
For ArchLinux (or any Distro using Pacman):
pacman -S perl-dbd-pg
For my Ubuntu 22 worked this:
sudo apt install build-essential
sudo apt install cpanminus
sudo apt-get install -y postgresql-server-dev-all
sudo cpanm DBD::Pg

In Centos 6.4,when configure Emacs

In Centos 6.4,when configure Emacs,it shows:
configure: error: The required function `tputs' was not found in any library.
The following libraries were tried (in order):
libtinfo, libncurses, libterminfo, libtermcap, libcurses
Please try installing whichever of these libraries is most appropriate
for your system, together with its header files.
For example, a libncurses-dev(el) or similar package.
How to fix it,what's the problem in it.
sudo yum install ncurses-devel
then ./configure again
Try to install libncurses-dev with
bash
apt-get install libncurses-dev
I'm on a Debian Wheezy derived distribution (CrunchBang)
Trying to install Emacs 24.5.1
Had to install libncurses5-dev, then run ./configure
$ sudo apt-get install ncurses-devel
...
E: Unable to locate package ncurses-devel
$ sudo apt-get install libncurses5-dev