¨¨¨ [root@offrig mysql]$ python -c "import MySQLdb"
Traceback (most recent call last):
File "<string>", line 1, in ?
File "build/bdist.linux-x86_64/egg/MySQLdb/init.py", line 19, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 7, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 6, in bootstrap
ImportError: libmysqlclient_r.so.14: cannot open shared object file: No such file or directory [root@offrig mysql]$
¨¨¨
- I am running Red-hat
- I have installed MySQL version - ¨mysql Ver 14.7 Distrib 4.1.20, for redhat-linux-gnu (i386) using readline 4.3¨
- I am running ¨python 2.4¨ and
- want to install ¨MySQL-python-1.2.2¨
So, how can I sort out the above problem?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
$> rpm -i MySQL-devel-4.1.22-0.glibc23.x86_64.rpm
warning: MySQL-devel-4.1.22-0.glibc23.x86_64.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
file /usr/bin/mysql_config from install of MySQL-devel-4.1.22-0.glibc23 conflicts with file from package mysql-4.1.20-1.RHEL4.1
When I try this :
$> python -c "import _mysql"
Traceback (most recent call last):
File "<string>", line 1, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 7, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 6, in bootstrap
ImportError: libmysqlclient_r.so.14: cannot open shared object file: No such file or directory
$>
What could possibly be the problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, the loader path is something else. See /etc/ld.so.conf or you may have LD_LIBRARY_PATH set in your environment.
Also, make sure you really have libmysqlclient_r.so.14 on your system.
Whose MySQL packages are you using? They don't look Red Hat's. Indeed, it looks like you have a package conflict. Looks like maybe they are the mysql.com packages. Make sure you also have MySQL-shared installed. (You might need MySQL-shared-standard and MySQL-shared-compat on your platform.) You should also remove the old RHEL4 packages (the mysql-* ones).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi There,
I am dealing with the following error
¨¨¨
[root@offrig mysql]$ python -c "import MySQLdb"
Traceback (most recent call last):
File "<string>", line 1, in ?
File "build/bdist.linux-x86_64/egg/MySQLdb/init.py", line 19, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 7, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 6, in bootstrap
ImportError: libmysqlclient_r.so.14: cannot open shared object file: No such file or directory
[root@offrig mysql]$
¨¨¨
- I am running Red-hat
- I have installed MySQL version - ¨mysql Ver 14.7 Distrib 4.1.20, for redhat-linux-gnu (i386) using readline 4.3¨
- I am running ¨python 2.4¨ and
- want to install ¨MySQL-python-1.2.2¨
So, how can I sort out the above problem?
Thanks!
I'm getting the same error, but with libmysqlclient_r.so.15. Here's the output from my install process. Tell me if I'm crazy.
21:57:41 [root@enma] MySQL-python-1.2.2$ cat site.cfg
[options]
embedded: link against the embedded server library
threadsafe: use the threadsafe client
static: link against a static library (probably required for embedded)
embedded = False
threadsafe = True
static = True
The path to mysql_config.
Only use this if mysql_config is not on your PATH, or you have some weird
setup that requires it.
mysql_config = /usr/local/bin/mysql_config
The Windows registry key for MySQL.
This has to be set for Windows builds to work.
Only change this if you have a different version.
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0
21:58:20 [root@enma] MySQL-python-1.2.2$ which mysql_config
/usr/local/bin/mysql_config
21:58:57 [root@enma] MySQL-python-1.2.2$ export LD_LIBRARY_PATH=/usr/local/lib/mysql
21:59:00 [root@enma] MySQL-python-1.2.2$ ls -l /usr/local/lib/mysql/libmysqlclient_r.so.15
-rwxr-xr-x 1 root wheel 419681 Mar 27 01:16 /usr/local/lib/mysql/libmysqlclient_r.so.15
21:59:02 [root@enma] MySQL-python-1.2.2$ python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb
running build_ext
21:59:16 [root@enma] MySQL-python-1.2.2$ python setup.py install
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.freebsd-6.1-RELEASE-i386/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb
running build_ext
creating build/bdist.freebsd-6.1-RELEASE-i386/egg
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/_mysql_exceptions.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg
creating build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/init.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/converters.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/connections.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/cursors.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/release.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/times.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb
creating build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/constants/init.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/constants/CR.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/constants/ER.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/constants/FLAG.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/constants/REFRESH.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/MySQLdb/constants/CLIENT.py -> build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants
copying build/lib.freebsd-6.1-RELEASE-i386-2.4/_mysql.so -> build/bdist.freebsd-6.1-RELEASE-i386/egg
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/_mysql_exceptions.py to _mysql_exceptions.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/init.py to init.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/converters.py to converters.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/connections.py to connections.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/cursors.py to cursors.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/release.py to release.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/times.py to times.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants/init.py to init.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants/CR.py to CR.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants/FIELD_TYPE.py to FIELD_TYPE.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants/ER.py to ER.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants/FLAG.py to FLAG.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants/REFRESH.py to REFRESH.pyc
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/MySQLdb/constants/CLIENT.py to CLIENT.pyc
creating stub loader for _mysql.so
byte-compiling build/bdist.freebsd-6.1-RELEASE-i386/egg/_mysql.py to _mysql.pyc
creating build/bdist.freebsd-6.1-RELEASE-i386/egg/EGG-INFO
writing MySQL_python.egg-info/native_libs.txt
copying MySQL_python.egg-info/PKG-INFO -> build/bdist.freebsd-6.1-RELEASE-i386/egg/EGG-INFO
copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.freebsd-6.1-RELEASE-i386/egg/EGG-INFO
copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.freebsd-6.1-RELEASE-i386/egg/EGG-INFO
copying MySQL_python.egg-info/native_libs.txt -> build/bdist.freebsd-6.1-RELEASE-i386/egg/EGG-INFO
copying MySQL_python.egg-info/top_level.txt -> build/bdist.freebsd-6.1-RELEASE-i386/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/MySQL_python-1.2.2-py2.4-freebsd-6.1-RELEASE-i386.egg' and adding 'build/bdist.freebsd-6.1-RELEASE-i386/egg' to it
removing 'build/bdist.freebsd-6.1-RELEASE-i386/egg' (and everything under it)
Processing MySQL_python-1.2.2-py2.4-freebsd-6.1-RELEASE-i386.egg
Removing /usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-freebsd-6.1-RELEASE-i386.egg
Copying MySQL_python-1.2.2-py2.4-freebsd-6.1-RELEASE-i386.egg to /usr/local/lib/python2.4/site-packages
MySQL-python 1.2.2 is already the active version in easy-install.pth
Installed /usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-freebsd-6.1-RELEASE-i386.egg
Processing dependencies for MySQL-python==1.2.2
Finished processing dependencies for MySQL-python==1.2.2
Then...
Error loading MySQLdb module: Shared object "libmysqlclient_r.so.15" not found, required by "_mysql.so"
Any insight into this problem would be appreciated.
Thanks.
I figured this problem out.
I didn't have LD_LIBRARY_PATH=/usr/local/lib/mysql set at run time.
In other words, python -c "import _mysql" worked in a shell with LD_LIBRARY_PATH set, but not in one that didn't have that env var.
Have you installed all the required development packages? Check README.
Hi, Yes.
I have just installed ¨python-devel-2.3.4-14.2¨ but I still get the same import error as above.
What else could be the problem?
Regards,
Do you have the MySQL development packages? Are the MySQL libraries on your default loader path?
Do you mean is my Mysql libraries on my system´s path?
well,
I do get this ,
$>echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:
/usr/local/rig/bin/:/usr/local/run_codes:/usr/local/mysql/bin:/usr/local/mysql/lib/mysql
and mysql is installed under /usr/local/mysql
ABOUT THE DEVELOPMENT PACKAGES -
Ie just tried the ffg :
$> rpm -i MySQL-devel-4.1.22-0.glibc23.x86_64.rpm
warning: MySQL-devel-4.1.22-0.glibc23.x86_64.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
file /usr/bin/mysql_config from install of MySQL-devel-4.1.22-0.glibc23 conflicts with file from package mysql-4.1.20-1.RHEL4.1
When I try this :
$> python -c "import _mysql"
Traceback (most recent call last):
File "<string>", line 1, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 7, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 6, in bootstrap
ImportError: libmysqlclient_r.so.14: cannot open shared object file: No such file or directory
$>
What could possibly be the problem?
No, the loader path is something else. See /etc/ld.so.conf or you may have LD_LIBRARY_PATH set in your environment.
Also, make sure you really have libmysqlclient_r.so.14 on your system.
Whose MySQL packages are you using? They don't look Red Hat's. Indeed, it looks like you have a package conflict. Looks like maybe they are the mysql.com packages. Make sure you also have MySQL-shared installed. (You might need MySQL-shared-standard and MySQL-shared-compat on your platform.) You should also remove the old RHEL4 packages (the mysql-* ones).