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

MySQLdb module missing #195

Open
ifuchs opened this issue May 14, 2022 · 4 comments
Open

MySQLdb module missing #195

ifuchs opened this issue May 14, 2022 · 4 comments

Comments

@ifuchs
Copy link

ifuchs commented May 14, 2022

I did an install of piecash with:

pip install -U piecash[pandas,mysql]

and now if I try to do an open_book with a mysql uri, I am getting

"ModuleNotFoundError: No module named 'MySQLdb'"

I tried doing a pip install mysqlclient but it fails:

`
pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.1.0.tar.gz (87 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

� python setup.py egg_info did not run successfully.
� exit code: 1
��> [16 lines of output]
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "", line 36, in
File "", line 34, in
File "/private/var/folders/y2/38gkkc0s7d52_mr_s6zfj7m80000gq/T/pip-install-jhyhz4q5/mysqlclient_7d815c9d48da443fb56a51023ad822bf/setup.py", line 15, in
metadata, options = get_config()
File "/private/var/folders/y2/38gkkc0s7d52_mr_s6zfj7m80000gq/T/pip-install-jhyhz4q5/mysqlclient_7d815c9d48da443fb56a51023ad822bf/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/var/folders/y2/38gkkc0s7d52_mr_s6zfj7m80000gq/T/pip-install-jhyhz4q5/mysqlclient_7d815c9d48da443fb56a51023ad822bf/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

� Encountered error while generating package metadata.
��> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
`

@sdementen
Copy link
Owner

I see "bin/sh: mysql_config: command not found" in your log. Is MySQL installed on your system?
Piecash only installs the pyrhon->MySQL interface but you should already have MySQL installed.

@ifuchs
Copy link
Author

ifuchs commented May 15, 2022

That's a good question. I tried to install mysqlclient but it failed:

`
pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.1.0.tar.gz (87 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

� python setup.py egg_info did not run successfully.
� exit code: 1
��> [16 lines of output]
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "", line 36, in
File "", line 34, in
File "/private/var/folders/y2/38gkkc0s7d52_mr_s6zfj7m80000gq/T/pip-install-jhyhz4q5/mysqlclient_7d815c9d48da443fb56a51023ad822bf/setup.py", line 15, in
metadata, options = get_config()
File "/private/var/folders/y2/38gkkc0s7d52_mr_s6zfj7m80000gq/T/pip-install-jhyhz4q5/mysqlclient_7d815c9d48da443fb56a51023ad822bf/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/var/folders/y2/38gkkc0s7d52_mr_s6zfj7m80000gq/T/pip-install-jhyhz4q5/mysqlclient_7d815c9d48da443fb56a51023ad822bf/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

� Encountered error while generating package metadata.
��> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
`

@ifuchs
Copy link
Author

ifuchs commented May 15, 2022

pip install mysqlclient fails but conda install mysqlclient seems to have worked.

@sdementen
Copy link
Owner

sdementen commented May 15, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants