Giter VIP home page Giter VIP logo

Comments (15)

nickjj avatar nickjj commented on May 29, 2024

Are you using a Debian based system, if so have you installed the libpq-dev package? If you're using a Mac you will need to brew install postgresql for the header files.

from build-a-saas-app-with-flask.

Mirabis avatar Mirabis commented on May 29, 2024

Python 2.7.9 and pip 7.1.0 on Debian 3.16.0-4-amd64

from build-a-saas-app-with-flask.

nickjj avatar nickjj commented on May 29, 2024

Sorry, I edited my comment to ask for different info. Can you sudo apt-get install libpq-dev and then try running pip install?

from build-a-saas-app-with-flask.

Mirabis avatar Mirabis commented on May 29, 2024

E: Unable to locate package libqp-dev

from build-a-saas-app-with-flask.

nickjj avatar nickjj commented on May 29, 2024

Oops, libpq-dev.

from build-a-saas-app-with-flask.

Mirabis avatar Mirabis commented on May 29, 2024

hehe ;p

libpq-dev is already the newest version.

from build-a-saas-app-with-flask.

nickjj avatar nickjj commented on May 29, 2024

What happens if you just pip install psycopg2? Also can you paste the error it dumped?

from build-a-saas-app-with-flask.

Mirabis avatar Mirabis commented on May 29, 2024

Okay, will try again on fresh install

from build-a-saas-app-with-flask.

Mirabis avatar Mirabis commented on May 29, 2024

`
root@template:~# pip install psycopg2
Collecting psycopg2
Downloading psycopg2-2.6.1.tar.gz (371kB)
100% |████████████████████████████████| 372kB 613kB/s
Building wheels for collected packages: psycopg2
Running setup.py bdist_wheel for psycopg2
Complete output from command /usr/bin/python -c "import setuptools;file='/ tmp/pip-build-FVZKlH/psycopg2/setup.py';exec(compile(open(file).read().repla ce('\r\n', '\n'), file, 'exec'))" bdist_wheel -d /tmp/tmpduKOBYpip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/psycopg2
copying lib/init.py -> build/lib.linux-x86_64-2.7/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-2.7/psycopg2
copying lib/psycopg1.py -> build/lib.linux-x86_64-2.7/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-2.7/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-2.7/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-2.7/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-2.7/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-2.7/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-2.7/psycopg2
creating build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_cancel.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/init.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_module.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_lobject.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_green.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_async.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/testutils.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_bug_gc.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/testconfig.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_bugX000.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_transaction.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-2.7/psycopg2/ tests
copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-2.7/psycopg2 /tests
copying tests/test_dates.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_cursor.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_notify.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_quote.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_connection.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_types_extras.py -> build/lib.linux-x86_64-2.7/psycopg2/test s
copying tests/test_types_basic.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/dbapi20.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_copy.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/test_with.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/psycopg
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototype s -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=" 2.6.1 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x090403 -DHAVE_LO64=1 -I/usr/incl ude/python2.7 -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.4/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.7/psycopg/psycopgmodule .o -Wdeclaration-after-statement
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1


Failed building wheel for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2
Complete output from command /usr/bin/python -c "import setuptools, tokenize ;file='/tmp/pip-build-FVZKlH/psycopg2/setup.py';exec(compile(getattr(tokeniz e, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" ins tall --record /tmp/pip-RJiEJB-record/install-record.txt --single-version-externa lly-managed --compile:
running install
running build
running build_py
running build_ext
building 'psycopg2._psycopg' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototy pes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wforma t -Werror=format-security -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION ="2.6.1 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x090403 -DHAVE_LO64=1 -I/usr/in clude/python2.7 -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.4/serv er -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.7/psycopg/psycopgmodu le.o -Wdeclaration-after-statement
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip-buil d-FVZKlH/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(file_ _).read().replace('\r\n', '\n'), __file, 'exec'))" install --record /tmp/pip-R JiEJB-record/install-record.txt --single-version-externally-managed --compile" f ailed with error code 1 in /tmp/pip-build-FVZKlH/psycopg2
root@template:~#
`

Threw an error on psycopg2

from build-a-saas-app-with-flask.

nickjj avatar nickjj commented on May 29, 2024

You may want to ping the author of psycopg2 or post an issue in his repo because at this point this is beyond the scope of the saas app.

It hints that you might be missing GCC on your machine. Have you done a apt-get install build-essential?

from build-a-saas-app-with-flask.

Mirabis avatar Mirabis commented on May 29, 2024

It's a fresh vm so hmm don't think I installed build-essentials ;o will try that later

from build-a-saas-app-with-flask.

Mirabis avatar Mirabis commented on May 29, 2024

Gave it a few more tries, ended up needing:

sudo apt-get install python-setuptools python-dev build-essential python-psycopg2

(build-essential) alone was not enough

from build-a-saas-app-with-flask.

nickjj avatar nickjj commented on May 29, 2024

Ok thanks. I don't think python-psycopg2 is needed tho. We're installing it through pip.

Also would you mind providing the exact distro of Linux you're using, Debian 3.16.0-4 is probably just the kernel version.

from build-a-saas-app-with-flask.

Mirabis avatar Mirabis commented on May 29, 2024

No longer have the vm, as some ghost process spawned ;S

Debian 8 / Jessie , don't remember much more :(

from build-a-saas-app-with-flask.

nickjj avatar nickjj commented on May 29, 2024

Ok thanks, Jessie is enough information.

from build-a-saas-app-with-flask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.