Django - ImportError: No module named djangochat.settings - python

Here is my error trace of python manage.py runserver I am using django 1.10.7 with python 2.7
(faavenv) user#ubutnu:~/Documents/faa-backend$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_from_command_line(sys.argv)
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 316, in execute
settings.INSTALLED_APPS
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 97, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named djangochat.settings
Here is my requirements.txt
amqp==2.2.1
anyjson==0.3.3
asn1crypto==0.22.0
Babel==2.4.0
backports-abc==0.5
bcrypt==3.1.3
BeautifulSoup==3.2.1
beautifulsoup4==4.6.0
billiard==3.5.0.3
bleach==2.0.0
boto==2.48.0
boto3==1.4.4
botocore==1.5.80
celery==4.1.0
certifi==2017.4.17
cffi==1.10.0
chardet==3.0.4
cryptography==1.9
Django==1.10.7
django-celery-beat==1.0.1
django-contrib-comments==1.8.0
django-debug-toolbar==1.8
django-environ==0.4.3
django-nocaptcha-recaptcha==0.0.19
django-storages-redux==1.3.3
docutils==0.13.1
enum34==1.1.6
Fabric==1.13.2
feedparser==5.2.1
filebrowser-safe==0.4.7
flower==0.9.2
future==0.16.0
futures==3.1.1
grappelli-safe==0.4.6
html5lib==0.999999999
idna==2.5
ipaddress==1.0.18
jmespath==0.9.3
kombu==4.1.0
Mezzanine==4.2.3
nltk==3.2.4
numpy==1.13.0
oauthlib==2.0.2
olefile==0.44
pandas==0.20.2
paramiko==2.2.1
Pillow==4.1.1
psycopg2==2.7.1
pyasn1==0.2.3
pycparser==2.17
pycryptodomex==3.4.6
pyjwkest==1.3.6
PyJWT==1.5.2
PyNaCl==1.1.2
python-dateutil==2.6.0
python-openid==2.2.5
pytz==2017.2
requests==2.18.1
requests-oauthlib==0.8.0
s3transfer==0.1.10
scikit-learn==0.18.2
scipy==0.19.1
singledispatch==3.4.0.3
six==1.10.0
sklearn==0.0
social-auth-app-django==1.2.0
social-auth-core==1.4.0
sqlparse==0.2.3
tornado==4.5.1
tzlocal==1.4
urllib3==1.21.1
vine==1.1.4
webencodings==0.5.1
Problem is that I haven't install Django chat in my environment. Still, it is showing above error. Not only this project but in all project, I am receiving this error.
I tried to reinstall all library again but doesn't help.
Any suggestion would be appreciated.
(faavenv) user#ubuntu:~/Documents/faa-backend$ python manage.py shell
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_from_command_line(sys.argv)
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 316, in execute
settings.INSTALLED_APPS
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/home/soham/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 97, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named djangochat.settings
(faavenv) user#ubuntu:~/Documents/faa-backend$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import djangoChat
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named djangoChat
>>>

This error usually happens because you have a file that uses django and django is not imported.
You probably have a script somewhere in your project that is imported and has a executable function without the if __name__ == "__main__": part. So runserver imports this script, try to execute and fail, because django is not imported. So, if you have something like this, be sure that the running function is inside the above if statement, so runserver does not try to run the script when it is imported.
So, if you want to run a script that uses django (and it is not inside the models, views, forms usual stuff), you need to setup django first. You need to find the problematic file and add the following at the top:
import django
sys.path.append("path/to/django/settingsapp")
os.environ["DJANGO_SETTINGS_MODULE"] = "djangochat.settings"
django.setup()
If you find the problematic file and add the above, it will probably fix it.
Hope this helps.

Thank you for all answers, I just moved my project location and set it up again and It works. still, I don't know what was the issue but after moving project directory and environment It is working.

Related

import sqlparse ModuleNotFoundError: No module named 'sqlparse'

I have installed
pip install sqlparse
pip3 install sqlparse
conda install sqlparse
But still getting sqlparse module error
Why is that?
(New4) C:\Users\zesha\Documents\GitHub\django-blog>python manage.py makemigrations
Traceback (most recent call last):
File "C:\Users\zesha\Documents\GitHub\django-blog\manage.py", line 21, in <module>
main()
File "C:\Users\zesha\Documents\GitHub\django-blog\manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\zesha\AppData\Roaming\Python\Python39\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\zesha\AppData\Roaming\Python\Python39\site-packages\django\core\management\__init__.py", line 377, in execute
django.setup()
File "C:\Users\zesha\AppData\Roaming\Python\Python39\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\zesha\AppData\Roaming\Python\Python39\site-packages\django\apps\registry.py", line 114, in populate
app_config.import_models()
File "C:\Users\zesha\AppData\Roaming\Python\Python39\site-packages\django\apps\config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "C:\ProgramData\Miniconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\zesha\AppData\Roaming\Python\Python39\site-packages\django\db\utils.py", line 214, in __getitem__
backend = load_backend(db['ENGINE'])
File "C:\Users\zesha\AppData\Roaming\Python\Python39\site-packages\django\db\utils.py", line 111, in load_backend
return import_module('%s.base' % backend_name)
File "C:\ProgramData\Miniconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\zesha\AppData\Roaming\Python\Python39\site-packages\django\db\backends\sqlite3\base.py", line 32, in <module>
from .introspection import DatabaseIntrospection # isort:skip
File "C:\Users\zesha\AppData\Roaming\Python\Python39\site-packages\django\db\backends\sqlite3\introspection.py", line 4, in <module>
import sqlparse
ModuleNotFoundError: No module named 'sqlparse'
I am getting the following error.
I am not sure where should I install sqlparse
Since you also tried conda install, I am supsecting that you have anaconda or miniconda installed. pip and pip3 probably point to the python version managed by conda. However, your error message suggests that your script is being executed with a python version that is located at
C:\Users\zesha\AppData\Roaming\Python\Python39\
To install for that version of python specifically, you could try something like (might need to check that that is actual path to python.exe in that folder):
C:\Users\zesha\AppData\Roaming\Python\Python39\python.exe -m pip install sqlparse
Alternatively, run your script with the python that is managed by conda

Cloning a heroku hosted django project to your local machine

I'm new to python, Django, heroku and even PostgreSQL but am working on a Django project with a team of 3 devs (they set it up), so I'm trying to set it up on my local machine so I can start developing.
Firstly I cloned the repository to my local machine, there was a requirement.txt file, so I ran pip install -r ./requirements.txt to install all the python packages the project uses. Theres a runtime.txt file which specifies python 3.5 so I need to upgrade that. I see that gunicorn is one of the packages in requiments.txt, so I'm guessing I need to use that as the web server.
Heres the packages in requirements.txt that look important to me:
Django==1.9.6
gunicorn==19.5.0
psycopg2==2.6.1
boto3==1.3.1
boto==2.40.0
whitenoise==3.2
django-extensions==1.6.7
The site also has a .buildpacks file, which seems to be a heroku specific thing:
https://github.com/a2ikm/heroku-buildpack-libjpeg62
https://github.com/heroku/heroku-buildpack-python
https://github.com/rafaelp/heroku-buildpack-wkhtmltopdf
Theres a Procfile that contains this:
web: gunicorn myproject.wsgi --log-file -
worker: celery worker --app=genome.tasks.app -l info --beat
I'm wondering what the best way to do this is. Is there a way to automatically generate a virtual environment that has all the requirements and software specified in the project? I'm already using a virtual dev environment with created with Vagrant so I could provision it with all the dependencies, but I get the feeling theres a better way to do this.
UPDATE:
Heres what what happens when I try to run the server with python manage.py runserver:
$ python manage.py runserver
Current environment: P
Current environment: P
Performing system checks...
Unhandled exception in thread started by <function wrapper at 0x7fd0d08c71b8>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 116, in inner_run
self.check(display_num_errors=True)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 23, in check_resolver
for pattern in resolver.url_patterns:
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/var/www/sd2/selfdecode/decodify/urls.py", line 30, in <module>
url(r'', include("genome.urls")),
File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 52, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/var/www/sd2/selfdecode/genome/urls.py", line 7, in <module>
from . import views
File "/var/www/sd2/selfdecode/genome/views.py", line 20, in <module>
from decodify.aggregators import ArrayAgg, JsonAgg, ArrayaAggDelimited
File "/var/www/sd2/selfdecode/decodify/aggregators.py", line 29
def __init__(self, *expressions, distinct=False, **extra):
^
SyntaxError: invalid syntax
I'm guessing the parse error is due to using python 2.7 in a project that uses python 3.5. I installed python 3.5 with sudo apt-get install python3-all. Trying the same thing with python3:
$ python3 manage.py runserver
Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named 'django'
> python3
The second error means the packages I installed with pip install requirements.txt, they were installed for python 2.7, not 3.5. So this is obviously where virtual environments can come in. I tried this sudo -H virtualenv -p /usr/bin/python3 py3env, both with and without sudo, and both times I got errors :
[06:08 PM]-[vagrant#machine1]-[/var/www/sd2/selfdecode]-[git master]
$ sudo -H virtualenv -p /usr/bin/python3 py3env
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /var/www/sd2/selfdecode/py3env/bin/python3
Also creating executable in /var/www/sd2/selfdecode/py3env/bin/python
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2328, in <module>
main()
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 713, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 925, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1370, in install_python
os.symlink(py_executable_base, full_pth)
OSError: [Errno 71] Protocol error: 'python3' -> '/var/www/sd2/myproj/py3env/bin/python'
I came across this thread:
protocol error setting up virtualenvironment through vagrant on ubuntu
Where someone was having this problem using virtualenv inside a vagrant VM, and a possible solution is setting up the venv outside of the shared vagrant folder.

travic-ci build failing with django project

I am trying to setup travis-ci for the first time with a django project of mine and I am getting this trace in the travis output...
0.17s$ python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 13, in <module>
execute_from_command_line(sys.argv)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/core/management/__init__.py", line 316, in execute
settings.INSTALLED_APPS
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/conf/__init__.py", line 97, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/opt/python/2.7.9/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named py
The command "python manage.py migrate" exited with 1.
Now I can see that it is looking for a module named py instead of running the manage.py file but I don't see why that would happen, and I have found numerous resources online that have stated to run a command like that in the travi.yml file (heres one: https://gist.github.com/ndarville/3625246)
here is my travis.yml file:
script:
- python manage.py migrate
- python manage.py test
Now before I go running off and trying to get it to run by installing another module like tox or nose I would like to know if it is possible to do it this why and why it is failing and where to find the info in the docs... Thanks

openSSL error in Scrapy while creating project

I have just installed scrapy and all the things along with it as per from scrapy tutorial site.
When I create project using Scrapy with such command
scrapy startproject [projectname]
so it gives me following error
Traceback (most recent call last):
File "c:\python\python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python\Python27\Scripts\scrapy.exe\__main__.py", line 9, in <module>
File "c:\python\python27\lib\site-packages\scrapy\cmdline.py", line 122, in execute
cmds = _get_commands_dict(settings, inproject)
File "c:\python\python27\lib\site-packages\scrapy\cmdline.py", line 46, in _get_commands_dict
cmds = _get_commands_from_module('scrapy.commands', inproject)
File "c:\python\python27\lib\site-packages\scrapy\cmdline.py", line 29, in _get_commands_from_module
for cmd in _iter_command_classes(module):
File "c:\python\python27\lib\site-packages\scrapy\cmdline.py", line 20, in _iter_command_classes
for module in walk_modules(module_name):
File "c:\python\python27\lib\site-packages\scrapy\utils\misc.py", line 71, in walk_modules
submod = import_module(fullpath)
File "c:\python\python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "c:\python\python27\lib\site-packages\scrapy\commands\version.py", line 6, in <module>
import OpenSSL
ImportError: No module named OpenSSL
After that even I tried to install openSSl manually using pip
but it saying that package is already installed
Help me with it.
You can satisfy the missing dependency by doing the following:
You need to install OpenSSL binaries on your system. Get binaries
from here: https://wiki.openssl.org/index.php/Binaries
Then you need to install pyOpenSSL, from here: https://pypi.python.org/pypi/pyOpenSSL/0.13

Lost sqlite3 module from python after OSX Mavericks

After installing OS X Mavericks, I have been having issues running django's server:
(rango_tutorial)christohersmbp2:tango_with_django_project christopherspears$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/core/management/base.py", line 280, in execute
translation.activate('en-us')
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 130, in activate
return _trans.activate(language)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 188, in activate
_active.value = translation(language)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch
app = import_module(appname)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 6, in <module>
from django.contrib.admin.sites import AdminSite, site
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 4, in <module>
from django.contrib.admin.forms import AdminAuthenticationForm
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/contrib/admin/forms.py", line 6, in <module>
from django.contrib.auth.forms import AuthenticationForm
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/contrib/auth/forms.py", line 17, in <module>
from django.contrib.auth.models import User
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/contrib/auth/models.py", line 48, in <module>
class Permission(models.Model):
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/db/models/base.py", line 96, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/db/models/base.py", line 264, in add_to_class
value.contribute_to_class(cls, name)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/db/models/options.py", line 124, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/db/utils.py", line 198, in __getitem__
backend = load_backend(db['ENGINE'])
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/db/utils.py", line 113, in load_backend
return import_module('%s.base' % backend_name)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 35, in <module>
raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc)
django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): dlopen(/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/lib-dynload/_sqlite3.so, 2): Symbol not found: _sqlite3_enable_load_extension
Referenced from: /Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/lib-dynload/_sqlite3.so
Expected in: /usr/lib/libsqlite3.dylib
in /Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/lib-dynload/_sqlite3.so
I think the issue is that the sqlite3 module has gone missing for some reason:
(rango_tutorial)christohersmbp2:tango_with_django_project christopherspears$ python
Python 2.7.5 (default, Dec 31 2013, 11:46:08)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: dlopen(/Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/lib-dynload/_sqlite3.so, 2): Symbol not found: _sqlite3_enable_load_extension
Referenced from: /Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/lib-dynload/_sqlite3.so
Expected in: /usr/lib/libsqlite3.dylib
in /Users/christopherspears/.virtualenvs/rango_tutorial/lib/python2.7/lib-dynload/_sqlite3.so
I'm not sure what is causing this. Isn't the sqlite3 module normally just part of Python?
Updating OS X is notorious for messing up all sorts of Developer Tools.
What is your output when you type which sqlite3? How about other developer tools like which gcc? If they are missing you may need to reinstall Xcode. I know many users had to reinstall XCode after updating to Mavericks.
Here's the link for more information: https://developer.apple.com/xcode/
Uninstalling and reinstalling python with brew seemed to help with the earlier problem. Of course now, python is broken in that virtual environment:
(rango_tutorial)christohersmbp2:tango_with_django_project christopherspears$ python manage.py runserver
dyld: Library not loaded: #executable_path/../.Python
Referenced from: /Users/christopherspears/.virtualenvs/rango_tutorial/bin/python
Reason: image not found
Trace/BPT trap: 5
(rango_tutorial)christohersmbp2:tango_with_django_project christopherspears$ python
dyld: Library not loaded: #executable_path/../.Python
Referenced from: /Users/christopherspears/.virtualenvs/rango_tutorial/bin/python
Reason: image not found
Trace/BPT trap: 5

Categories

Resources