Python Django Mysql Expected in: flat namespace









up vote
0
down vote

favorite












I'm working on a project by using Python(2.7) and Django(1.10) in which I need to use mysql as database, I have installed XAMPP on Mac OSX and created a database.



Here's my requirements.txt:



asn1crypto==0.24.0
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
cryptography==2.3
Django==1.10.4
enum34==1.1.6
idna==2.6
ipaddress==1.0.22
MySQL-python==1.2.5
mysqlclient==1.3.6
ndg-httpsclient==0.5.1
passlib==1.7.1
Pillow==5.1.0
pusher==2.0.1
pyasn1==0.4.4
pycparser==2.18
pyOpenSSL==18.0.0
requests==2.18.4
securetrading==1.0.14
six==1.11.0
stripe==1.82.1
urllib3==1.22


When I run my Django application by using this command as:



python manage.py runserver


It through an error like below:





Unhandled exception in thread started by Traceback (most recent call last): File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 226, in wrapper
fn(*args, **kwargs) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
line 113, in inner_run
autoreload.raise_last_exception() File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 249, in raise_last_exception
six.reraise(*_exception) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 226, in wrapper
fn(*args, **kwargs) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/init.py",
line 27, in setup
apps.populate(settings.INSTALLED_APPS) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/apps/registry.py",
line 108, in populate
app_config.import_models(all_models) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/apps/config.py",
line 199, in import_models
self.models_module = import_module(models_module_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py",
line 37, in import_module
import(name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/contrib/auth/models.py",
line 4, in
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/contrib/auth/base_user.py",
line 52, in
class AbstractBaseUser(models.Model): File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/base.py",
line 119, in new
new_class.add_to_class('_meta', Options(meta, app_label)) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/base.py",
line 316, in add_to_class
value.contribute_to_class(cls, name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/options.py",
line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length()) File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/init.py",
line 33, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/utils.py",
line 211, in getitem
backend = load_backend(db['ENGINE']) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/utils.py",
line 115, in load_backend
return import_module('%s.base' % backend_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py",
line 37, in import_module
import(name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
line 28, in
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module:
dlopen(/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so,
2): Symbol not found: _mysql_affected_rows Referenced from:
/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so




Expected in: flat namespace in



/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so











share|improve this question





















  • pip uninstall MySQL-python and then brew install mysql and install mysql after that pip install MySQL-python
    – RaminNietzsche
    Nov 11 at 13:41











  • what do you mean by "install mysql after that "?
    – Abdul Rehman
    Nov 11 at 14:22














up vote
0
down vote

favorite












I'm working on a project by using Python(2.7) and Django(1.10) in which I need to use mysql as database, I have installed XAMPP on Mac OSX and created a database.



Here's my requirements.txt:



asn1crypto==0.24.0
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
cryptography==2.3
Django==1.10.4
enum34==1.1.6
idna==2.6
ipaddress==1.0.22
MySQL-python==1.2.5
mysqlclient==1.3.6
ndg-httpsclient==0.5.1
passlib==1.7.1
Pillow==5.1.0
pusher==2.0.1
pyasn1==0.4.4
pycparser==2.18
pyOpenSSL==18.0.0
requests==2.18.4
securetrading==1.0.14
six==1.11.0
stripe==1.82.1
urllib3==1.22


When I run my Django application by using this command as:



python manage.py runserver


It through an error like below:





Unhandled exception in thread started by Traceback (most recent call last): File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 226, in wrapper
fn(*args, **kwargs) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
line 113, in inner_run
autoreload.raise_last_exception() File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 249, in raise_last_exception
six.reraise(*_exception) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 226, in wrapper
fn(*args, **kwargs) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/init.py",
line 27, in setup
apps.populate(settings.INSTALLED_APPS) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/apps/registry.py",
line 108, in populate
app_config.import_models(all_models) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/apps/config.py",
line 199, in import_models
self.models_module = import_module(models_module_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py",
line 37, in import_module
import(name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/contrib/auth/models.py",
line 4, in
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/contrib/auth/base_user.py",
line 52, in
class AbstractBaseUser(models.Model): File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/base.py",
line 119, in new
new_class.add_to_class('_meta', Options(meta, app_label)) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/base.py",
line 316, in add_to_class
value.contribute_to_class(cls, name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/options.py",
line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length()) File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/init.py",
line 33, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/utils.py",
line 211, in getitem
backend = load_backend(db['ENGINE']) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/utils.py",
line 115, in load_backend
return import_module('%s.base' % backend_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py",
line 37, in import_module
import(name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
line 28, in
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module:
dlopen(/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so,
2): Symbol not found: _mysql_affected_rows Referenced from:
/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so




Expected in: flat namespace in



/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so











share|improve this question





















  • pip uninstall MySQL-python and then brew install mysql and install mysql after that pip install MySQL-python
    – RaminNietzsche
    Nov 11 at 13:41











  • what do you mean by "install mysql after that "?
    – Abdul Rehman
    Nov 11 at 14:22












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm working on a project by using Python(2.7) and Django(1.10) in which I need to use mysql as database, I have installed XAMPP on Mac OSX and created a database.



Here's my requirements.txt:



asn1crypto==0.24.0
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
cryptography==2.3
Django==1.10.4
enum34==1.1.6
idna==2.6
ipaddress==1.0.22
MySQL-python==1.2.5
mysqlclient==1.3.6
ndg-httpsclient==0.5.1
passlib==1.7.1
Pillow==5.1.0
pusher==2.0.1
pyasn1==0.4.4
pycparser==2.18
pyOpenSSL==18.0.0
requests==2.18.4
securetrading==1.0.14
six==1.11.0
stripe==1.82.1
urllib3==1.22


When I run my Django application by using this command as:



python manage.py runserver


It through an error like below:





Unhandled exception in thread started by Traceback (most recent call last): File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 226, in wrapper
fn(*args, **kwargs) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
line 113, in inner_run
autoreload.raise_last_exception() File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 249, in raise_last_exception
six.reraise(*_exception) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 226, in wrapper
fn(*args, **kwargs) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/init.py",
line 27, in setup
apps.populate(settings.INSTALLED_APPS) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/apps/registry.py",
line 108, in populate
app_config.import_models(all_models) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/apps/config.py",
line 199, in import_models
self.models_module = import_module(models_module_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py",
line 37, in import_module
import(name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/contrib/auth/models.py",
line 4, in
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/contrib/auth/base_user.py",
line 52, in
class AbstractBaseUser(models.Model): File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/base.py",
line 119, in new
new_class.add_to_class('_meta', Options(meta, app_label)) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/base.py",
line 316, in add_to_class
value.contribute_to_class(cls, name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/options.py",
line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length()) File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/init.py",
line 33, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/utils.py",
line 211, in getitem
backend = load_backend(db['ENGINE']) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/utils.py",
line 115, in load_backend
return import_module('%s.base' % backend_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py",
line 37, in import_module
import(name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
line 28, in
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module:
dlopen(/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so,
2): Symbol not found: _mysql_affected_rows Referenced from:
/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so




Expected in: flat namespace in



/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so











share|improve this question













I'm working on a project by using Python(2.7) and Django(1.10) in which I need to use mysql as database, I have installed XAMPP on Mac OSX and created a database.



Here's my requirements.txt:



asn1crypto==0.24.0
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
cryptography==2.3
Django==1.10.4
enum34==1.1.6
idna==2.6
ipaddress==1.0.22
MySQL-python==1.2.5
mysqlclient==1.3.6
ndg-httpsclient==0.5.1
passlib==1.7.1
Pillow==5.1.0
pusher==2.0.1
pyasn1==0.4.4
pycparser==2.18
pyOpenSSL==18.0.0
requests==2.18.4
securetrading==1.0.14
six==1.11.0
stripe==1.82.1
urllib3==1.22


When I run my Django application by using this command as:



python manage.py runserver


It through an error like below:





Unhandled exception in thread started by Traceback (most recent call last): File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 226, in wrapper
fn(*args, **kwargs) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
line 113, in inner_run
autoreload.raise_last_exception() File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 249, in raise_last_exception
six.reraise(*_exception) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/utils/autoreload.py",
line 226, in wrapper
fn(*args, **kwargs) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/init.py",
line 27, in setup
apps.populate(settings.INSTALLED_APPS) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/apps/registry.py",
line 108, in populate
app_config.import_models(all_models) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/apps/config.py",
line 199, in import_models
self.models_module = import_module(models_module_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py",
line 37, in import_module
import(name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/contrib/auth/models.py",
line 4, in
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/contrib/auth/base_user.py",
line 52, in
class AbstractBaseUser(models.Model): File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/base.py",
line 119, in new
new_class.add_to_class('_meta', Options(meta, app_label)) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/base.py",
line 316, in add_to_class
value.contribute_to_class(cls, name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/models/options.py",
line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length()) File
"/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/init.py",
line 33, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/utils.py",
line 211, in getitem
backend = load_backend(db['ENGINE']) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/utils.py",
line 115, in load_backend
return import_module('%s.base' % backend_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py",
line 37, in import_module
import(name) File "/Users/abdul/multiEnv/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
line 28, in
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module:
dlopen(/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so,
2): Symbol not found: _mysql_affected_rows Referenced from:
/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so




Expected in: flat namespace in



/Users/abdul/multiEnv/lib/python2.7/site-packages/_mysql.so








python mysql django python-2.7 mysql-python






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 11 at 13:34









Abdul Rehman

920322




920322











  • pip uninstall MySQL-python and then brew install mysql and install mysql after that pip install MySQL-python
    – RaminNietzsche
    Nov 11 at 13:41











  • what do you mean by "install mysql after that "?
    – Abdul Rehman
    Nov 11 at 14:22
















  • pip uninstall MySQL-python and then brew install mysql and install mysql after that pip install MySQL-python
    – RaminNietzsche
    Nov 11 at 13:41











  • what do you mean by "install mysql after that "?
    – Abdul Rehman
    Nov 11 at 14:22















pip uninstall MySQL-python and then brew install mysql and install mysql after that pip install MySQL-python
– RaminNietzsche
Nov 11 at 13:41





pip uninstall MySQL-python and then brew install mysql and install mysql after that pip install MySQL-python
– RaminNietzsche
Nov 11 at 13:41













what do you mean by "install mysql after that "?
– Abdul Rehman
Nov 11 at 14:22




what do you mean by "install mysql after that "?
– Abdul Rehman
Nov 11 at 14:22

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53249261%2fpython-django-mysql-expected-in-flat-namespace%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53249261%2fpython-django-mysql-expected-in-flat-namespace%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

Evgeni Malkin