Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysqlclient in poetry environment is installing the wrong version of mysqldb #8432

Closed
4 tasks done
mljlynch opened this issue Sep 12, 2023 · 3 comments
Closed
4 tasks done
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@mljlynch
Copy link

mljlynch commented Sep 12, 2023

  • Poetry version: Poetry (version 1.6.1)
  • Python version: Python: 3.11.1
  • OS version and name: macOS 13.5.2
  • pyproject.toml:
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

When running pytests under my poetry environment on a mac M2 chip, I get the following error:

E   ImportError: dlopen(/Users/Jake/Library/Caches/pypoetry/virtualenvs/fig-etl-wTxwD1sp-py3.11/lib/python3.11/site-packages/MySQLdb/_mysql.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '_mysql_affected_rows'

I understand this is probably due to mismatched binaries, but since I'm not directly installing mysqldb. This seems related to this issue, but there is no specific poetry fix:

PyMySQL/mysqlclient#496

@mljlynch mljlynch added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 12, 2023
@dimbleby
Copy link
Contributor

I see no reason to suspect a poetry bug. Indeed the repeated appearance of the same issue in the mysqlclient issue tracker from people who are not using poetry tends to lead to the opposite conclusion

please make a (much) more convincing case that this is a poetry issue - or close

@mljlynch
Copy link
Author

mljlynch commented Sep 13, 2023

Thanks @dimbleby - you are correct, this is not related to poetry.

Just documenting because this was so frustrating for me:

The solution is to brew uninstall the corresponding mysql and mysql-connector packages in both the arm (/opt/homebrew/bin/brew) and x86 version (/usr/local/bin/brew ) of brew and then reinstall mysql (brew install mysql) making sure you are in an arm terminal.

Then you have to destroy the existing poetry environment and re-install. and It should work.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants