Error when running pip install psycopg2
Hi, I am trying to install psycopg2 but get the following error.
[~/Documents]$ pip install psycopg2
Querying PyPI ...
Downloading package ...
Save as: /private/var/mobile/Containers/Data/Application/96C663CC-44E0-4415-B60D-C6C5E8888A33/tmp/psycopg2-2.6.2.tar.gz (376348 bytes)
Extracting archive file ...
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.
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.
Ah thank you for your reply.
Do you know if there is another way to connect to a postgres server?
Does pg8000 work?
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.
Module pg8000 works indeed! Thanks guys!