You need to install python-dev:
sudo apt-get install python-dev
And, since you are using python3:
sudo apt-get install python3-dev
This command should help you.
If you are using mac os you might try:
brew update && brew rm python3 && brew install python3
You need to brew has been installed already, otherwise you can install it. It is very useful for getting packages in Mac OS. http://brew.sh/
For Ubuntu you also need to install build-essential
sudo apt-get install build-essential
- Django cms – invalid block tag endblock
- Have a url that accepts all characters
- How to write unit tests for django-rest-framework api's?
- Django-admin.py startproject opens notepad, instead of creating a project
- How to check whether virtualenv was created with '–no-site-packages'?
For those using different versions, such as Python 3.5, 3.6 or 3.7 I found this:
For Python 2.x use:
$ sudo apt-get install python-dev
For Python 2.7 use:
$ sudo apt-get install libffi-dev
For Python 3.x use:
$ sudo apt-get install python3-dev
For Python 3.4 use:
$ sudo apt-get install python3.4-dev
For Python 3.7 use:
$ sudo apt-get install python3.7-dev
If this still doesn’t help, others have pointed out to install
$ sudo apt-get install build-essential
$ sudo apt-get install libssl-dev
But the last two didn’t help me personally. Just in case, hope it helps you.
For those using python3.5:
apt-get install python3.5-dev
pip3.5 install mysqlclient
Tried all of the above suggestions and a few found elsewhere and nothing worked. In the end the solution was simple enough (courtesy of ignacionf on GitHub):
pip install git+https://github.com/PyMySQL/mysqlclient-python.git
- Pycharm Django Debugging is really slow
- Django-rest-swagger nested serializers with readonly fields not rendered properly
- Django – Import views from separate apps
- How to concatenate two model fields in a Django QuerySet?