Error No Module Named Psycopg2.extensions
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 Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow 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 ImportError: No module named 'psycopg2' up vote 0 down vote favorite I've already installed the dependencies with sudo apt-get build-dep python-psycopg2 and then installing psycopg2 with sudo pip install psycopg2 and even with easy_install psycopg2. But even after all this, if I run python3 code.py I get ImportError: No module named 'psycopg2' If I run sudo apt-get build-dep python3-psycopg2 I get Picking 'psycopg2' as source package instead of 'python3-psycopg2' 0 upgraded, 0 newly installed, 0 to remove and 144 not upgraded. Same with sudo apt-get build-dep python-psycopg2 Please help. python share|improve this question asked Mar 6 '15 at 14:31 user2316393 10125 Are you installing psycopg2 in your virtual env? if not... After running sudo apt-get build-dep python-psycopg2. Create a virtual env and try installing psycopg2 in the virtual env. –user1846747 Mar 6 '15 at 14:37 @DivakarDass can you please point me to some tutorials which tell about installing psycopg2 in virtual env? I am new to python and don't know much about virtual env. –user2316393 Mar 6 '15 at 14:41 add a comment| 3 Answers 3 active oldest votes up vote 0 down vote accepted its always better to work in virtualenv and not mess up with your system try: virtualenv -p /usr/bin/python3 test_env source test_env/bin/activate pip install psycopg2 run python and try to import if you insist on installing it on your systems python try: pip3 install psycopg2 share|improve this answer answered Mar 6 '15 at 14:40 Urban48 536215 Virtualenv didn't work. But pip3 install psycopg2 works! Thanks. –user2316393 Mar 6 '15 at 14:49 if
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 Stack Overflow http://stackoverflow.com/questions/28900950/importerror-no-module-named-psycopg2 Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow 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 Error: No module named psycopg2.extensions http://stackoverflow.com/questions/18768488/error-no-module-named-psycopg2-extensions-django-postgresql django postgresql up vote 4 down vote favorite I want to Use PostgreSQl With Django . I referred this tutorial to install it and when I run this command python manage.py syncdb I get the following errors Traceback (most recent call last): File "manage.py", line 10, in
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 http://stackoverflow.com/questions/18117954/importerror-no-module-named-psycopg2-extensions this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question http://djangopackages.readthedocs.io/en/latest/troubleshooting.html x Dismiss Join the Stack Overflow 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 error no ImportError: No module named psycopg2.extensions up vote 1 down vote favorite I am trying to create an app using GeoDjango and I am completely new to this. After some (failing) attempts at making SpatiaLite work, I decided to try out PostgreSQL. I am following the GeoDjango tutorial, and I am stuck at the python manage.py sqlall world line. When I ran that command (or error no module python manage.py syncdb), I got ImportError: No module named psycopg2.extensions. I looked online and realized I needed to install psycopg2, which I did via MacPorts with sudo port install py27-psycopg2. I reran the program and got the same error. I restarted my computer and ran the program again, and still got the same error. Does anyone know anything else that might have caused this? Thanks! PS. If anyone cared to know, I was stuck at the same command while testing out SpatiaLite. I consistently received the 'DatabaseOperations' object has no attribute 'geo_db_type'error. I looked around the internet, didn't find any answer and decided to move on for the time being and maybe try again later. PSS. I am working on Mac OS X 10.7.5 python django macports psycopg2 spatialite share|improve this question edited Nov 7 '13 at 10:08 Chris Travers 12.8k424107 asked Aug 8 '13 at 4:32 essicajayc 1316 2 Apple systems often land up with many different installs of common tools like Python. At a guess I'd say the Python being used by Django is not the one from Homebrew that you installed psycopg2 for. –
not found Other problems FAQ Settings Testing Instructions Management Commands PyPI Issues Team Contributing Repo Handlers Webservice APIv3 Lessons Learned PostgreSQL setup instructions for new contributors Django Packages Docs » Troubleshooting Edit on GitHub Troubleshooting¶ How come no module named abc?¶ If you're getting something like "ImportError: No module named abc", you probably don't have all the required packages installed. Try: pip install -r requirements/project.txt No module named psycopg2¶ If you're getting something like "ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2" while accessing the website, you need to install the psycopg2 module. It has recently been added to requirements/project.txt (the line that says "psycopg2==2.4"). Try: pip install -r requirements/project.txt If you're getting an error like "Error: pg_config executable not found." while installing the module, you need the PostgreSQL development package. On Ubuntu, do: sudo apt-get install libpq-dev I can't get it to work in buildout!¶ We don't support buildout. See the faq. bz2 not found¶ Install the appropriate systemwide package. For example, on Ubuntu do: sudo apt-get install libbz2-dev If this doesn't work, please let us know (create an issue at http://github.com/opencomparison/opencomparison/issues) fatal error: ‘libmemcached/memcached.h' file not found¶ if you are getting something like ./_pylibmcmodule.h:42:10: fatal error: ‘libmemcached/memcached.h' file not found. Then you need to install libmemcached: brew install libmemcached Other problems¶ Don't give up! Submit problems to http://github.com/opencomparison/opencomparison/issues. And don't forget: Be polite! We are all volunteers. Spend the time to learn Github markup Next Previous © Copyright 2010-2016, Audrey Roy Greenfeld, Daniel Roy Greenfeld and contributors. Revision c04c4d58. Built with Sphinx using a theme provided by Read the Docs. Read the Docs v: latest Versions latest Downloads pdf htmlzip epub On Read the Docs