29👍
gcc
is part of the build-essential
package, which you should install before anything else:
sudo apt-get install build-essential
UPDATE: Following @bosnjak’s suggestion, you also might need to install the openssl developer tools:
sudo apt-get install libssl-dev
22👍
I specified the particular version of python it’s 3.7
And that helped me
I have installed these ones:
sudo apt-get install python3.7-dev libmysqlclient-dev
And then installed mysqlclient by:
pip install mysqlclient
- Django with NoSQL database
- In python django how do you print out an object's introspection? The list of all public methods of that object (variable and/or functions)?
- Use of python super function in django model
10👍
I turned out, that the solution is slightly different for almost every Python version. For those using different versions, such as Python 2.x, 3.5 or 3.7 I found this:
Part I
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
For Python 3.8 use:
$ sudo apt-get install python3.8-dev
For Python 3.9 use:
$ sudo apt-get install python3.9-dev
Part II
If this still doesn’t help, others have pointed out to install
$ sudo apt-get install build-essential
and finally
$ sudo apt-get install libssl-dev
But the last two didn’t help myself – but hoping this might help you!
- Django – inlineformset_factory with more than one ForeignKey
- Inline in Django admin: has no ForeignKey
- Save the related objects before the actual object being edited on django admin
2👍
You may do this before:
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
- Django AttributeError: 'DatabaseOperations' object has no attribute 'select'
- Django Activity Feed (Feedly Integration?)
- How to display "x days ago" type time using Humanize in Django template?
- Django 3.1: StreamingHttpResponse with an async generator
1👍
This issue was persistent in Ubuntu and python 3+. In my case, I was using Ubuntu 18.04 and found this solution to be useful for python version 3.7.5
Step 1. Install libpython3.7-dev via sudo apt
> sudo apt-get install libpython3.7-dev
Step 2: Install mysqlclient
> python3 -m pip install mysqlclient==1.4.6
- Django ForeignKey limit_choices_to a different ForeignKey id
- Tastypie Negation Filter
- Can't login to Django /admin interface
- Whole model as read-only
- Django + uWSGI + Nginx + SSL – request for working configuration (emphasis on SSL)
0👍
I wanted to install the ‘Modoboa’ mail-server package (https://github.com/modoboa/modoboa) on my Ubuntu 18.04 with Apache as my webserver, instead of nginx. I needed mysqlclient
for Python 2.7. The following packages worked for me:
sudo apt-get install libssl-dev gcc python2.7-dev libmysqlclient-dev
- Django – Change a ForeignKey relation to OneToOne
- Django – reverse query name clash
- What method attributes are used in Django?
0👍
I’m using the python3.8. Similarly to david’s answer, use the following command then it works.
$ sudo apt-get install python3.8-dev
- Django attribute error. 'module' object has no attribute 'rindex'
- Django Testing – Hard code URLs or Not
- Django + Forms: Dynamic choices for ChoiceField
- Best way to reference the User model in Django >= 1.5