Installing mysqlclient

We’re trying to run a Django app using a MySQL backend, and in order to do that we need to run a pip install of mysqlclient (see recommended instructions here). However, when doing so, we run into an error that rpm as a command cannot be found, which ultimately crashes the entire pip install process. Would you be able to advise what to do? Searching the internet for the topic is not helpful, not least since it looks as though Red Hat 4.8.5 reached EOL in 2017.

Hi Kalle,

To get custom web apps using frameworks like Django running, you’ll need to set up a virtual environment using the Setup A Python App feature in your cPanel account. Since you share the server with others you ability to install much of anything is restricted, but a virtual environment is isolated and allows you to install packages to that specific virtual environment without impacting anything else on the server or even in your own account.

Once you have the environment set up, you should see a command that lets you enter the virtual environment.

Here, you should be able to successfully install any pip package you need.

You may also be interested in Reclaim Cloud, our new container-based cloud platform that gives you an isolated environment similar to the virtual environment you’ll be using, but with much more control. Please let me know if you have any other questions.

Thank you @cblankenship. I guess I was not explicit enough in my question. We have already successfully set up the Python app and it is up and running (using the SQLite database connection that is default for Django). It is running in a virtual environment. However, to switch from SQLite to MySQL, we need to install mysqlclient into the environment, and it generates the following error:

(Following your lead, I have removed our username and the app’s name, since it is the site itself. Let me know if you need that to help us in our quest to get this installed.)

Hi Kalle,

Would you mind opening a ticket with support@reclaimhosting.com so I can take a closer look at this? You can send along the server username and app name in the ticket as it won’t be public. Since this is third party software, our support will be limited but I would like to at least look into why it’s throwing this error even though I was able to get the package installed.

I’m just following up here to let anyone who may be browsing with a similar issue, this required some work on the server to allow users to access libraries which were already installed on the server. If you have a similar issue, please reach out to support@reclaimhosting.com

Hey did you ever solve this error, if so how because though am using a different hsoting company, but am runninng into this error, very similar to yours

May I know how you solved the above error

Hi there,
If you’re working with a different hosting company, you’ll want to reach out to their support for additional help. The solution mentioned in the previous response from cblankenship required some additional configuration at the server level that our end-users do not have access to given the nature of shared hosting. The support team at your current hosting company will be able to assist as they know the hosting environment you’re using.

Switching to python version 3.6.11 worked for me.