Hata mesajına bakılırsa, mysql_config komutu bulunamıyor. mysqlclient kütüphanesi, MySQL veritabanını kullanmanızı sağlar ve mysql_config komutuna ihtiyaç duyar. Bu komut, MySQL sunucusu yazılımının bir parçasıdır ve genellikle MySQL'nin geliştirme kütüphaneleri ile birlikte gelir.
Bu durumu çözmenin bir yolu, MySQL'nin geliştirme kütüphanelerini yüklemektir. Hangi işletim sistemini kullandığınıza bağlı olarak, bu adım değişebilir.
Ubuntu veya Debian tabanlı sistemlerde, aşağıdaki komutu çalıştırabilirsiniz:
bashCopy code
sudo apt-get install libmysqlclient-dev
Red Hat, CentOS veya Fedora tabanlı bir sistemde ise aşağıdaki komutu kullanabilirsiniz:
bashCopy code
sudo yum install mysql-devel
macOS'ta, Homebrew kullanıyorsanız aşağıdaki komutu kullanabilirsiniz:
bashCopy code
brew install mysql-client
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
Yukarıdaki komutlar, sisteminize MySQL geliştirme kütüphanelerini kurar ve mysql_config komutunun bulunabilir olmasını sağlar. Bu komutları çalıştırdıktan sonra, pip install flask-mysqldb komutunu yeniden deneyin. Bu, sorunun çözülmesine yardımcı olmalıdır.
Bununla birlikte, hala sorun yaşıyorsanız, lütfen daha fazla yardım için tekrar yazın.
Hocam dedikleriniz yaptım fakat bu sefer şöyle bir hata veriyor:
Collecting flask-mysqldb
Using cached Flask_MySQLdb-1.0.1-py3-none-any.whl
Collecting Flask>=0.12.4 (from flask-mysqldb)
Using cached Flask-2.3.2-py3-none-any.whl (96 kB)
Collecting mysqlclient>=1.3.7 (from flask-mysqldb)
Using cached mysqlclient-2.1.1.tar.gz (88 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [27 lines of output]
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
mysql_config --version
mariadb_config --version
mysql_config --libs
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/var/folders/0h/vbh4zbm97m15swry7_p6n6q00000gn/T/pip-build-env-_g0ts2xy/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/private/var/folders/0h/vbh4zbm97m15swry7_p6n6q00000gn/T/pip-build-env-_g0ts2xy/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "/private/var/folders/0h/vbh4zbm97m15swry7_p6n6q00000gn/T/pip-build-env-_g0ts2xy/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 487, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/0h/vbh4zbm97m15swry7_p6n6q00000gn/T/pip-build-env-_g0ts2xy/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 15, in <module>
File "/private/var/folders/0h/vbh4zbm97m15swry7_p6n6q00000gn/T/pip-install-dm4q59b5/mysqlclient_7e0a24438cc64b199d90edbe42ad709d/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/var/folders/0h/vbh4zbm97m15swry7_p6n6q00000gn/T/pip-install-dm4q59b5/mysqlclient_7e0a24438cc64b199d90edbe42ad709d/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.