omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Error when running pip install psycopg2

    Pythonista
    3
    6
    4325
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stef728384
      stef728384 last edited by

      Hi, I am trying to install psycopg2 but get the following error.
      Any ideas?
      Thanks
      Stef
      [~/Documents]$ pip install psycopg2
      Querying PyPI ...
      Downloading package ...
      Opening: https://pypi.python.org/packages/7b/a8/dc2d50a6f37c157459cd18bab381c8e6134b9381b50fbe969997b2ae7dbc/psycopg2-2.6.2.tar.gz
      Save as: /private/var/mobile/Containers/Data/Application/96C663CC-44E0-4415-B60D-C6C5E8888A33/tmp/psycopg2-2.6.2.tar.gz (376348 bytes)
      376348 [100.00%]
      Extracting archive file ...
      Archive extracted.
      Running setup file ...
      ImportError('No module named lib2to3.refactor',)
      Failed to run setup.py
      Fall back to directory guessing ...
      Error: Cannot locate packages. Manual installation required.

      1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by

        The psycopg2 library includes a lot of C code. It is not possible to install C-based modules in Pythonista - there is no real C compiler for iOS, and Apple does not allow apps to execute native code (C, C++, Fortran, Assembly, etc.) that isn't included with the app. This means that you can't use psycopg2 in Pythonista, sorry.

        1 Reply Last reply Reply Quote 0
        • stef728384
          stef728384 last edited by

          Ah thank you for your reply.
          Do you know if there is another way to connect to a postgres server?

          1 Reply Last reply Reply Quote 0
          • ihf
            ihf last edited by

            Does pg8000 work?

            1 Reply Last reply Reply Quote 0
            • dgelessus
              dgelessus last edited by

              https://pypi.python.org/pypi/pg8000 says that it's pure Python, and it has no dependencies other than six (which is included with Pythonista). That sounds like it could work on Pythonista.

              1 Reply Last reply Reply Quote 0
              • stef728384
                stef728384 last edited by

                Module pg8000 works indeed! Thanks guys!

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB Forums | Contributors