Problem with Python MySQLClient library

tigeilenHOBBY

3 months ago

Hi,
I get an error while deploying my app because it has problems with the Python mysqlclient library. I need this library as the framework I use requires it to build a connection.

  Exception: Can not find valid pkg-config name.
  Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually

Do you know how to fix this?
Thank you and best regards

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

Solved

9 Replies

3 months ago

Hello,

Please provide your requirements.txt file

Thanks,

Brody


tigeilenHOBBY

3 months ago

Hi Brody, please see attached requirements.txt

Attachments


brody

Hello,Please provide your requirements.txt fileThanks,Brody

tigeilenHOBBY

3 months ago

Hi Brody, do you know a solution for my problem? Thank you


tigeilen

Hi Brody, do you know a solution for my problem? Thank you

tigeilenHOBBY

3 months ago

please see attached requirements file

Attachments


3 months ago

Hello,

Please only use PyMySQL -- you currently use mysqlclient and mysql-connector-python

Best,
Brody


brody

Hello,Please only use PyMySQL -- you currently use mysqlclient and mysql-connector-pythonBest,Brody

tigeilenHOBBY

3 months ago

Hi Brody, thanks for your answer. Unfortunately it doesn´t work.

I uninstalled mysqlclient and mysql-connector-python and tried to run my application with PyMySQL.

I get an error from the streamlit framework as follows:

"ModuleNotFoundError: No module named 'MySQLdb'. You need to install the 'mysqlclient' package to use this connection."

So it seems that streamlit requires the mysqlclient package. See streamlit documentation:

https://docs.streamlit.io/develop/tutorials/databases/mysql

Is there any other chance to use the mysqlclient?

Thanks,

Tim


3 months ago

You would have to write a Dockerfile for this deployment it seems.


brody

You would have to write a Dockerfile for this deployment it seems.

tigeilenHOBBY

2 months ago

Hi Brody, I added the dockerfile to my Github Repo and build was successful!

Thank you for your help!!

Best Regards

Tim


2 months ago

Awsome!


Status changed to Solved brody 2 months ago


Problem with Python MySQLClient library - Railway Help Station