Error when trying to pip install mysqlclient
I'm trying to set up a Python application using the cPanel interface. I've successfully created it and added the requirements.txt file.
But when I click the "Run Pip Install" button, and select "requirements.txt", after it spins for a while I get this error message:
[quote]
error: subprocess-exited-with-error
" python setup.py bdist_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.
ERROR: Failed building wheel for mysqlclient
error: subprocess-exited-with-error
" Running setup.py install for mysqlclient 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.
error: legacy-install-failure
" Encountered error while trying to install package.
??> mysqlclientnote: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
The requirements.txt file lists
and my Python app is set to use python 3.8.6. How can I complete the installation?
The requirements.txt file lists
mysqlclient==2.1.0and my Python app is set to use python 3.8.6. How can I complete the installation?
-
Thanks. In the end I changed from using mysqlclient to mysql-connector-python which installed OK. A shame the former didn't work. If I wanted to try again, how would I install the mysql-community-devel or mysql-devel packages on cPanel? 0 -
Thanks. In the end I changed from using mysqlclient to mysql-connector-python which installed OK. A shame the former didn't work. If I wanted to try again, how would I install the mysql-community-devel or mysql-devel packages on cPanel?
Depends on OS but yum should work for AlmaLinux as well or you can use dnf install [pkg-name] yum install [pkg-name]yum install mysql-devel
yum install mysql-community-devel
ordnf install mysql-devel
dnf install mysql-community-devel
[root@server1 ~]# yum install mysql-community-devel Last metadata expiration check: 1:53:02 ago on Wed 11 May 2022 11:43:10 PM CDT. Package mysql-community-devel-8.0.29-1.el8.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete! [root@server1 ~]# ]yum install mysql-devel bash: ]yum: command not found [root@server1 ~]# yum install mysql-devel Last metadata expiration check: 1:54:11 ago on Wed 11 May 2022 11:43:10 PM CDT. Package mysql-community-devel-8.0.29-1.el8.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete! [root@server1 ~]0 -
Thank you! I'm a bit wary of installing extra stuff like this, given I'm setting this site up on someone else's server for them. But it's useful to know what to do if mysql-connector-python doesn't work out (or for anyone else finding this page and wondering what to do!). 0 -
I'm glad to hear that worked well! 0
Please sign in to leave a comment.
Comments
5 comments