3

I'm on an Ubuntu 12.04 system and I need to use python3 and pip3. Turns out I shouldn't have installed pip3 with easy_install3, because pip now points to pip3 from pip -V. I have tried reinstalling both python and python-pip, but it hasn't fixed anything. How can I get the box back to the way it was? Thanks

2
  • What is the output of sudo update-alternatives --config pip?
    – jobin
    Jun 23, 2014 at 16:37
  • There are no alternatives is what I get. I then went through all of them, and there is nothing in reference to pip anywhere, at least from options that have more than one alternative. Jun 23, 2014 at 16:42

1 Answer 1

1

/usr/bin/pip* are just python scripts.

  1. Copy pip2

    sudo cp /usr/bin/pip2 /usr/bin/pip
    
  2. Edit the new /usr/bin/pip and change 'pip2' to 'pip':

    sudo nano /usr/bin/pip

    This is a copy from Ubuntu 14.04:

    #! /usr/bin/python
    # EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.5.4','console_scripts','pip'
    __requires__ = 'pip==1.5.4'
    import sys
    from pkg_resources import load_entry_point
    
    if __name__ == '__main__':
        sys.exit(
            load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
        )
    

Well, /usr/bin/pip2 isn't in place. Purge then reinstall it:

sudo apt-get remove --purge python-pip
sudo apt-get install python-pip

To check installed files:

dpkg -L python-pip
2
  • I probably should have mentioned I don't have a pip2 in /usr/bin, I did try looking for it before. It's also not in my pip tab complete options. In those I have pip (which is for python 3.2), pip3, pip3.2, and pip3.4 which I put in there after compiling python 3.4 from source into opt. I don't even know where to find the original pip to try linking it. Jun 23, 2014 at 20:18
  • @jacobcase94, I've updated the answer
    – user.dz
    Jun 23, 2014 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.