- Libpq dev mac os
- libpq-dev 9.0.0
- Navigation
- Project links
- Statistics
- Maintainers
- Project description
- Install libpq-dev on Mac OS?
- 4 Answers 4
- Not the answer you’re looking for? Browse other questions tagged mac postgresql or ask your own question.
- Related
- Hot Network Questions
- Subscribe to RSS
- Install libpq-dev on Mac OS X
- Related Posts
- Logical or of Django many to many queries returns duplicate results
- Django model field choices – wouldn’t a dict be better?
- Django: Order a model by a many-to-many field
- Libpq dev mac os
Libpq dev mac os
The libpq-dev library is built following Debian’s libpq-dev package idea: it contains a minimal set of PostgreSQL binaries and headers required for building 3rd-party applications for PostgreSQL.
Moreover this package provides even smaller subset of binaries than Debian’s libpq-dev package and was designed this way on purpose. The main goal is to provide all requirements for building Psycopg2.
This package is meant to be built as platform-specific binary Python wheels, contains only PostgreSQL binaries and 0 Python code.
The Psycopg2 library is built as a wrapper around libpq and mostly written in C. It is distributed as an sdist and being built during installation. For this reason it requires some PostgreSQL binaries and headers to be present during installation.
For simple environments where database server and application server combine the same host it is not an issue but it might be a different case for distributed systems. This leads to the need to install some of PostgreSQL binaries on the application server as well.
On top of that there might be a situation when single application server needs to host several applications that use different versions of PostgreSQL and thus Psycopg2 needs to be built against different versions of libpq .
The package contains:
- pg_config
- libpq.a (static build of libpq )
- a number of additional headers
For full list of files please take a look into setup.cfg/[files]/data_files .
Once more, 0 Python sources or any other stuff.
The usage is pretty simple and straight forward: install libpq-dev of required version (the same version as your PostgreSQL version) before installing Psycopg2.
Please note that Psycopg2 prefers static linking against libpq so if you distributing your application and all its dependencies with wheels or something like Platter then you don’t need need to ship libpq-dev as long as you have Psycopg2 wheel built with it.
Limitation and Known Issues
Currently libpq-dev is being built only for Linux with Python 2.7, 3.3, 3.4 from PostgreSQL 9.* sources.
If there will be demand for other platforms, Python versions or older PostgreSQL versions new builds will be added.
Also please note that there is known issue with PIP and some Python packages (including Psycopg2) that doesn’t allow you to do:
or put these names into requirements.txt and then run pip install -r requirements.txt . This is because Psycopg2 requires pg_config and other PostgreSQL binaries to be present in order to run egg_info command (which is executed by PIP during normal installation process).
Unfortunately there is nothing we can do about it right now but we hope that either this will be handled somehow in future PIP releases or fixed in Psycopg2.
We assume that there might be demand in builds for additional platforms or Python versions.
Also there may be other Python libraries that may be used with this package. In case this package is missing some binaries requried by libraries other that `Pscyopg2`_ they will be added.
Источник
libpq-dev 9.0.0
Released: Jun 12, 2015
Psycopg2 binary dependencies
Navigation
Project links
Statistics
View statistics for this project via Libraries.io, or by using our public dataset on Google BigQuery
License: NCBI license
Author: NCBI
Maintainers
Project description
The «libpq-dev« library is built following `Debian’s libpq-dev package`_
idea: it contains a minimal set of `PostgreSQL`_ binaries and headers requried
for building 3rd-party applications for `PostgreSQL`_.
Moreover this package provides even smaller subset of binaries than
`Debian’s libpq-dev package`_ and was desgined this way on purpose. The main
goal is to provide all requirements for building `Psycopg2`_.
This package is meant to be built as `platform-specific`_ binary
`Python wheels`_, contains only PostgreSQL binaries and 0 Python code.
Rationale
———
The `Psycopg2`_ library is built as a wrapper around «libpq« and mostly
written in C. It is distributed as an «sdist« and being built during
installation. For this reason it requries some `PostgreSQL`_ binaries and
headers to be present during isntallation.
For simple environments where database server and application server combine
the same host it is not an issue but it might be a different case for
distributed systems. This leads to the need to install some of `PostgreSQL`_
binaries on the application server as well.
On top of that there might be a situation when single application server needs
to host several applications that use different versions of `PostgreSQL`_ and
thus `Psycopg2`_ needs to be `built against different versions`_ of «libpq«.
The package contains:
— **pg_config**
— **libpq.a** (static build of «libpq«)
— a number of additional headers
For full list of files please take a look into «setup.cfg/[files]/data_files«.
Once more, 0 Python sources or any other stuff.
The usage is pretty simple and straight forward: install «libpq-dev« of
requried version (the same version as your PostgreSQL version) before
installing `Psycopg2`_.
$ pip install libpq-dev==9.4.3
$ pip install psycopg2
Please note that `Psycopg2`_ prefers static linking against «libpq« so if you
distributing your application and all its dependencies with wheels or something
like `Platter`_ then you don’t need need to ship «libpq-dev« as long as you
have `Psycopg2`_ wheel built with it.
Currently «libpq-dev« is being built only for «Linux« with
«Python 2.7, 3.3, 3.4« from `PostgreSQL 9.*` sources.
If there will be demand for other platforms, Python versions or older
PostgreSQL versions new builds will be added.
Also please note that there is `known issue with PIP`_ and some Python packages
(including `Psycopg2`_) that doesn’t allow you to do:
$ pip install libpq-dev==9.4.3 psycopg2
or put these names into `requirements.txt` and then run «pip install -r
requirements.txt«. This is because `Psycopg2`_ requries «pg_config« and
other PostgreSQL binaries to be present in order to run «egg_info« command
(which is executed by `PIP` during normal installation process).
Unfortunately there is nothing we can do about it right now but we hope that
either this will be handled somehow in future `PIP` releases or fixed in
`Psycopg2`_.
We assume that there might be demand in builds for additional platforms or
Python versions.
Also there may be other Python libraries that may be used with this package.
In case this package is missing some binaries requried by libraries other that
`Pscyopg2`_ they will be added.
Источник
Install libpq-dev on Mac OS?
Does anyone know how I can install libpq-dev on Mac OS 10.6? It’s a pre-requisite for something else I want to install.
There doesn’t seem to be a macport for it, so how can I install it on a Mac?
4 Answers 4
Consider using Homebrew
It’ll give you the necessary headers.
You can install libpq (dev files are included) alone using homebrew.
The include files and libs are then available in the following folders:
When I’ve search in ports I’ve found this:
You can try one of those.
Using macports, this worked for me:
I believe this installs all the postgres client tools and libs, while macports has a separate port for installing the server, i.e. postgresql96-server .
Not the answer you’re looking for? Browse other questions tagged mac postgresql or ask your own question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Источник
Install libpq-dev on Mac OS X
Posted by: admin December 19, 2017 Leave a comment
I’m trying to run Django with a Postgresql backend on my local Mac OS X. I’ve installed Django using pip:
I’ve installed Postgresql with one of the binary installers here.
But when I try to install psycopg2 I get an error (pasted below) that it can’t find pg_config.
From this question it seems like I should install libpq-dev but I’m not sure how.
I’ve tried installing libpqxx with MacPorts, but that hasn’t done anything.
How do I get libpg-dev installed? Or is there something else I’m missing?
So I ended up following the advice here:
Turns out I did have pg-config installed, but I had to dig around to find it a bit. Once I included that in the path, everything worked swimmingly. Here’s the snippet from that link:
I used pip instead of easy_install and my PostgreSQL installation directory was slightly different, but that’s the gist.
For OSX 10.9.2 Mavericks, this is what worked for me. Try installing postgres with brew first:
Then install pg
Just install postgres from source. I’m doing that on Mac OS X. It’s as easy as:
Of course you may need extra steps like autostarting, or setting configure options, but I belive this is still most painless way of setting up on Mac OS X.
And if you for some reason want to avoid installing from source, you should look for a binary version of psycopg2, e.g. here: http://www.initd.org/psycopg/download/
In postgress.app on mavericks the file pg_config is in /Applications/Postgres.app/Contents/MacOS/bin/ so i fixed the problem in this way:
Related Posts
Logical or of Django many to many queries returns duplicate results
Questions: I have models with many to many relationships like this: class Contact(models.Model): name = models.TextField() address = models.TextField() class Mail(models.Model): to = models.ManyToMany.
Django model field choices – wouldn’t a dict be better?
Questions: Given a field; domain_status_choices = ( (1,’Live’) (2,’Offline’) (3,’Dev’) ) status = models.SmallIntegerField( choices=domain_status_choices ) I know I can get and set numeric representat.
Django: Order a model by a many-to-many field
Questions: I am writing a Django application that has a model for People, and I have hit a snag. I am assigning Role objects to people using a Many-To-Many relationship – where Roles have a name.
Источник
Libpq dev mac os
I’m trying to run Django with a Postgresql backend on my local Mac OS X. I’ve installed Django using pip:
I’ve installed Postgresql with one of the binary installers here.
But when I try to install psycopg2 I get an error (pasted below) that it can’t find pg_config.
From this question it seems like I should install libpq-dev but I’m not sure how.
I’ve tried installing libpqxx with MacPorts, but that hasn’t done anything.
How do I get libpg-dev installed? Or is there something else I’m missing?
For OSX 10.9.2 Mavericks, this is what worked for me. Try installing postgres with brew first:
Then install pg
Install libpq-dev on Mac OS X, For OSX 10.9.2 Mavericks, this is what worked for me. Try installing postgres with brew first: brew install postgresql. Then install pg gem installпїЅ Install libpq-dev on Mac OS X. django postgresql psycopg2 python. Question. I’m trying to run Django with a Postgresql backend on my local Mac OS X. I’ve installed
So I ended up following the advice here:
Turns out I did have pg-config installed, but I had to dig around to find it a bit. Once I included that in the path, everything worked swimmingly. Here’s the snippet from that link:
I used pip instead of easy_install and my PostgreSQL installation directory was slightly different, but that’s the gist.
Install libpq-dev on Mac OS X, For OSX 10.9.2 Mavericks, this is what worked for me. Try installing postgres with brew first: brew install postgresql. Then install pg gem installпїЅ mac OS packages . PostgreSQL is the default database on macOS Server as of OS X Server version 10.7. macOS without the macOS Server add-on installed includes only the PostgreSQL libpq shared library. macOS Server 10.12 ships with PostgreSQL 9.4. Minor updates are provided by Apple, but not necessarily right after a new PostgreSQL minor release.
Just install postgres from source. I’m doing that on Mac OS X. It’s as easy as:
Of course you may need extra steps like autostarting, or setting configure options, but I belive this is still most painless way of setting up on Mac OS X.
And if you for some reason want to avoid installing from source, you should look for a binary version of psycopg2, e.g. here: http://www.initd.org/psycopg/download/
python Install libpq dev on Mac OS X?, brew install postgresql brew link postgresql@9.4 —force gem install pg pg_config. For OSX 10.9.2 Mavericks, this is what worked for me. Try installing postgresпїЅ Install libpq-dev on Mac OS? [closed] Ask Question Asked 9 years, 2 months ago. Active 7 years ago. Viewed 5k times -1. Closed. This question is
In postgress.app on mavericks the file pg_config is in /Applications/Postgres.app/Contents/MacOS/bin/ so i fixed the problem in this way:
Install libpq-dev on Mac OS?, (This is all done on my MacBook Pro even though the hostname may look like a normal linux box). First, install homebrew: [ 11:45пїЅ On Mac OS X run like this: gem install pg — —with-pg-config=***/path/to/pg_config*** ***/path/to/pg_config*** is path to pg_config On Ubuntu, install the «libpq-dev» to get rid of this issue.
Select Install macOS (or Install OS X) from the Utilities window, then click Continue and follow the onscreen instructions. Learn more For more information about the createinstallmedia command and the arguments that you can use with it, make sure that the macOS installer is in your Applications folder, then enter this path in Terminal:
macOS Recovery makes it easy to reinstall the Mac operating system, even if you need to erase your startup disk first. All you need is a connection to the Internet. If a wireless network is available, you can choose it from the Wi-Fi menu , which is also available in macOS Recovery.
Источник