2

I have started using pythonbrew to manage different Python installs. The main reason I wanted to do this is to install third party modules without affecting my system's Python install.

Fore example I thought I would install the requests library using:

pip install requests

However this causes an error saying:

error: could not create '/usr/local/lib/python2.7/dist-packages/requests': Permission denied

Obviously I don't want to install it to the system's Python which is Python 2.7.3. I did have to install pip with my package manager and the resultant path is /usr/bin/pip.

How can I use pip to install to my pythonbrew installs? (My current pythonbrew Python version is 3.3.0) Am I missing something?

squiguy
  • 32,370
  • 6
  • 56
  • 63
  • 1
    have you run "pythonbrew switch 3.3.0" for your session before running "pip install requests"? – Jay Atkinson Feb 26 '13 at 18:17
  • @JayAtkinson Yes, I have. `python -V` prints Python 3.3.0. :) – squiguy Feb 26 '13 at 18:20
  • Normally when I use pip it's used with the pythonbrew installed version of Python. I wonder if that may be the problem or if you PYTHONBREWHOME is not setup properly. I don't normally us a pip located in /usr/bin/pip. – Jay Atkinson Feb 26 '13 at 18:28
  • @JayAtkinson I thought it came packaged with pythonbrew like you said. I thought the pip install would be my home directory somewhere. – squiguy Feb 26 '13 at 18:32
  • I have seen issues where something failed to compile in the installation of a Python Version from pythonbrew that can kill the rest of the install process and "pip" doesn't get installed in the pythonbrew python version. You may want to check your build log inside ".pythonbrew" directory. – Jay Atkinson Feb 26 '13 at 18:36
  • @JayAtkinson Nothing alarming in the log. I did a `grep -i` for pip and fail and there wasn't anything out of normal. – squiguy Feb 26 '13 at 18:43

1 Answers1

3

I found a solution. I uninstalled my Python 3.3.0 by issuing pythonbrew uninstall 3.3.0. Then I installed it again with pythonbrew install --configure="--with-zlib" 3.3.0. This allowed pip to install and thus now I can use it to install to this Python version.

Maybe somebody else can find this helpful, cheers!

squiguy
  • 32,370
  • 6
  • 56
  • 63