I’m having a difficulty with operating a script inside a python digital atmosphere.
I’ve put in MySQL, MySQL shopper, Django, and every little thing utilizing Homebrew since I’m on a Mac M1 (Apple M1 Professional operating Sonoma 14.4). After I double-check this utilizing pip set up, I at all times get a requirement happy message. Additionally, I’ve no points beginning up a database inside MySQL and accessing this database.
I’ve seen some info that it is a model error, however uninstalling and re-installing MySQL with arch arm64 brew set up mysql
supplies the identical errors as above. I’ve additionally seen some info saying to put in simply the precise library that’s lacking, however I’m not positive which one that’s on this case.
That is the entire error I get:
Traceback (most up-to-date name final):
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/db/backends/mysql/base.py", line 15, in <module>
import MySQLdb as Database
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/MySQLdb/__init__.py", line 17, in <module>
from . import _mysql
ImportError: dlopen(/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/MySQLdb/_mysql.cpython-312-darwin.so, 0x0002): image not present in flat namespace '_mysql_affected_rows'
The above exception was the direct reason behind the next exception:
Traceback (most up-to-date name final):
File "/Customers/giuseppespartico/Desktop/jrc-folder/kcb-ds/./handle.py", line 21, in <module>
important()
File "/Customers/giuseppespartico/Desktop/jrc-folder/kcb-ds/./handle.py", line 17, in important
execute_from_command_line(sys.argv)
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/core/administration/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/core/administration/__init__.py", line 416, in execute
django.setup()
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/apps/registry.py", line 116, in populate
app_config.import_models()
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/apps/config.py", line 269, in import_models
self.models_module = import_module(models_module_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Variations/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(identify[level:], bundle, stage)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 995, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/contrib/auth/fashions.py", line 3, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/contrib/auth/base_user.py", line 57, in <module>
class AbstractBaseUser(fashions.Mannequin):
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/db/fashions/base.py", line 143, in __new__
new_class.add_to_class("_meta", Choices(meta, app_label))
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/db/fashions/base.py", line 371, in add_to_class
worth.contribute_to_class(cls, identify)
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/db/fashions/choices.py", line 243, in contribute_to_class
self.db_table, connection.ops.max_name_length()
^^^^^^^^^^^^^^
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/utils/connection.py", line 15, in __getattr__
return getattr(self._connections[self._alias], merchandise)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/utils/connection.py", line 62, in __getitem__
conn = self.create_connection(alias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/db/utils.py", line 193, in create_connection
backend = load_backend(db["ENGINE"])
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/db/utils.py", line 113, in load_backend
return import_module("%s.base" % backend_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Variations/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(identify[level:], bundle, stage)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Customers/giuseppespartico/Desktop/jrc-folder/biomonenv/lib/python3.12/site-packages/django/db/backends/mysql/base.py", line 17, in <module>
elevate ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you put in mysqlclient?
Does anybody know tips on how to repair this?