psycopg2 ImportError: undefined symbol: PQconninfo - python-3.5

Couldn't able to import psycopg2
Output in python console:
import psycopg2
Traceback (most recent call last):
File "", line 1, in
File "/home/user/.py_virtualenvs/verb_py3/lib/python3.5/site-packages/psycopg2/init.py", line 50, in
from psycopg2._psycopg import ( # noqa
ImportError: /home/user/.py_virtualenvs/verb_py3/lib/python3.5/site-packages/psycopg2/_psycopg.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PQconninfo

Installed the psycopg2-binary package solved my issue.
pip install psycopg2-binary

This might be a defect problem in the underlying system. There might be multiple version of shared library, and at runtime you may not be able to find the proper library. It is usually painful to resolve. Since I am seeing the same problem, I will give a try at how to figure out the problem. This will be more useful than giving a fixed solution. I still have to find a solution for myself: 1. build the libpq library from a newer version. 2. find the proper libpq that was used at compile time by psycopg2.
Go to the source directory of psycopg2:
myuid#mycomputer:~/Downloads/psycopg2$ find . -name "*.c" | xargs grep PQconninfo
./psycopg/psycopgmodule.c: PQconninfoOption *options = NULL;
./psycopg/psycopgmodule.c: options = PQconninfoParse(Bytes_AS_STRING(dsn), &err);
./psycopg/psycopgmodule.c: PyErr_SetString(OperationalError, "PQconninfoParse() failed");
./psycopg/psycopgmodule.c: PQconninfoFree(options); /* safe on null */
./psycopg/connection_int.c: PQconninfoOption *connopts, *ptr;
./psycopg/connection_int.c: connopts = PQconninfoParse(pgdsn, NULL);
./psycopg/connection_int.c: PQconninfoFree(connopts);
./psycopg/connection_int.c: PQconninfoOption *options = NULL;
./psycopg/connection_int.c: if (!(options = PQconninfoParse(dsn, NULL))) {
./psycopg/connection_int.c: PQconninfoFree(options);
./psycopg/conninfo_type.c:".. seealso:: libpq docs for `PQconninfo()`__ for details.\n"
./psycopg/conninfo_type.c: PQconninfoOption *options = NULL;
./psycopg/conninfo_type.c: if (!(options = PQconninfo(self->conn->pgconn))) {
./psycopg/conninfo_type.c: PQconninfoFree(options);
./psycopg/conninfo_type.c: PyErr_SetString(NotSupportedError, "PQconninfo not available in libpq < 9.3");
./psycopg/connection_type.c: PQconninfoOption *options = NULL;
./psycopg/connection_type.c: if (!(options = PQconninfo(self->pgconn))) {
./psycopg/connection_type.c: PQconninfoFree(options);
./psycopg/connection_type.c: PyErr_SetString(NotSupportedError, "PQconninfo not available in libpq < 9.3");
./psycopg/utils.c:/* Make a dict out of PQconninfoOption array */
./psycopg/utils.c:psyco_dict_from_conninfo_options(PQconninfoOption *options, int include_password)
./psycopg/utils.c: PQconninfoOption *o;
Note: psycopg author already gave you an answer by the line:
"PQconninfo not available in libpq < 9.3"
Which means that the problem is the older libpq at RUNTIME, you probably used a newer version of libpq otherwise, psycopg2 may not compile.
By the line: PQconninfo(self->conn->pgconn)
You know that PQconninfo is a C function and it should be in your libpq
Your error message usually tells you where is the problem, in my case it is:
/usr/local/lib/python3.8/site-packages/psycopg2-2.8.5.dev0-py3.8-linux-x86_64.egg/psycopg2
Full error: >>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/psycopg2-2.8.5.dev0-py3.8-linux-x86_64.egg/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: /usr/local/lib/python3.8/site-packages/psycopg2-2.8.5.dev0-py3.8-linux-x86_64.egg/psycopg2/_psycopg.cpython-38-x86_64-linux-gnu.so: undefined symbol: PQconninfo
Here you should find a shared library:
_psycopg.cpython-38-x86_64-linux-gnu.so
Take a look at the library:
ldd _psycopg.cpython-38-x86_64-linux-gnu.so
linux-vdso.so.1 => (0x00007ffe985c7000)
libpq.so.5 => /usr/lib64/libpq.so.5 (0x00007ff922a13000)
libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007ff9227f7000)
libc.so.6 => /usr/lib64/libc.so.6 (0x00007ff922429000)
libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007ff9221b7000)
libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007ff921d54000)
libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007ff921a6b000)
libcom_err.so.2 => /usr/lib64/libcom_err.so.2 (0x00007ff921867000)
libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00007ff92161a000)
libldap_r-2.4.so.2 => /usr/lib64/libldap_r-2.4.so.2 (0x00007ff9213bb000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff922e87000)
libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007ff921188000)
libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007ff920f84000)
libz.so.1 => /usr/lib64/libz.so.1 (0x00007ff920d6e000)
libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007ff920b5e000)
libkeyutils.so.1 => /usr/lib64/libkeyutils.so.1 (0x00007ff92095a000)
libresolv.so.2 => /usr/lib64/libresolv.so.2 (0x00007ff920741000)
liblber-2.4.so.2 => /usr/lib64/liblber-2.4.so.2 (0x00007ff920532000)
libsasl2.so.3 => /usr/lib64/libsasl2.so.3 (0x00007ff920315000)
libssl3.so => /usr/lib64/libssl3.so (0x00007ff9200bc000)
libsmime3.so => /usr/lib64/libsmime3.so (0x00007ff91fe94000)
libnss3.so => /usr/lib64/libnss3.so (0x00007ff91fb65000)
libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007ff91f935000)
libplds4.so => /usr/lib64/libplds4.so (0x00007ff91f731000)
libplc4.so => /usr/lib64/libplc4.so (0x00007ff91f52c000)
libnspr4.so => /usr/lib64/libnspr4.so (0x00007ff91f2ee000)
libselinux.so.1 => /usr/lib64/libselinux.so.1 (0x00007ff91f0c7000)
libcrypt.so.1 => /usr/lib64/libcrypt.so.1 (0x00007ff91ee90000)
librt.so.1 => /usr/lib64/librt.so.1 (0x00007ff91ec88000)
libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007ff91ea26000)
libfreebl3.so => /usr/lib64/libfreebl3.so (0x00007ff91e823000)
Notice the line: libpq.so.5 => /usr/lib64/libpq.so.5
Now take a look at this library and only interested in the PPconninfo (it has a lots of functions and data)
nm -D /usr/lib64/libpq.so.5 | grep PQconninfo
000000000000cb90 T PQconninfoFree
000000000000df30 T PQconninfoParse
See you don't have PQconninfo function.
I believe it is more helpful by illustrating how to solve this problem; this may help you solve many similar problems.
Now I will add the solution on my system:
It turned out that there are multiple libpg on my system.
cd /usr
find . -name "libpq*"
... many others ignored
./pgsql-11/lib/libpq.so
Then update LD_LIBRARY_PATH to /usr/pgsql-11/lib:/usr/local/lib64, then the problem is gone.
python3.8
Python 3.8.1 (default, Jan 7 2020, 15:07:37)
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2

Re-installing psycopg2 using conda instead of using pip resolved the issue.

Just like #Kemin Zhou has said in one of the answers, one of the reasons for this problem could be an older libpq.so file.
I'm currently using Cent OS 7 and the version of postgresql-lib installed was:
$ yum list installed | grep postgres
Failed to set locale, defaulting to C
postgresql.x86_64 9.2.24-4.el7_8 installed
postgresql-devel.x86_64 9.2.24-4.el7_8 installed
postgresql-libs.x86_64 9.2.24-4.el7_8 installed
And I was not even able to update it because yum was unable to find the later versions for it:
$ yum list --showduplicates postgresql
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* epel: mirrors.ircam.fr
Installed Packages
postgresql.x86_64 9.2.24-4.el7_8 installed
Available Packages
postgresql.i686 9.2.24-2.el7 base
postgresql.x86_64 9.2.24-2.el7 base
postgresql.i686 9.2.24-2.el7_7 updates
postgresql.x86_64 9.2.24-2.el7_7 updates
postgresql.i686 9.2.24-4.el7_8 updates
postgresql.x86_64 9.2.24-4.el7_8 updates
This link helped me out.
Using that link I first added this repo that contained the updated postgresql10-libs:
$ yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
and then I installed the updated postgresql10-libs
$ yum install postgresql10-libs.x86_64

Related

shared lib file not found when import torch

I installed torch on my machine to run the latest onnxruntime tests and got this error.
ImportError: /usr/local/cuda-10.0/lib64/libcublas.so.10: version
`libcublas.so.10' not found (required by
/home/users/username/.local/lib/python3.8/site-packages/torch/lib/libtorch_cuda.so)
But this file does exist and I've made sure with command
ll /usr/local/cuda-10.0/lib64/libcublas.so.10
lrwxrwxrwx 1 root root 44 Dec 20 11:46 /usr/local/cuda-10.0/lib64/libcublas.so.10 -> /usr/local/cuda-10.0/lib64/libcublas.so.10.0
I've checked LD_LIBRARY_PATH and found that /usr/local/cuda-10.0/lib64/ is already in it. I've tried to put it to the front of LD_LIBRARY_PATH and still not working.
I've also tried to use ldd to see the lib file connection and did not get much info.
ldd /home/users/username/.local/lib/python3.8/site-packages/torch/lib/libtorch_cuda.so
/home/users/username/.local/lib/python3.8/site-packages/torch/lib/libtorch_cuda.so: /usr/local/cuda-10.0/lib64/libcublas.so.10: version `libcublas.so.10' not found (required by /home/users/username/.local/lib/python3.8/site-packages/torch/lib/libtorch_cuda.so)
linux-vdso.so.1 => (0x00007ffffb33e000)
libc10_cuda.so => /home/users/username/.local/lib/python3.8/site-packages/torch/lib/libc10_cuda.so (0x00007fedb38ae000)
libcudart-80664282.so.10.2 => /home/users/username/.local/lib/python3.8/site-packages/torch/lib/libcudart-80664282.so.10.2 (0x00007fedb362d000)
libnvToolsExt-3965bdd0.so.1 => /home/users/username/.local/lib/python3.8/site-packages/torch/lib/libnvToolsExt-3965bdd0.so.1 (0x00007fedb3423000)
libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007fedb3207000)
libc10.so => /home/users/username/.local/lib/python3.8/site-packages/torch/lib/libc10.so (0x00007fedb2f77000)
libtorch_cpu.so => /home/users/username/.local/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so (0x00007fed9a500000)
libm.so.6 => /usr/lib64/libm.so.6 (0x00007fed9a1fe000)
libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007fed99ffa000)
libcublas.so.10 => /usr/local/cuda-10.0/lib64/libcublas.so.10 (0x00007fed95a64000)
librt.so.1 => /usr/lib64/librt.so.1 (0x00007fed9585c000)
libstdc++.so.6 => /usr/local/gcc-5.4.0/lib64/libstdc++.so.6 (0x00007fed954e1000)
libgcc_s.so.1 => /usr/local/gcc-5.4.0/lib64/libgcc_s.so.1 (0x00007fed952ca000)
libc.so.6 => /usr/lib64/libc.so.6 (0x00007fed94efc000)
/lib64/ld-linux-x86-64.so.2 (0x00007fede3d1e000)
libgomp-a34b3233.so.1 => /home/users/username/.local/lib/python3.8/site-packages/torch/lib/libgomp-a34b3233.so.1 (0x00007fed94cd2000)
Turns out it was because I set the LD_LIBRARY and caused this issue.
I searched the local files and found there are multiple places that have this file:
...
/usr/local/cuda-10.0/lib64/libcublas.so.10
/home/users/username/.local/lib/python3.8/site-packages/torch/lib/libcublas.so.10
So it is because I have /usr/local/cuda-10.0/lib64/libcublas.so.10 this softlink in my system, it used this instead of its own lib file. After I removed this softlink, it worked.

Nix openai python dev-environment build failure

I am trying to make a python37 development environment containing the openai pypi package using nix.
This question was originally on reddit, but I couldn't find an answer and the activity in the thread was very low.
using the tipps i got there and the language frameworks documentation i managed to come up with the following expressions:
default.nix:
with import<nixpkgs>{};
( let
openai = pkgs.callPackage ./release.nix {
inherit pkgs;
buildPythonPackage = pkgs.python37Packages.buildPythonPackage;
};
in pkgs.python37.buildEnv.override rec {
extraLibs = [ pkgs.python37Packages.requests openai ];
}
).env
release.nix
{ pkgs, buildPythonPackage }:
buildPythonPackage rec{
pname="openai";
version="0.2.6";
src=fetchTarball{
url="https://files.pythonhosted.org/packages/59/2d/b3bc2aa663b2c376f073fd141e128ecfb47f3aff95ccee284a74d85a1ef8/openai-0.2.6.tar.gz";
sha256="0cplrzfw3i6yxcd35ijfjkx9jbcvkvzn5jn5b8s657a8myhm6kav";
};
propagateBuildInputs = [ pkgs.python37Packages.requests ];
doCheck=false;
meta = { # only for testing the env right now
homepage="...";
description="...";
license = "...";
maintainers= [];
};
}
however, this leaves me with the (i guess its pip-)error
Processing ./openai-0.2.6-py3-none-any.whl
ERROR: Could not find a version that satisfies the requirement requests>=2.20; python_version >= "3.0" (from openai==0.2.6) (from versions: none)
ERROR: No matching distribution found for requests>=2.20; python_version >= "3.0" (from openai==0.2.6)
builder for '/nix/store/ncnga4fcxl15xyvv3f325f9g0q45mqvr-python3.7-openai-0.2.6.drv' failed with exit code 1
which surprises me, because propagateBuildInputs = [ pkgs.python37Packages.requests ]; clearly states that the package requests (version 2.22.0 in nixpkgs) should be present at build time.
what am I misunderstanding about the buildPythonPackage function that prevents this from working?
Changing progagatedBuildInputs to another name like progagateBuildInputs causes it to be ignored, so any dependencies it contains (i.e. requests) are not found. For example:
yubico-client/default.nix
propagateBuildInputs = [ requests ];
ERROR: Could not find a version that satisfies the requirement requests<3.0,>=2.7 (from yubico-client==1.13.0) (from versions: none)
ERROR: No matching distribution found for requests<3.0,>=2.7 (from yubico-client==1.13.0)
propagatedBuildInputs = [ requests ];
$ nix-build -I nixpkgs=~/git/nixpkgs '<nixpkgs>' -k -A python37Packages.yubico-client
/nix/store/0yjz8smgmjr0006nmka6wliy01z8av7m-python3.7-yubico-client-1.13.0

PYODBC Cannot find driver for MSSQL

I am attempting to connect to SQL Server using a simple python script that looks like the following.
import pyodbc
details = {
'server': '<hostname>',
'database': '<database>',
'username': '<username>',
'password': '<password>'
}
connect_string = 'DRIVER={{ODBC Driver 17 for SQL Server}};SERVER={server};PORT=1443;DATABASE={database};UID={username};PWD={password}'.format(**details)
connection = pyodbc.connect(connect_string)
print(connection)
The only difference is that I have removed the config value for obvious reasons. However, when I run this script I get the following error:
Traceback (most recent call last):
File "connect.py", line 12, in <module>
connection = pyodbc.connect(connect_string)
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")
For reference the output of runnning odbcinst -j gives me:
unixODBC 2.3.4
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/bipvanwinkle/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
cat /etc/odbcinst.ini:
[SQLServer]
Description = ODBC Driver 17 for SQL Server
Driver = /usr/lib/x86_64-linux-gnu/libodbc.so
Setup = /usr/lib/x86_64-linux-gnu/libodbc.so.1
UsageCount = 1
FileUsage = 1
cat /etc/odbc.ini:
[SQLServer]
Description = ODBC Driver 17 for SQL Server
Driver = /usr/lib/x86_64-linux-gnu/libodbc.so
Servername =
Database =
UID =
Port = 1433
ls /usr/lib/x86_64-linux-gnu/libodbc.so:
/usr/lib/x86_64-linux-gnu/libodbc.so
ldd /usr/lib/x86_64llinux-gnu/libodbc.so:
linux-vdso.so.1 (0x00007ffc86bec000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f9841306000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f98410e7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9840cf6000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9840af2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f984177d000)
If it helps, both /etc/odbcinst.ini and /etc/odbc.ini were initially empty. I used a template I found online to fill them out. I definitely could have made errors.
Any ideas where I've gone wrong?
P.S. I'm running this on Ubuntu 17.10

gDebugger libGL error on linux

I'm trying to debug my OpenGl project with gDEBugger, but unfortunately gDEBugger is not even starting:
~/bin/gDEBugger581-x86_64> ./gDEBugger-bin
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
Segmentation fault
~/bin/gDEBugger581-x86_64> LIBGL_DEBUG=verbose ./gDEBugger-bin
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib64/dri/updates/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib64/dri/updates/swrast_dri.so
libGL error: dlopen /usr/lib64/dri/updates/swrast_dri.so failed (/usr/lib64/dri/updates /swrast_dri.so: cannot open shared object file: No such file or directory)
libGL: OpenDriver: trying /usr/lib64/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib64/dri/swrast_dri.so
libGL error: dlopen /usr/lib64/dri/swrast_dri.so failed (/usr/lib64/dri/swrast_dri.so: undefined symbol: _glapi_tls_Dispatch)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
Segmentation fault
this happens with the last gremedy version (5.8.1), the last AMD version (6.2.4) and the latest CodeXL version (CodeXL doesn't crash, but the same error appears non the less and debugging doesn't work).
I'm on OpenSuse 13.1, I have a NVIDIA card and the latest drivers installed. Other OpenGL programms work just fine. So far I've tried to reinstall NVIDIA drivers, reinstall all MESA packages, update CUDA from 5.5 to 6.5, checked that all mesa packages are installed from the standard suse repo and ran ldd:
~/bin/gDEBugger581-x86_64> ldd gDEBugger-bin
linux-vdso.so.1 (0x00007fffe9ffe000)
libGRBaseTools.so => ./libGRBaseTools.so (0x00007f41df93e000)
libGROSWrappers.so => ./libGROSWrappers.so (0x00007f41df6cc000)
libGRAPIClasses.so => ./libGRAPIClasses.so (0x00007f41df358000)
libGRProcessDebugger.so => ./libGRProcessDebugger.so (0x00007f41df123000)
libGRApiFunctions.so => ./libGRApiFunctions.so (0x00007f41deedf000)
libGRApplicationComponents.so => ./libGRApplicationComponents.so (0x00007f41debce000)
libgDEBuggerAppCode.so => ./libgDEBuggerAppCode.so (0x00007f41de5b0000)
libwx_base-2.8.so.0 => ./libwx_base-2.8.so.0 (0x00007f41de29e000)
libwx_gtk2_core-2.8.so.0 => ./libwx_gtk2_core-2.8.so.0 (0x00007f41ddcd9000)
libwx_gtk2_html-2.8.so.0 => ./libwx_gtk2_html-2.8.so.0 (0x00007f41dda2f000)
libwx_gtk2_adv-2.8.so.0 => ./libwx_gtk2_adv-2.8.so.0 (0x00007f41dd753000)
libwx_gtk2_aui-2.8.so.0 => ./libwx_gtk2_aui-2.8.so.0 (0x00007f41dd4e2000)
libwx_gtk2_gl-2.8.so.0 => ./libwx_gtk2_gl-2.8.so.0 (0x00007f41dd2d5000)
libwx_gtk2_stc-2.8.so.0 => ./libwx_gtk2_stc-2.8.so.0 (0x00007f41dcfcb000)
libfreeimage.so.3 => ./libfreeimage.so.3 (0x00007f41dcc35000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f41dc92d000)
libm.so.6 => /lib64/libm.so.6 (0x00007f41dc62a000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f41dc413000)
libc.so.6 => /lib64/libc.so.6 (0x00007f41dc065000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f41dbe61000)
librt.so.1 => /lib64/librt.so.1 (0x00007f41dbc59000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f41dba3b000)
libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f41db6fd000)
libz.so.1 => /lib64/libz.so.1 (0x00007f41db4e7000)
libGL.so.1 => /usr/X11R6/lib64/libGL.so.1 (0x00007f41db19b000)
libgtk-x11-2.0.so.0 => /usr/lib64/libgtk-x11-2.0.so.0 (0x00007f41dab5c000)
libgdk-x11-2.0.so.0 => /usr/lib64/libgdk-x11-2.0.so.0 (0x00007f41da8a7000)
libatk-1.0.so.0 => /usr/lib64/libatk-1.0.so.0 (0x00007f41da683000)
libgio-2.0.so.0 => /usr/lib64/libgio-2.0.so.0 (0x00007f41da31c000)
libpangoft2-1.0.so.0 => /usr/lib64/libpangoft2-1.0.so.0 (0x00007f41da108000)
libgdk_pixbuf-2.0.so.0 => /usr/lib64/libgdk_pixbuf-2.0.so.0 (0x00007f41d9ee7000)
libpango-1.0.so.0 => /usr/lib64/libpango-1.0.so.0 (0x00007f41d9c9b000)
libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f41d9a09000)
libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007f41d97cc000)
libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007f41d957b000)
libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007f41d9377000)
libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007f41d9175000)
libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f41d8e72000)
libXinerama.so.1 => /usr/lib64/libXinerama.so.1 (0x00007f41d8c6f000)
libXxf86vm.so.1 => /usr/lib64/libXxf86vm.so.1 (0x00007f41d8a69000)
libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007f41d8861000)
libGLU.so.1 => /usr/lib64/libGLU.so.1 (0x00007f41d85e2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f41dfb49000)
libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f41d83c3000)
libnvidia-tls.so.340.32 => /usr/lib64/tls/libnvidia-tls.so.340.32 (0x00007f41d81c0000)
libnvidia-glcore.so.340.32 => /usr/lib64/libnvidia-glcore.so.340.32 (0x00007f41d55ad000)
libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f41d539b000)
libpangocairo-1.0.so.0 => /usr/lib64/libpangocairo-1.0.so.0 (0x00007f41d518e000)
libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x00007f41d4f88000)
libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00007f41d4c69000)
libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007f41d4a5f000)
libXi.so.6 => /usr/lib64/libXi.so.6 (0x00007f41d484f000)
libXrandr.so.2 => /usr/lib64/libXrandr.so.2 (0x00007f41d4645000)
libXcursor.so.1 => /usr/lib64/libXcursor.so.1 (0x00007f41d443a000)
libXcomposite.so.1 => /usr/lib64/libXcomposite.so.1 (0x00007f41d4237000)
libXdamage.so.1 => /usr/lib64/libXdamage.so.1 (0x00007f41d4034000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f41d3e10000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f41d3bf9000)
libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so.0 (0x00007f41d39a6000)
libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007f41d3769000)
libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007f41d353f000)
libffi.so.4 => /usr/lib64/libffi.so.4 (0x00007f41d3337000)
libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007f41d30d1000)
libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007f41d2eb5000)
libuuid.so.1 => /usr/lib64/libuuid.so.1 (0x00007f41d2cb0000)
libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f41d2aac000)
libpixman-1.so.0 => /usr/lib64/libpixman-1.so.0 (0x00007f41d2803000)
libEGL.so.1 => /usr/X11R6/lib64/libEGL.so.1 (0x00007f41d24fa000)
libxcb-shm.so.0 => /usr/lib64/libxcb-shm.so.0 (0x00007f41d22f7000)
libxcb-render.so.0 => /usr/lib64/libxcb-render.so.0 (0x00007f41d20ed000)
libgraphite2.so.3 => /usr/lib64/libgraphite2.so.3 (0x00007f41d1ed1000)
libnvidia-glsi.so.340.32 => /usr/lib64/libnvidia-glsi.so.340.32 (0x00007f41d1c49000)
I noticed, that when running my own program with LIBGL_DEBUG=verbose there is not libGL output at all. I'm using glfw 2.7 and glew 1.9 if it matters. glut apps work.
I suppose that gDEBugger has a different way to find and load libGL and somehow it ends up using the mesa one and not the nvidia one. but my knowledge of mesa and nvidia driver and the workings of it are quite limited.
edit:
new information:
strace -e open ./gDEBugger-bin 2>&1 | grep libGL.so
open("./tls/x86_64/libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("./tls/libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("./x86_64/libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("./libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib64/mpi/gcc/openmpi/lib64/libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/damdam/bin/pgmodeler/libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/X11R6/lib64/libGL.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/usr/X11R6/lib64/libGL.so.340.32", O_RDONLY) = 3
open("/usr/X11R6/lib64/libGL.so.340.32", O_RDONLY) = 3
open("/usr/X11R6/lib64/libGL.so.340.32", O_RDONLY) = 4
open("/usr/lib64/libGL.so.1", O_RDONLY|O_CLOEXEC) = 7
open("/usr/X11R6/lib64/libGL.so.340.32", O_RDONLY) = 7
open("/usr/lib64/libGL.so.1", O_RDONLY) = 7
for comparison, this is the same for a working program: http://paste.opensuse.org/76645738
and this is the full output (without grep): http://paste.opensuse.org/8336779
i tried to setup the following links in /usr/lib64/:
libGLESv1_CM.so -> /usr/X11R6/lib64/libGLES
libGLESv1_CM.so.1 -> /usr/X11R6/lib64/libGL
libGLESv1_CM.so.1.1.0 -> /usr/X11R6/lib64/l
libGLESv2.so -> /usr/X11R6/lib64/libGLESv2.
libGLESv2.so.2 -> /usr/X11R6/lib64/libGLESv
libGLESv2.so.2.0.0 -> /usr/X11R6/lib64/libG
libGL.so -> /usr/X11R6/lib64/libGL.so
libGL.so.1 -> /usr/X11R6/lib64/libGL.so
libGL.so.1.2 -> /usr/X11R6/lib64/libGL.so
libGL.so.1.2.0 -> /usr/X11R6/lib64/libGL.so
after that the behaviour changed, the program crashed with a segfault and not printing anything.
edit:
new information
the gremedy gDEBugger (5.8.1) doesn't load /usr/lib64/libGL.so any more when
export LIBGL_DRIVERS_PATH="/usr/X11R6/lib64/"
it just crashes. so my guess is now, that it knew about the correct libGL all the time, but couldn't load it. either there is something strange with my system, or i'm the first reporting about this problem.
I had the same problem with the same distro, same release. Eventually I traced it to the environment variable LD_LIBRARY_PATH.
I had added /usr/lib/ and /usr/lib64/ to LD_LIBRARY_PATH to try to resolve a linking problem. It seems including those directories in LD_LIBRARY_PATH meant /usr/lib64/libGL.so.1 from the package Mesa-libGL1 hid /usr/X11R6/lib64/libGL.so.1 from the package x11-video-nvidiaG02.
Re-exporting LD_LIBRARY_PATH without those two directories had libGL sorted out and working again.
The error messages indicate that for some reason gDEBugger dynamically links a Mesa variant of libGL.so (only Mesa tries to talk the DRI protocol). With your NVidia GPU in the system and I presume the NVidia proprietary drivers being installed and configured as well, this indicates, something is seriously off.
The other possibility is, that you're don't have the NVidia proprietary drivers installed at all and are running completely off Mesa. The problem is, that the NVidia GPU support of Mesa is only rudimentary for any GPU built past 2005.
Note that if you're using the NVidia proprietary drivers you don't need Mesa being installed at all (although having it and using the Mesa libGL.so as linking target for your programs, even if the NVidia libGL.so is used at runtime is quite sensible).

Packet Tracer Libraries Needed (Debian)

I was able, easily, to download and install this on Ubuntu with the .deb file. I am currently using Crunchbang and I simply cannot get it to install.
Running it, I get error after error asking for library after library.
After installing all of these and more, I was able to clear up the libQt4* libraries.
apt-get install -y lib32-libpng lib32-libsm lib32-libxi lib32-libxrandr lib32-freetype2 lib32-fontconfig lib32-glib2 lib32-libstdc++5 extra/qtwebkit multilib/lib32-qt
My current error:
root#crunchbang:/usr/local/PacketTracer6/bin# ./PacketTracer6
./PacketTracer6: error while loading shared libraries: libQt3Support.so.4: cannot open shared object file: No such file or directory
I cannot find a package that contains this nor can I find it online. I have already downloaded libraries and LD_PRELOAD libraries to it.
ldd output:
./PacketTracer6: /lib/i386-linux-gnu/i686/cmov/libc.so.6: version `GLIBC_2.15' not found (required by ./PacketTracer6)
linux-gate.so.1 => (0xf76e5000)
libcrypto.so.1.0.0 => /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.0 (0xf7509000)
libQtWebKit.so.4 => /usr/lib/i386-linux-gnu/libQtWebKit.so.4 (0xf5dbe000)
libQtScriptTools.so.4 => /usr/lib/i386-linux-gnu/libQtScriptTools.so.4 (0xf5d06000)
libQtScript.so.4 => /usr/lib/i386-linux-gnu/libQtScript.so.4 (0xf5a7a000)
libQt3Support.so.4 => not found
libQtXml.so.4 => /usr/lib/i386-linux-gnu/libQtXml.so.4 (0xf5a38000)
libQtGui.so.4 => /usr/lib/i386-linux-gnu/libQtGui.so.4 (0xf4f54000)
libQtNetwork.so.4 => /usr/lib/i386-linux-gnu/libQtNetwork.so.4 (0xf4e10000)
libQtCore.so.4 => /usr/lib/i386-linux-gnu/libQtCore.so.4 (0xf4b2a000)
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xf4b11000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf4a25000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xf49ff000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf49e1000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xf487d000)
libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xf4879000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf4860000)
libsqlite3.so.0 => /usr/lib/i386-linux-gnu/libsqlite3.so.0 (0xf47b0000)
libXrender.so.1 => /usr/lib/i386-linux-gnu/libXrender.so.1 (0xf47a5000)
libgstapp-0.10.so.0 => /usr/lib/i386-linux-gnu/libgstapp-0.10.so.0 (0xf4797000)
libgstinterfaces-0.10.so.0 => /usr/lib/i386-linux-gnu/libgstinterfaces-0.10.so.0 (0xf4785000)
libgstpbutils-0.10.so.0 => /usr/lib/i386-linux-gnu/libgstpbutils-0.10.so.0 (0xf4761000)
libgstvideo-0.10.so.0 => /usr/lib/i386-linux-gnu/libgstvideo-0.10.so.0 (0xf4743000)
libgstbase-0.10.so.0 => /usr/lib/i386-linux-gnu/libgstbase-0.10.so.0 (0xf46df000)
libgstreamer-0.10.so.0 => /usr/lib/i386-linux-gnu/libgstreamer-0.10.so.0 (0xf45f5000)
libgobject-2.0.so.0 => /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 (0xf45a3000)
libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xf44a6000)
libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf436e000)
libfontconfig.so.1 => /usr/lib/i386-linux-gnu/libfontconfig.so.1 (0xf4337000)
libaudio.so.2 => /usr/lib/i386-linux-gnu/libaudio.so.2 (0xf431d000)
libpng12.so.0 => /lib/i386-linux-gnu/libpng12.so.0 (0xf42f3000)
libfreetype.so.6 => /usr/lib/i386-linux-gnu/libfreetype.so.6 (0xf4257000)
libSM.so.6 => /usr/lib/i386-linux-gnu/libSM.so.6 (0xf424f000)
libICE.so.6 => /usr/lib/i386-linux-gnu/libICE.so.6 (0xf4235000)
libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xf4223000)
librt.so.1 => /lib/i386-linux-gnu/i686/cmov/librt.so.1 (0xf421a000)
/lib/ld-linux.so.2 (0xf76e6000)
liborc-0.4.so.0 => /usr/lib/i386-linux-gnu/liborc-0.4.so.0 (0xf4189000)
libgmodule-2.0.so.0 => /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0 (0xf4183000)
libxml2.so.2 => /usr/lib/i386-linux-gnu/libxml2.so.2 (0xf402f000)
libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xf402c000)
libffi.so.5 => /usr/lib/i386-linux-gnu/libffi.so.5 (0xf4023000)
libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xf3fe5000)
libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf3fc1000)
libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0xf3f99000)
libXt.so.6 => /usr/lib/i386-linux-gnu/libXt.so.6 (0xf3f3c000)
libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf3f39000)
libuuid.so.1 => /lib/i386-linux-gnu/libuuid.so.1 (0xf3f33000)
liblzma.so.5 => /lib/i386-linux-gnu/liblzma.so.5 (0xf3f0b000)
libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf3f05000)
Running 'file' on PacketTracer6 ($ file PacketTracer6 )
shows the executable to be 32-bit.
It won't run at all on amd64 OS's without the supporting
32-bit libraries installed.
That is you need to set up your system as a multi-architecture
one.
On debian it's # dpkg --add-architecture i386
I haven't completed this, yet, so I don't know how many of
the necessary libs go in by default, and how many would have
to be installed slowly and by hand.
If someone else beats me to it, feel free to add to this.
You need to compile/install libQt3 because PacketTracer6 requires libQt3 library as ldd shows
libQt3Support.so.4 => not found
you need to install libqt4-qt3support from synaptic package manager
The packed in libraries depend on GCLIB 2.15 but wheezy comes with 2.13.
This helped for me:
apt-get install libqt4-qt3support:i386
apt-get install libqt4-scripttools:i386
mv /opt/pt/lib /opt/pt/lib.bak
mkdir /opt/pt/lib
ln -s /usr/lib/i386-linux-gnu/libQt* /opt/pt/lib

Resources