I'm using Centos 7 and I have a challenge find a postgresql library called libpq. I have it installed but when I run 'pkg-config libpq --cflags --libs' I get 'No package 'libpq' found'.
when I run 'rpm -qa | grep libpq' I get this here:
libpqxx-devel-5.0.1-2.rhel7.x86_64
libpqxx-5.0.1-2.rhel7.x86_64.
What could be the issue here. Thanks in advance!
I got it working by assigning the path to the libpq library an environment variable like this:
export PKG_CONFIG_PATH=/usr/pgsql-10/lib/pkgconfig
This command will help find the correct path to the library 'locate libpq.pc'.
Related
I am running a toolkit named RNA Framework that requires ViennaRNA to be installed.
I have installed the ViennaRNA 2.4.14 to run a function named rf-fold, However, I constantly receive this error:
[!] Error: ViennaRNA package's Perl module RNA.pm is required.
Please ensure that `ViennaRNA package v2.2.0` (or greater) is installed and try again
When I check the missing RNA.pm module, I can see it is in this path:
/home/user/ViennaRNA/lib/site_perl/5.28.0/
when I check which Perl I am using (type: which Perl) it gives me:
/home/user/perl5/perlbrew/perls/perl-5.28.0/bin/perl
I tried different ways to install the ViennaRNA, including conda install -c bioconda viennarna, compile and make install from ViennaRNA-2.4.14.tar.gz file from the official website. But I cannot get over this error.
I saw a similar issue here and there is a solution (https://www.perlmonks.org/?node_id=1052814), but I don't fully understand the content. Thanks in advance for any help and sorry if it is a basic question!
I think the RNA.pm come with the package, when you download ViennaRNA-2.4.14.tar.gz and install following this link.
So I found my RNA.pm is in the directory:
/share/apps/ViennaRNA-2.1.7/compile-install/lib/site_perl/5.14.2/x86_64-linux-thread-multi/RNA.pm
And I modified the PERL5LIB environment variable by :
export PERL5LIB=/share/apps/ViennaRNA-2.1.7/compile-install/lib/
Problem solved!
I've created a python application which uses Postgresql. I used psycopg2 library (v 2.8.4) when doing the development, but when trying to install it on the beanstalk, it gives the following error:
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
Anyone have idea how to solve this?
Found the answer to the question. Instead of installing the psycopg2 directly, use psycopg2-binary==2.8.4.
Similar question is also being asked here
Hi I am trying to install Swift on Ubuntu (Ubuntu 15.10). I followed the guide of Apple at swift.org. But after executing all the steps when I execute following command
swift --version
It returns error saying
harshit#harshit-Linux:~/swift/usr/bin$ swift --versionThe program 'swift' can be found in the following packages:
* python-swiftclient
* python3-swiftclient
Try: sudo apt-get install <selected package>
I used
export PATH=/home/harshit/swift/usr/bin/swift:"${PATH}"
Here is my directory path
http://pastebin.com/Z1aNiDQM
Kindly help me to complete installation.
You are declaring your path like this:
export PATH=/home/harshit/swift/usr/bin/swift:"${PATH}"
but it's wrong because it includes the swift executable itself in the path.
It should be like this instead:
export PATH=/home/harshit/swift/usr/bin:"${PATH}"
It sounds like you did not add swift to your path. Do you have the direct path to where it is installed? You could try /usr/whereever/bin/swift
I encountered the following error while trying to run a perl script that uses DBI after upgrading to El Capitan (typical!):
install_driver(mysql) failed: Can't load '/Library/Perl/5.18/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Library/Perl/5.18/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle, 1): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Library/Perl/5.18/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
Reason: unsafe use of relative rpath libmysqlclient.18.dylib in /Library/Perl/5.18/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle with restricted binary at /System/Library/Perl/5.18/darwin-thread-multi-2level/DynaLoader.pm line 194.
After seeing a solution posted for a similar problem in python here I have posted the same solution for Perl below.
El Capitan's system integrity protection prevents programs in protected locations (in this case /usr) from calling a shared library that uses a relative reference to another shared library. The following solved it for me. Note, my mysql is installed via brew.
sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/Cellar/mysql/5.6.26/lib/libmysqlclient.18.dylib /Library/Perl/5.18/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
You can also install mysql, or its open source alternative mariadb, with the "brew" tool. This avoids giving the above issue on El Capitan
$ brew install mysql
or
$ brew install mariadb
You can find brew at http://brew.sh/
I'm trying to get postgres server status with:
sudo /etc/init.d/postgres status -u postgres
But getting following error:
/home/alex/olddisk/usr/local/pgsql/bin/pg_ctl: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
I added:
export LD_LIBRARY_PATH=""
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib/"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/alex/olddisk/usr/local/pgsql/lib/"
to my .bashrc, but it didn't help.
Thank you.
I ran into this error when I built postgresql from source using the --prefix flag. Building from source installs the necessary shared libs to the libs folder under the prefix directory you specified, instead of the usual place installations put shared libs. To solve the problem I just added the [prefix].libs folder to the LD_LIBRARY_PATH environment variable. For example, after building postgres using --prefix /mike/sandbox/postgres, the below command solved the issue:
export LD_LIBRARY_PATH=/mike/sandbox/postgres/lib:$LD_LIBRARY_PATH
I think this issue is duplicated, I faced the same problem and posted a solution here.
try this:
1: Know the path of "libpq.so.5"
find / -name libpq.so.5
Output example: "/usr/pgsql-9.4/lib/libpq.so.5" If found nothing, check if you have already installed the suitable postgresql-libs for your postgresql version and your OS platform
2: Symbolic link that library in a "well known" library path like "/usr/lib":
ln -s /usr/pgsql-9.4/lib/libpq.so.5 /usr/lib/libpq.so.5
Attention: If your platform is 64 bit, you MUST also symbolic link to 64 bit libraries path:
ln -s /usr/pgsql-9.4/lib/libpq.so.5 /usr/lib64/libpq.so.5
3: Be happy !
Please ensure you have 'postgresql94' package installed as well (in addition to postgresql94-server, postgresql94-lib, postgresql94-devel and whatever other PG related package you already have). These libraries get installed along with that package.
Some ideas:
Your modified ~/.bashrc only takes effect when you start a new (interactive) shell. Though catching up on that will not help you because:
/etc/sudoers, your configuration file of sudo, probably specifies env_reset. This means, that /etc/init.d/postgres will not see the content of $LD_LIBRARY_PATH of your shell.
Insert debug statements in /etc/init.d/postgres to verify what I told you: echo "LDPATH: $LD_LIBRARY_PATH" >&2
Check /etc/init.d/postgres. Probably you will have to insert the third one of your export statements near the start of this script. Or you will have to update an existing export LD_LIBRARY_PATH= statement.
Have you installed the necessary libraries?
If you are using ubuntu try:
sudo apt-get install libpq libpq-dev