cannot find easy_install after updating setuptools - python-2.7

On a AWS machine, I updated pip to version 9.0.1 with
sudo -H pip install --upgrade pip
and then updated setuptools from 12.2 to 36.2.2 doing :
pip install -U setuptools
But now I can't use easy_install anymore, it says
-bash: /usr/bin/easy_install: No such file or directory
I saw that there is only easy_install-3.4 in /usr/bin, how can I retrieve easy_install?
My problem is that I wanted to create a .egg file and apparently with the old version of setuptools it was not created correctly so when I was installing it via easy_install I couldn't import the package in Python ('no module named xxx').
I am using Python 2.7
Thanks

Related

can't upgrade pip to 9.0.1 ubuntu 16.04

I tried the following command so many times without luck:
sudo -H pip install -U pip
Here is the output:
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.1
Not uninstalling pip at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed pip-8.1.1
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
My pip is still at version 8.1.1
pip --version
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
What is going on? Why the upgrade option didn't work?
pip install installs everything into /usr/local/lib/python2.7/dist-packages/.
Your new pip is now /usr/local/bin/pip. Add /usr/local/bin before /usr/bin in your PATH and verify that the new pip is being run with pip --version.
Upd. We finally found the culprit of the problem — /usr/lib/python2.7/dist-packages/easy-install.pth contains wrong line /usr/lib/python2.7/dist-packages. Remove it.

pip command by default using python 3...how to change it to python 2?

I am using macOS Sierra 10.12 and after I upgraded my OS I can no longer install packages for python 3 using pip. Before I used to use pip for python2 and pip3 for python 3 as I have both versions of Python. But now I can no longer use pip to install libraries for python2.
Can anyone help me how can I change my default pip installer to python2? So that I can just use pip install in order to install for python 2.
For your information - when I only type python on terminal it says my default is python 2.7.
on running
which pip
I got /usr/local/bin/pip
Which meant it was pointing to pip2
To change default pip to pip3, run
sudo ln -s /usr/local/bin/pip3 /usr/local/bin/pip
install pip for Python2.7 with easy_install:
sudo easy_install-2.7 pip
now you can use pip for the same specific version of Python:
sudo pip2.7 install BeautifulSoup

pip{version} install --upgrade pip

I have multiple versions of pip and python on my CentOS. When I type pip2.7 install --upgrade pip it becomes clear that pip2.7 is trying to upgrade a different version of pip as the path to the pip it is trying to upgrade is not the same as the path yielded by which pip2.7
How do I make pip upgrade the proper pip and not the 2.6 pip?
I resolved this by upgrading pip, making my 2.6 pip utilize python 2.7 instead. For whatever reason, both pip and pip2.7 were upgraded. Then I reinstalled pip using yum package manager so it is now 2.6

Pip installation bug

So I tried to install pip using the get-pip.py file, and when I ran the file, terminal told me I already had pip installed on 2.7. However, when I try to find the version of my pip, terminal tells me pip doesn't exist and points to a version of 3.5 I have installed. Clearly my issue is that I have pip installed on v2.7 but the pip command is linked to v3.5. Any clues on how to fix?
Here's a picture of my terminal output:
To install a package in a particular version of python, use the following commands always:
For python 2.x:
sudo python -m pip install [package]
For python 3.x:
sudo python3 -m pip install [package]
This should resolve the doubt of which python version is the given package getting installed for.
Note: This is assuming you have not created aliases for the python command

installing pyobjc on mac osx 10.9

I'm trying to download pyobjc on my mac, which runs on 10.9.3. I've tried using easy_install, pip, and manual install. I have setuptools installed with Xcode 5.
When I use easy_install, pip, or manual install I get the error: AttributeError: 'module' object has no attribute '_install_lib' right before it quits, along with other errors before this. For easy_install I type the following line in the terminal:
easy_install -U pyobjc
and for pip I use:
pip -U pyobjc
for manual install I use:
python setup.py install
I too was having this problem, also described here. It seems to be a problem with setuptools. I was able to successfully install PyObjC by reinstalling setuptools first, i.e.:
$> sudo pip uninstall setuptools
$> pip install setuptools
$> pip install pyobjc
Hope that helps.
I think this was fixed in pyobjc 2.5.1.