Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77347 > unrolled thread

Psycopg2 package installation puzzle in Pycharm - any thoughts?

Started byandydtaylor@gmail.com
First post2014-08-31 07:19 -0700
Last post2014-09-01 16:13 -0700
Articles 15 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  Psycopg2 package installation puzzle in Pycharm - any thoughts? andydtaylor@gmail.com - 2014-08-31 07:19 -0700
    Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? andydtaylor@gmail.com - 2014-08-31 07:21 -0700
    Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2014-08-31 16:39 +0200
    Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? Andrea D'Amore <anddamNOALPASTICCIODICARNE+gruppi@brapi.net> - 2014-08-31 18:33 +0200
      Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? andydtaylor@gmail.com - 2014-08-31 16:34 -0700
      Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? andydtaylor@gmail.com - 2014-08-31 16:35 -0700
        Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? andydtaylor@gmail.com - 2014-08-31 16:57 -0700
          Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? andydtaylor@gmail.com - 2014-08-31 17:20 -0700
          Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-01 01:53 +0100
        Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? Andrea D'Amore <anddamNOALPASTICCIODICARNE+gruppi@brapi.net> - 2014-09-01 09:07 +0200
          Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? andydtaylor@gmail.com - 2014-09-01 05:32 -0700
            Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? Andrea D'Amore <anddamNOALPASTICCIODICARNE+gruppi@brapi.net> - 2014-09-01 15:13 +0200
            Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? Chris Angelico <rosuav@gmail.com> - 2014-09-01 23:16 +1000
            Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-01 14:31 +0100
              Re: Psycopg2 package installation puzzle in Pycharm - any thoughts? andydtaylor@gmail.com - 2014-09-01 16:13 -0700

#77347 — Psycopg2 package installation puzzle in Pycharm - any thoughts?

Fromandydtaylor@gmail.com
Date2014-08-31 07:19 -0700
SubjectPsycopg2 package installation puzzle in Pycharm - any thoughts?
Message-ID<fe77f4c0-d45d-4baf-bd60-b8398c2bc0bb@googlegroups.com>
Hi,

I have a puzzle, for which I would appreciate your opinion on!

I have been trying to setup a project in Pycharm with psycopg2.

If I install it using pip install it is added. However  if I use the Pycharm "preferences>project interpreter>add package" option it fails with the below message. 


Please add the directory containing pg_config to the PATH

or specify the full executable path with the option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/79/wxtpjs7x3wx_v01fz8h5y8pw0000gp/T/pycharm-packaging4753300326598484086.tmp/psycopg2
Storing debug log for failure in /Users/admin/.pip/pip.log

in .bash_profile I have the following:

export PATH=$PATH:/usr/local/share/python
export PATH=$PATH:/usr/local/bin
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
export PYTHONPATH=$PYTHONPATH:/usr/local/bin/python

export WORKON_HOME=$HOME/.Virtualenvs
export PROJECT_HOME=$HOME/Projects
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
# source /usr/local/share/python/virtualenvwrapper.sh

alias showhidden='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder'
alias hidehidden='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder


Notes
-Mac OS
-Python and Postgres installed using brew
-Django project
- Installing to a virtualenv python environment.

Let me know if you have an idea how I can fix this!

Thanks,

Andy

[toc] | [next] | [standalone]


#77349

Fromandydtaylor@gmail.com
Date2014-08-31 07:21 -0700
Message-ID<438fbd2c-f8ee-4b5c-827d-c3e09c98f7cf@googlegroups.com>
In reply to#77347
Actually I realise that postgres app didn't come from brew.... I wonder if that's the issue

On Sunday, 31 August 2014 15:19:24 UTC+1, andyd...@gmail.com  wrote:
> Hi,
> 
> 
> 
> I have a puzzle, for which I would appreciate your opinion on!
> 
> 
> 
> I have been trying to setup a project in Pycharm with psycopg2.
> 
> 
> 
> If I install it using pip install it is added. However  if I use the Pycharm "preferences>project interpreter>add package" option it fails with the below message. 
> 
> 
> 
> 
> 
> Please add the directory containing pg_config to the PATH
> 
> 
> 
> or specify the full executable path with the option:
> 
> 
> 
>     python setup.py build_ext --pg-config /path/to/pg_config build ...
> 
> 
> 
> or with the pg_config option in 'setup.cfg'.
> 
> 
> 
> ----------------------------------------
> 
> Cleaning up...
> 
> Command python setup.py egg_info failed with error code 1 in /private/var/folders/79/wxtpjs7x3wx_v01fz8h5y8pw0000gp/T/pycharm-packaging4753300326598484086.tmp/psycopg2
> 
> Storing debug log for failure in /Users/admin/.pip/pip.log
> 
> 
> 
> in .bash_profile I have the following:
> 
> 
> 
> export PATH=$PATH:/usr/local/share/python
> 
> export PATH=$PATH:/usr/local/bin
> 
> export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
> 
> export PYTHONPATH=$PYTHONPATH:/usr/local/bin/python
> 
> 
> 
> export WORKON_HOME=$HOME/.Virtualenvs
> 
> export PROJECT_HOME=$HOME/Projects
> 
> export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
> 
> export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
> 
> source /usr/local/bin/virtualenvwrapper.sh
> 
> # source /usr/local/share/python/virtualenvwrapper.sh
> 
> 
> 
> alias showhidden='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder'
> 
> alias hidehidden='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder
> 
> 
> 
> 
> 
> Notes
> 
> -Mac OS
> 
> -Python and Postgres installed using brew
> 
> -Django project
> 
> - Installing to a virtualenv python environment.
> 
> 
> 
> Let me know if you have an idea how I can fix this!
> 
> 
> 
> Thanks,
> 
> 
> 
> Andy

[toc] | [prev] | [next] | [standalone]


#77350

FromChris “Kwpolska” Warrick <kwpolska@gmail.com>
Date2014-08-31 16:39 +0200
Message-ID<mailman.13661.1409495962.18130.python-list@python.org>
In reply to#77347
On Sun, Aug 31, 2014 at 4:19 PM,  <andydtaylor@gmail.com> wrote:
> Hi,
>
> I have a puzzle, for which I would appreciate your opinion on!

That’s not much of a puzzle (a game, toy, or problem designed to test
ingenuity or knowledge, as defined by Oxford American College
Dictionary via http://google.com/search?q=define+puzzle ).  That’s a
problem.

> I have been trying to setup a project in Pycharm with psycopg2.
>
> If I install it using pip install it is added. However  if I use the Pycharm "preferences>project interpreter>add package" option it fails with the below message.

[snip]

> export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config

$PATH contains paths to directories, not binaries.  Change that line to:

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin

If that is not enough to make pycharm do it, you may try to install
from the Terminal:

cd /path/to/your/virtualenv
bin/pip install psycopg2

-- 
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense

[toc] | [prev] | [next] | [standalone]


#77351

FromAndrea D'Amore <anddamNOALPASTICCIODICARNE+gruppi@brapi.net>
Date2014-08-31 18:33 +0200
Message-ID<ltvio4$q51$1@virtdiesel.mng.cu.mi.it>
In reply to#77347
On 2014-08-31 14:19:24 +0000, andydtaylor@gmail.com said:

> - Installing to a virtualenv python environment.

Are you using the virtualenv interpreter as the Pycharm project interpreter?


-- 
Andrea

[toc] | [prev] | [next] | [standalone]


#77371

Fromandydtaylor@gmail.com
Date2014-08-31 16:34 -0700
Message-ID<4e4cd62e-7faf-44f7-9ea4-c7e23c8ef67f@googlegroups.com>
In reply to#77351
Chris-

I have removed the second copy of postgres I had (postgres.app) and updated path variables in .bash_profile:

export PATH=$PATH:/usr/local/share/python
export PATH=$PATH:/usr/local/bin
export PYTHONPATH=$PYTHONPATH:/usr/local/bin/python
export PATH=$PATH:/usr/local/Cellar/postgresql/9.3.5_1/bin

I don't think I should need the last line because /usr/local/bin/pg_config exists as an alias for /usr/local/Cellar/postgresql/9.3.5_1/bin/pgconfig - do you think I am right?

I have read that window apps may be unable to pick up environment variables. hence I added the below to the end of my .bash_profile

launchctl setenv PATH $PATH

But still Pycharm wasn't having it.  So I have created /etc/launchd.conf and put this in it:

launchctl setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/python:/usr/local/bin

Now I am out of ideas..... It's quite maddening!

Any advice appreciated.

Thanks,

Andy




[toc] | [prev] | [next] | [standalone]


#77372

Fromandydtaylor@gmail.com
Date2014-08-31 16:35 -0700
Message-ID<f5fee21f-3e49-4966-b81c-75b847303a65@googlegroups.com>
In reply to#77351
Chris- 

I have removed the second copy of postgres I had (postgres.app) and updated path variables in .bash_profile: 

export PATH=$PATH:/usr/local/share/python 
export PATH=$PATH:/usr/local/bin 
export PYTHONPATH=$PYTHONPATH:/usr/local/bin/python 
export PATH=$PATH:/usr/local/Cellar/postgresql/9.3.5_1/bin 

I don't think I should need the last line because /usr/local/bin/pg_config exists as an alias for /usr/local/Cellar/postgresql/9.3.5_1/bin/pgconfig - do you think I am right? 

I have read that window apps may be unable to pick up environment variables. hence I added the below to the end of my .bash_profile 

launchctl setenv PATH $PATH 

But still Pycharm wasn't having it.  So I have created /etc/launchd.conf and put this in it: 

launchctl setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/python:/usr/local/bin 

Andrea - yes I am using the virtualenv interpreter as the Pycharm project interpreter

Now I am out of ideas..... It's quite maddening! 

Any advice appreciated. 

Thanks, 

Andy 

[toc] | [prev] | [next] | [standalone]


#77373

Fromandydtaylor@gmail.com
Date2014-08-31 16:57 -0700
Message-ID<f39a3e1d-fb54-425b-9ba5-ccc19582bbc4@googlegroups.com>
In reply to#77372
FYI My mac version is Mavericks 10.9.4

[toc] | [prev] | [next] | [standalone]


#77376

Fromandydtaylor@gmail.com
Date2014-08-31 17:20 -0700
Message-ID<440eccc3-b837-4f97-8967-652a5899ff55@googlegroups.com>
In reply to#77373
I have gone ahead and set it all up by using pip install psycopg2 but I would still like to determine why Pycharm couldn't find the $PATH variable

[toc] | [prev] | [next] | [standalone]


#77380

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-09-01 01:53 +0100
Message-ID<mailman.13673.1409532831.18130.python-list@python.org>
In reply to#77373
On 01/09/2014 00:57, andydtaylor@gmail.com wrote:
> FYI My mac version is Mavericks 10.9.4
>

Please equip yourself with a tool that provides us with some context. 
There's not much that we can make out of the one line you give above.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#77398

FromAndrea D'Amore <anddamNOALPASTICCIODICARNE+gruppi@brapi.net>
Date2014-09-01 09:07 +0200
Message-ID<lu15um$ot7$1@virtdiesel.mng.cu.mi.it>
In reply to#77372
You make hard to follow your messages both by sending lot of messages 
and not using an adequate quoting.
Please pick a posting style [1] (possibly interleaved) and stick to it.

On 2014-08-31 23:35:09 +0000, andydtaylor@gmail.com said:
> Andrea - yes I am using the virtualenv interpreter as the Pycharm 
> project interpreter

That statement needs to be backed by some proof, saying "I'm using such 
interpreter" doesn't necessarily mean it's true, print out 
sys.executable and check.

I confirm I just downloaded PyCharm CE 3.4.1 (you didn't provide your 
PyCharm version), set up a virtualenv, created an empty project using 
the interpreter from that environment and was able to run the file with 
the import statement in PyCharm, so the IDE works as expected.
It was actually quite straightforward and PyCharm also offered to 
create the virtualenv while selecting the interpreter.

I suggest to stop messing with your environment (I would revert all 
those changes) and figure what the problem actually is.


[1] http://en.wikipedia.org/wiki/Posting_style
-- 
Andrea

[toc] | [prev] | [next] | [standalone]


#77402

Fromandydtaylor@gmail.com
Date2014-09-01 05:32 -0700
Message-ID<b3ab199c-6b3f-438b-ad8a-67af8d90daa7@googlegroups.com>
In reply to#77398
Posting style point taken. Google groups doesn't exactly help you with that.

* You guys have probably been tinkering with this stuff for years. I haven't.  
* Your man on the street would say I described the error fairly well. 
* It's not like I wasn't trying my best to fix it myself
* So far as environment tinkering is concerned I have entered a "launchctl setenv PATH" statement in two places. Both reversible.
* I think what I have is an issue pertaining to OSX Mavericks and Pycharm. If you have nothing to add, just say it. 
* Statements like "Please equip yourself with a tool that provides us with some context" add nothing and are not exactly community inclusive.

[toc] | [prev] | [next] | [standalone]


#77403

FromAndrea D'Amore <anddamNOALPASTICCIODICARNE+gruppi@brapi.net>
Date2014-09-01 15:13 +0200
Message-ID<lu1rda$bo1$1@virtdiesel.mng.cu.mi.it>
In reply to#77402
On 2014-09-01 12:32:38 +0000, andydtaylor@gmail.com said:

> Google groups doesn't exactly help you with that.

Drop it, get a usenet client or subscribe the mailing list (the 
newsgroup and the ml are bridged IIRC).

> * Your man on the street would say I described the error fairly well.

That man probably doesn't try to solve other people's issues.

> * So far as environment tinkering is concerned I have entered a 
> "launchctl setenv PATH" statement in two places. Both reversible.

That will affect your session environment (that is separated from your 
terminal environment), but since PyCharm doesn't pick a Python 
interpreter from PATH but rather let the user explicitly select one 
you're more intersted in just selecting a correct interpreter.

> * I think what I have is an issue pertaining to OSX Mavericks and 
> Pycharm. If you have nothing to add, just say it.

I forgot to mention it but I'm on Mavericks and downloaded the latest 
PyCharm just to check you issue, I never used it and just followed the 
new project wizard that asked me to select a python interpeter or to 
create a virtualenv.

> * Statements like "Please equip yourself with a tool that provides us 
> with some context" add nothing and are not exactly community inclusive.

Still you took the time to write the message I'm replying to, that 
won't help you much, rather than running
"""
import sys
print(sys.executable)
"""
in your project, that would provide more information about your issue.

-- 
Andrea

[toc] | [prev] | [next] | [standalone]


#77404

FromChris Angelico <rosuav@gmail.com>
Date2014-09-01 23:16 +1000
Message-ID<mailman.13690.1409577389.18130.python-list@python.org>
In reply to#77402
On Mon, Sep 1, 2014 at 10:32 PM,  <andydtaylor@gmail.com> wrote:
> Posting style point taken. Google groups doesn't exactly help you with that.
>
> * You guys have probably been tinkering with this stuff for years. I haven't.
> * Your man on the street would say I described the error fairly well.
> * It's not like I wasn't trying my best to fix it myself
> * So far as environment tinkering is concerned I have entered a "launchctl setenv PATH" statement in two places. Both reversible.
> * I think what I have is an issue pertaining to OSX Mavericks and Pycharm. If you have nothing to add, just say it.
> * Statements like "Please equip yourself with a tool that provides us with some context" add nothing and are not exactly community inclusive.

Part of the point is that Google Groups is quite unhelpful in these
areas. There are alternatives - you can get a newsreader, or you can
join the mailing list. (I do the latter, and Gmail works fairly well.)

Sometimes, the community is best served by telling people about flawed
tools. It's more courteous than saying "You didn't quote any text, and
that's making it really hard for us to follow" and blaming you
personally for it :) But the fact is that it *does* make things harder
for other people, and the onus is on you to follow the conventions of
courtesy. That's why people are asking you to change software -
because good software makes it easy to be courteous.

ChrisA

[toc] | [prev] | [next] | [standalone]


#77405

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-09-01 14:31 +0100
Message-ID<mailman.13691.1409578333.18130.python-list@python.org>
In reply to#77402
On 01/09/2014 13:32, andydtaylor@gmail.com wrote:
> Posting style point taken. Google groups doesn't exactly help you with that.
>

Thunderbird is as good a solution as any although there are plenty of 
other choices.

> * Statements like "Please equip yourself with a tool that provides us with some context" add nothing and are not exactly community inclusive.
>

So you promptly send another message and still no context, what do you 
think we are, mind readers?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#77419

Fromandydtaylor@gmail.com
Date2014-09-01 16:13 -0700
Message-ID<cec17739-c8da-456a-bb25-34166847834a@googlegroups.com>
In reply to#77405
Mark - it's more that I just didn't understand what you mean. 

Here's you: Probably an out and out programmer; uses a number of languages; a decade of experience, educated in best practice via your experience.

Here's me: Idiot. A decade of experience in VBA and Excel in mindless finance jobs, hoping to build a 'not shit" website for a refrigerated van courier company I am starting.  I know enough to find my way around linux and mac for most things and that Python and Django are a great tool, yet I stumble in my environment setup. I have built a Django website before using Pycharm on an Ubuntu machine without this problem.

So I wasn't seeking to be abrasive, it's just that I don't get it, nor do I understand the boundary of "it".

Here's what I can do:

1. I will lookup Thunderbird and see if this makes posting easier to follow
2. I will reverse my launchctl setenv changes.
3. Is there anything else I can do to improve diagnosis and communication?

Andy

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web