pip install not working, Distribution not found - python

I am trying to install Pip and anaconda.
In my mac I have both python 2 as well as python 3.
When I try to easy_install pip I get the error [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-14341.write-test'
So I tried to do a pip install
I GOT
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3241, in <module>
#_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==19.3.1' distribution was not found and is required by the application
Also I cannot install Anaconda, maybe because of this problem
PS. I have used homebrew to install python.
Have anyone solved it?

One of the problem is that from now on we to use pip3 instead of just pip. Another problem is that the open ~/.zshrc file need to be updated with the same open ~/.bash_profile instruction from anaconda.
IN CONCLUSION
I think that for installing pip packages you need to use the pip3 command or you could write an alias file where you substitute pip with pip3.
Then for actually using conda I followed this article so that it overrun the zhs of the mac config.
Getting Anaconda to work

Related

pip remains on the old version after updating

I keep trying to update pip with:
pip install --upgrade pip
It seems to complete fine but when I run pip --version its still running the old version (19.0.3 vs 19.3). I'm using pycharm on Windows 10.
I'm trying to install pandas and I've read the issue I'm getting can be solved by updating pip and setuptools.
I saw some suggestions to delete the pip folder. So I went to Python38/Lib/site-packages and found 3 pip folders. pip, pip-19.0.3-py3.8egg. There was a 19.3 folder I deleted already.
If I delete the 19.0.3 folder I get an error running pip commands saying:
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 583, in _build_master
ws.require(__requires__)
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 19.3 (c:\users\jxdwa\appdata\roaming\python\python38\site-packages), Requirement.parse('pip==
19.0.3'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python38\Scripts\pip-script.py", line 6, in <module>
from pkg_resources import load_entry_point
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 3251, in <module>
def _initialize_master_working_set():
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 3234, in _call_aside
f(*args, **kwargs)
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 3263, in _initialize_master
_working_set
working_set = WorkingSet._build_master()
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 598, in _build_from_require
ments
dists = ws.resolve(reqs, Environment())
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==19.0.3' distribution was not found and is required by the application

Unable to start supervisor deamon

I am getting following error while restarting supervisord. I searched for it and tried pip install --upgrade setuptools and easy_install --upgrade pip but nothing is working out.
$ sudo /etc/init.d/supervisord start
Starting supervisord: Traceback (most recent call last):
File "/usr/local/bin/supervisord", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/dist-packages/pkg_resources/__init__.py", line 3020, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python2.6/dist-packages/pkg_resources/__init__.py", line 616, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.6/dist-packages/pkg_resources/__init__.py", line 629, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.6/dist-packages/pkg_resources/__init__.py", line 807, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: supervisor==3.3.1
[FAILED]
I am using Amazon AMI instance. Please help.
I launched a new Amazon EC2 instance with the Amazon Linux AMI and did:
sudo easy_install supervisor
It worked fine.
Based on: http://supervisord.org/installing.html

The 'pip==9.0.1' distribution was not found and is required by the application

When I tried to install Jupiter, I got the error :
┌─╼ [~]
└────╼ sudo -H pip install jupyter
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3036, in <module>
#_call_aside
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3049, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 656, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 669, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 854, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application
and here what I have when I execute the command pip --version, I got
pip 9.0.1 from /home/jeremie/Enthought/Canopy_64bit/User/lib/python2.7/site-packages (python 2.7)
What could I do to fix this problem?
Thanks in advance!
P.S. I am running Ubuntu 16.10.
sudo -H pip is the system pip
File "/usr/local/bin/pip",
pip --version is the pip on your local path
pip 9.0.1 from /home/jeremie/Enthought/Canopy_64bit/User/lib/python2.7/site-packages (python 2.7)
Don't use sudo

things won't install on AWS EC2 because I have pip 8.1.2 instead of 6.1.1

I have run into this numerous times on my current project and it's driving me crazy. I discover I need to install some module but get an error that pip 6.1.1 isn't installed (server has 8.1.2):
$ sudo pip install djangorestframework
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2991, in <module>
#_call_aside
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2977, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3004, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 664, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 677, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 856, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==6.1.1' distribution was not found and is required by the application
so I checked:
$ pip --version
pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
I have tried $ sudo yum install djangorestframework but the package doesn't exist (no surprise). how do install these things that seem to rely specifically on 6.1.1 but I have 8.1.2? I'm worried if I uninstall (and rollback) that I'll loose functionality in other areas...
It occurred to me it's a difference between the sudo in the first command and lack of it in the second, so I tried this:
$ sudo yum install python-pip
Loaded plugins: priorities, update-motd, upgrade-helper
Package python26-pip-6.1.1-1.23.amzn1.noarch already installed and latest version
Nothing to do
[ec2-user#ip-172-XX-XX-XXX limboproj]$ source limboenv/bin/activate
(limboenv)[ec2-user#ip-172-XX-XX-XXX limboproj]$ sudo yum install python-pip
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
Package python26-pip-6.1.1-1.23.amzn1.noarch already installed and latest version
Nothing to do
and I still get:
$ sudo pip --version
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2991, in <module>
#_call_aside
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2977, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3004, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 664, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 677, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 856, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==6.1.1' distribution was not found and is required by the application
SO labelled as a duplicate, so I'm including here my comment below. when I tried to follow the answer on the suggested question, I got:
$ sudo pip install --upgrade pip-6.1.1
which results in a stacktrace ending with:
The 'pip==6.1.1' distribution was not found and is required by the application. also notice in my edit, i show that sudo yum install python-pip seems to conflict with sudo pip --version
not sure how to really resolve what I was dealing with, but it turns out the project's virtualenv had a satisfactory version of pip. for people in the future, try to activate the virtual env:
$ source projectenv/bin/activate
and then install
$ sudo pip install djangorestframework
That worked great for me

getting a traceback error when installing boto using pip

[root#ip-172-31-34-8 ec2-user]# sudo pip install -U boto
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 616, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 629, in _build_from_requirements
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 807, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==6.1.1
If you are installing on a fresh EC2 machine, which I guess from the first line of your code, you may not have pip installed.
For recent versions of AWS Linux AMI, you may use easy_install instead:
sudo easy_install pip
And then:
sudo easy_install boto3
Or:
sudo pip install boto3

Categories