1

First of all, the context of this question is: Cannot install psycopg2 on OSX 10.6.7 with XCode4

So I am trying to execute the following:

$PATH=$PATH:/Library/PostgreSQL/9.1/bin sudo env ARCHFLAGS="-arch i386 -arch x86_64" pip install psycopg2

however, I get the following:

/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin=/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin:/Library/PostgreSQL/9.1/bin: No such file or directory

Basically, I need to add '/Library/PostgreSQL/9.1/bin' to $PATH, so that the rest of the command can be executed as it needs something from that directory.

Any suggestion?

Community
  • 1
  • 1
skyork
  • 7,113
  • 18
  • 63
  • 103

4 Answers4

1

Variables being assigned to shouldn't have a $.

PATH=...
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
1

try:

export PATH=$PATH:/Library/PostgreSQL/9.1/bin sudo env ARCHFLAGS="-arch i386 -arch x86_64" pip install psycopg2
avasal
  • 14,350
  • 4
  • 31
  • 47
1

Issue this commnad:

export PATH=$PATH:/Library/PostgreSQL/9.1/bin sudo env ARCHFLAGS="-arch i386 -arch x86_64" pip install psycopg2
pylover
  • 7,670
  • 8
  • 51
  • 73
0

Yep, remove the $ as already mentioned. You might also need the -E option to sudo, or to change the env_reset setting in sudoers. You also can specify environment variables after sudo.

sudo -E PATH="..." ARCH="..." pip install whatever
rob
  • 2,053
  • 15
  • 13