How to undo a Python setuptools --prefix path blunder

Discussion in 'Python' started by Kev, Nov 6, 2011.

  1. Kev

    Kev Guest

    When I installed Python's setuptools I absent mindedly tacked on a --
    prefix path I had been using on another machine:

    sh setuptools-0.6c11-py2.7.egg --prefix=/opt/python2.7.2

    Now after this blunder when I try to install pip I get the following
    error:

    [root@kkdev src]# easy_install pip
    Searching for pip
    Best match: pip 1.0.2
    Processing pip-1.0.2-py2.7.egg
    pip 1.0.2 is already the active version in easy-install.pth
    Installing pip script to /usr/bin
    error: /usr/bin/pip: No such file or directory

    What's happening is that a symbolic link is being created that points
    to the folder I specified in the --prefix path which is obviously
    wrong:

    [root@kkdev src]# ls -al /usr/bin/pip
    lrwxrwxrwx 1 root root 24 Nov 5 17:01 /usr/bin/pip -> /opt/
    python2.7.2/bin/pip

    I deleted this link and then re-ran the setuptools installer and
    specified the correct prefix (my Python install lives in /usr/lib/
    python2.7):

    sh setuptools-0.6c11-py2.7.egg --prefix=/usr

    I then re-ran easy_install pip and it looked like I'd fixed my finger
    trouble. However when I went to install virtualenv I encountered the
    same problem:

    [root@kkdev src]# pip install virtualenv

    [uninteresting installer output snipped]

    Installing virtualenv script to /usr/bin

    error: /usr/bin/virtualenv: No such file or directory

    Again the wrong path is being used to create the symbolic link to
    where virtualenv is installed:

    [root@kkdev src]# ls -al /usr/bin/virtualenv
    lrwxrwxrwx 1 root root 31 Nov 5 17:01 /usr/bin/virtualenv -> /opt/
    python2.7.2/bin/virtualenv

    (I'm running Fedora 15 32bit which has Python 2.7.1 installed out of
    the box)

    How do I fix/repair this permanently?

    Thanks
    Kevin
    Kev, Nov 6, 2011
    #1
    1. Advertising

  2. Kev

    Matej Cepl Guest

    Matej Cepl, Nov 7, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Tyler
    Replies:
    36
    Views:
    1,446
    Darryl L. Pierce
    Dec 10, 2004
  2. Chris  Chiasson
    Replies:
    6
    Views:
    603
    Richard Tobin
    Nov 14, 2006
  3. js
    Replies:
    0
    Views:
    268
  4. Yegor Yefremov
    Replies:
    0
    Views:
    297
    Yegor Yefremov
    May 7, 2012
  5. Replies:
    3
    Views:
    134
    Skip Montanaro
    Sep 19, 2013
Loading...

Share This Page