Error Loading Psycopg
Contents |
here for a quick overview of the site Help Center Detailed answers to django.core.exceptions.improperlyconfigured: error loading psycopg2 module: any questions you might have Meta Discuss the workings and policies install psycopg2 on windows of this site About Us Learn more about Stack Overflow the company Business Learn more no module named psycopg2 mac about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack command python setup py egg_info failed with error code 1 psycopg2 Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Django/Python Beginner: Error when executing python manage.py syncdb - psycopg2 not found up vote 21 down vote favorite 7 I have Pythong2.6, psycopg2 and pgAdmin3 installed using Macports.
Error: Pg_config Executable Not Found.
My settings.py is: DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'mysite' # Or path to database file if using sqlite3. DATABASE_USER = 'postgres' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. The error I get when I run python manage.py syncdb is: Traceback (most recent call last): File "manage.py", line 11, in
here for a quick overview of the site Help Center Detailed answers to any
Importerror: No Module Named Psycopg2
questions you might have Meta Discuss the workings and policies of please add the directory containing pg_config to the path this site About Us Learn more about Stack Overflow the company Business Learn more about failed building wheel for psycopg2 hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow http://stackoverflow.com/questions/1383126/django-python-beginner-error-when-executing-python-manage-py-syncdb-psycopg2 is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error running Python 3.4 with PostgreSQL (psycopg2) and Django up vote 1 down vote favorite So if I start Python 2.7's shell with python, and run import psycopg2, I don't receive http://stackoverflow.com/questions/27841794/error-running-python-3-4-with-postgresql-psycopg2-and-django any errors. However, if I try to run import psycopg2 in Python 3.4's shell, I get: ImportError: No module named 'psycopg2'. On the other hand, importing django works fine on both shells (after using pip3 to install it). Secondly, if I run python3 manage.py runserver, I get an error (see below), whereas I don't if I use just python. I think this is because of the first problem I described but I'm not sure (sorry if this is a stupid question, I'm really new to Django - trying to get through the tutorial). File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 23, in < module > import psycopg2 as Database ImportError: No module named 'psycopg2' During handling of the above exception, another exception occurred: Traceback(most recent call last): File "manage.py", line 10, in < module > execute_from_command_line(sys.argv) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/__init__.py", line 354, in execute django.setup() File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/__init__.py", line 21, in setup apps.populate(settings.INSTALLED_APPS) File "/Library/Frameworks/Python.framework
here for a quick overview of the site Help Center Detailed answers to http://stackoverflow.com/questions/32794615/raise-improperly-configured-psycopg2postgresql any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn http://serverfault.com/questions/619879/psycopg2-not-found-by-django-after-installing-in-virtualenv more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow error loading Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Raise Improperly configured psycopg2(postgresql) up vote 2 down vote favorite I am new to django. I had tried to configure postgresql with my project. steps what error loading psycopg i followed: 1) sudo apt-get install psycopg2 2)changing settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'dbname', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': '', 'PORT': '', } } 3) running python manage.py makemigrations but i am getting error Traceback (most recent call last): File "/home/vivekpradhan/joker/basket/local/lib/python3.4/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 20, in Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top psycopg2 not found by django after installing in virtualenv up vote 5 down vote favorite 1 I want to use postgresql with django so did the following: sudo apt-get install libpq-dev python-dev sudo apt-get update workon myenv sudo pip install psycopg2 And after configuring my settings.py correctly, I run ./manage.py syncdb But an exception gets thrown: django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2 The database configuration: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'mydb', 'USER': 'postgres', 'PASSWORD': 'password1234', 'HOST': 'localhost', 'PORT': '', } } postgresql django virtualenv share|improve this question edited Aug 14 '14 at 16:01 xofer 2,679518 asked Aug 12 '14 at 15:27 Joren 2816 Check permissions in the venv -- you installed w/ sudo. –xofer Aug 12 '14 at 15:39 Also can you confirm that you installed psycopg2 (and not psycpg2) with pip. –xofer Aug 12 '14 at 15:43 @xofer I did install psycopg2 –Joren Aug 12 '14 at 15:45 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote accepted Installing with sudo (sudo pip install ...) causes the installed files to be owned by root, and Django (run without sudo) cannot read them. You can sudo pip uninstall psycopg2 and then install without sudo. (If that doesn't work, try sudo chown -R $USER ~/.virtualenvs/myvenv first (assumes that's your virtualenv path). share|improve this answer answered Aug 14 '14 at 13:50 xofer 2,679518 2 you are my savior –Suoinguon Dec 16 '14 at 19:16 add a comment| Your Answer draft saved draft discarded Sig