Reputation: 1289
I did an update/upgrade of homebrew.
After that, in all my django-projects virtualenvs, Python got broken.
What I did:
Reinstallation of virtualenv package:
$ pip uninstall virtualenv && pip install virtualenv
$ virtualenv --no-site-packages .virtualenv
$ source .virtualenv/bin/activate
Rebuild virtualenv
$cd .virtualenv/
$ find . -type l -delete
$ virtualenv .
OK, Python back in business
Launch local server
$python manage.py runserver
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/marta/work/webDev/scaleway_servermg/vetrinamg/.virtualenv/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: /usr/local/opt/mysql/lib/libmysqlclient.20.dylib
Referenced from: /Users/marta/work/webDev/scaleway_servermg/vetrinamg/.virtualenv/lib/python2.7/site-packages/_mysql.so
Reason: image not found.
Did you install mysqlclient or MySQL-python?
mysql issue
$pip uninstall MySQL-python
$pip install mysqlclient
Launch server again
$python manage.py runserver
[...]
File "/Users/marta/work/webDev/scaleway_servermg/vetrinamg/.virtualenv/lib/python2.7/site-packages/easy_thumbnails/engine.py", line 12, in <module>
from easy_thumbnails import utils
File "/Users/marta/work/webDev/scaleway_servermg/vetrinamg/.virtualenv/lib/python2.7/site-packages/easy_thumbnails/utils.py", line 15, in <module>
from easy_thumbnails.conf import settings
File "/Users/marta/work/webDev/scaleway_servermg/vetrinamg/.virtualenv/lib/python2.7/site-packages/easy_thumbnails/conf.py", line 334, in <module>
settings = Settings()
File "/Users/marta/work/webDev/scaleway_servermg/vetrinamg/.virtualenv/lib/python2.7/site-packages/easy_thumbnails/conf.py", line 21, in __init__
super(AppSettings, self).__init__(*args, **kwargs)
TypeError: __init__() takes exactly 2 arguments (1 given)
Could anyone point me to the correct solution?
I have the sensation that, as soon I fix a problem, a new one shows up.
Thank you for any help you could provide
Upvotes: 2
Views: 1478
Reputation: 1289
before becoming crazy, I decided to delete and recreate my virtualenv:
virtualenv --no-site-packages .virtualenv
source .virtualenv/bin/activate
install the project requirements:
pip install -r vetrinamg/requirements/local.txt
install mysqlclient:
pip install mysqlclient
recreate my local db:
mysql -u root
mysql> CREATE DATABASE db_vetrinamg;
mysql> USE db_vetrinamg;
migrate my models:
python manage.py migrate
python manage.py makemigrations
python manage.py migrate
boom, everything is running smoothly!
Upvotes: 3