Library not loaded with MySQL 8.1 #652
Replies: 3 comments 4 replies
-
Did you tried to purge pip cache? pip caches wheel automatically. So you need to purge the cache after updating mysql-client C library. |
Beta Was this translation helpful? Give feedback.
-
I've also encountered this issue where, in MySQL 8.1, |
Beta Was this translation helpful? Give feedback.
-
I can not test Homebrew mysql 8.1. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Hi, I'm running into a missing dylib when I upgraded to MySQL 8.1 using brew on my mac.
When running Django, I see the following error:
Exception in thread django-main-thread: Traceback (most recent call last): File "/Users/steves/.pyenv/versions/dealership-interactive-brochure/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 15, in <module> import MySQLdb as Database File "/Users/steves/.pyenv/versions/dealership-interactive-brochure/lib/python3.10/site-packages/MySQLdb/__init__.py", line 17, in <module> from . import _mysql ImportError: dlopen(/Users/steves/.pyenv/versions/dealership-interactive-brochure/lib/python3.10/site-packages/MySQLdb/_mysql.cpython-310-darwin.so, 0x0002): Library not loaded: /usr/local/opt/mysql/lib/libmysqlclient.21.dylib Referenced from: <0EBE0705-B28B-383A-AC20-B6780216CECB> /Users/steves/.pyenv/versions/3.10.0/envs/dealership-interactive-brochure/lib/python3.10/site-packages/MySQLdb/_mysql.cpython-310-darwin.so Reason: tried: '/usr/local/opt/mysql/lib/libmysqlclient.21.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/mysql/lib/libmysqlclient.21.dylib' (no such file), '/usr/local/opt/mysql/lib/libmysqlclient.21.dylib' (no such file), '/usr/local/lib/libmysqlclient.21.dylib' (no such file), '/usr/lib/libmysqlclient.21.dylib' (no such file, not in dyld cache), '/usr/local/Cellar/mysql/8.1.0/lib/libmysqlclient.21.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/mysql/8.1.0/lib/libmysqlclient.21.dylib' (no such file), '/usr/local/Cellar/mysql/8.1.0/lib/libmysqlclient.21.dylib' (no such file), '/usr/local/lib/libmysqlclient.21.dylib' (no such file), '/usr/lib/libmysqlclient.21.dylib' (no such file, not in dyld cache)
When I go to look for the libmysqlclient.21.dylib it no longer exists, but it's now a new library version: libmysqlclient.22.dylib
Here's the path to it as well: /usr/local/Cellar/mysql/8.1.0/lib/libmysqlclient.22.dylib
I've attempted various reinstallations of both the mysqlclient package as as well as the brew mysql and mysql-client.
Environment
macOS 13.4.1
MySQL 8.1.0 for macos13.3 on x86_64 (Homebrew)
Python 3.10.0
Django 4.2.4
mysqlclient 2.2.0
How did you install libmysqlclient libraries?
brew install mysql
What version of mysqlclient do you use?
2.2.0
Docker command to start MySQL server
No response
Minimum but complete code to reproduce
Schema and initial data required to reproduce.
Commands, and any other step required to reproduce your issue.
Just trying to start Django and it fails upon startup
python manage.py runserver
Beta Was this translation helpful? Give feedback.
All reactions