LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 11-16-2022, 11:14 AM   #1
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Python is looking in the wrong place for MySQL ...


Okay, this is not strictly a "Linux" question, but it's close. (MacOS is Unix® ...)

All of the sudden, Python can no longer locate the MySQL interface libraries: it now thinks that they are in /usr/bin.

I can see from the traceback that it is using @rpath to find the location, and that it knows the name of the library that it should be looking for. But it's not looking in the right place anymore. (As I've said, "this used to work ...")

All of the web postings that I've so far found about "rpath" imply that in order to change it you must patch the binary. But that makes no sense to me. Obviously there should be something, somewhere, that informs Python where to look. But now it's broken – actually, "it broke" – and I really not enough of a Python God to understand why.

Relevant traceback:
Code:
  File "/Users/mike/.virtualenvs/djangoprod/lib/python3.11/site-packages/MySQLdb/__init__.py", line 18, in <module>
    from . import _mysql
ImportError: dlopen(/Users/mike/.virtualenvs/djangoprod/lib/python3.11/site-packages/MySQLdb/_mysql.cpython-311-darwin.so, 0x0002): Library not loaded: '@rpath/libmysqlclient.21.dylib'
  Referenced from: '/Users/mike/.virtualenvs/djangoprod/lib/python3.11/site-packages/MySQLdb/_mysql.cpython-311-darwin.so'
  Reason: tried: '/usr/lib/libmysqlclient.21.dylib' (no such file)
Right now I am considering nuking the present "virtual environment" and re-creating it from scratch ... because it sure looks like "everything that's now going very wrong" is inside it. But I'd right now really like to hear from anyone who is more familiar with this "magick" than I am.

Last edited by sundialsvcs; 11-16-2022 at 11:19 AM.
 
Old 11-17-2022, 07:54 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Duplicate
 
Old 11-18-2022, 08:24 AM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Mplayer place in KDE, lost icon, wrong place. firekage Slackware 4 01-24-2012 02:23 PM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
GTK+-2.6.2 compile error: libtool looking in wrong place for libglib-2.0.la Locura Linux - Software 5 02-17-2005 03:51 PM
insmod looking in the wrong place Recirqie Linux - Software 0 10-20-2004 03:38 PM
modprobe looking for modules in the wrong place? Jaster150 Slackware 20 09-20-2004 09:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration