Trouble with pip in Mountain Lion - python

I'm having trouble running pip in Mountain Lion. I was under the impression that it should come preinstalled with Python (which is working), but trying to run any pip command just presents me with the following:
-bash: pip: command not found
I've tried
sudo easy_install pip
but get the following error:
Traceback (most recent call last):
File "/usr/bin/easy_install-2.7", line 10, in
load_entry_point('setuptools==0.6c12dev-r88846', 'console_scripts', 'easy_install')()
File "build/bdist.macosx-10.6-x86_64/egg/pkg_resources.py", line 347, in load_entry_point
File "build/bdist.macosx-10.6-x86_64/egg/pkg_resources.py", line 2516, in load_entry_point
ImportError: Entry point ('console_scripts', 'easy_install') not found
I've also tried using get-pip.py, as suggested at http://www.pip-installer.org/en/latest/installing.html, but this gives me a whole slew of errors.
Installing from source seems to work, but pip is still not found
I have a feeling there might be something wrong with my path:
~/.bin/:/usr/local/share/python:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Any help would be greatly appreciated.
Thank you

Related

Tried to upgrade pip, but error 'WinError 5' showed up

I've found a problem with pip and can't do anything with it anymore.
I'm on a Windows 7 computer and have a Dutch language (maybe it will occur problems with reading)
I did use pip version 8.1.1, but there's a newer version, 9.0.1. I installed it using 'pip install --upgrade pip' and he's doing pretty well so it uninstalled the previous version of pip and then the problem came. Now I can't use pip as well. When I try to install or upgrade my system says: 'ImportError: No module named pip'.
I had this problem somewhere in 2016 and never found an answer, so I installed Python again on my computer. I hope there's a better way to do this instead of install whole Python and all those modules again.
So for me is this a bit strange, I hope anyone know this problem and knows a way to fix this. Beneath I'll show up the texts in the command prompt.
Code:
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
D:\PythonProjects\Python Crash Course\learning_log\ll_env\Scripts>pip install --
upgrade pip
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Exception:
Traceback (most recent call last):
File "C:\Users\Pascal\AppData\Local\Programs\Python\Python35\lib\shutil.py", l
ine 538, in move
os.rename(src, real_dst)
OSError: [WinError 17] Het systeem kan het bestand niet verplaatsen naar een and
er station: 'd:\\pythonprojects\\python crash course\\learning_log\\ll_env\\scri
pts\\pip.exe' -> 'C:\\Users\\Pascal\\AppData\\Local\\Temp\\pip-0hagtsau-uninstal
l\\pythonprojects\\python crash course\\learning_log\\ll_env\\scripts\\pip.exe'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\basecommand.py", line 209, in main
File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\commands\install.py", line 317, in run
File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\req\req_set.py", line 726, in install
File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\req\req_install.py", line 746, in uninstall
File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\req\req_uninstall.py", line 115, in remove
File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\utils\__init__.py", line 267, in renames
File "C:\Users\Pascal\AppData\Local\Programs\Python\Python35\lib\shutil.py", l
ine 553, in move
os.unlink(src)
PermissionError: [WinError 5] Toegang geweigerd: 'd:\\pythonprojects\\python cra
sh course\\learning_log\\ll_env\\scripts\\pip.exe'
D:\PythonProjects\Python Crash Course\learning_log\ll_env\Scripts>pip freeze > r
equirements.txt
Traceback (most recent call last):
File "C:\Users\Pascal\AppData\Local\Programs\Python\Python35\lib\runpy.py", li
ne 184, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Pascal\AppData\Local\Programs\Python\Python35\lib\runpy.py", li
ne 85, in _run_code
exec(code, run_globals)
File "D:\PythonProjects\Python Crash Course\learning_log\ll_env\Scripts\pip.ex
e\__main__.py", line 5, in <module>
ImportError: No module named 'pip'
Not sure how many people will be drawn to this note, however, if you find yourself in the scenario where the pip install, terminal within PyCharm install, Python Package install, etc. methods are not working and you are receiving the errors that pygame is installed in Conda but module not recognized in PyCharm; it is most likely due to conflicting Python versions having been installed as PyCharm and Conda are both IDEs and you can have overlapping versions of Python installed.
If this is the case, you will need to uninstall all of the versions of Python and Anaconda along with PyCharm. Then once reinstalled, if PyCharm doesn't recognize itself as a Python Interpreter, then add an interpreter and run as a virtual environment. At this stage, you should be able to use the python packages section to install PyGames without issue. You may be able to get by without uninstalling other IDEs however I find that a full purge is full proof.
Hope this helps
This is related to disk drives on Windows. Pip downloads the new files to your current drive (D:) and then tries to move them over to the system files (on C:) and fails.
(See https://github.com/pypa/pip/issues/2824)
Could you run
python -m pip install -U pip
or is pip completely gone?
If it's gone then you would have to re-install it. Maybe re-installing all of Python is easier although probably more time consuming.

Python 3.5 pip version conflict with python 2.7

I am trying to install a software using pip install and my python and pip versions are 3.5. but when I run sudo pip install -e . I get the following error.
Traceback (most recent call last):
File "/usr/local/bin/pip3.5", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 2675, in <module>
parse_requirements(__requires__), Environment()
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 552, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==8.1.0
Why Do I get an error with python 2.7 and please some one could sortout my issue.
Your pip version and python versions are separate. It looks like your package requires exactly pip 8.1.0. You have to either upgrade/downgrade to that version first, or modify the software to work with whichever pip you have available.
Also, it may be easier to install the software in a virtual environment rather than system/global one. Changing the system version of pip may break either current apps, or the future pip package updates.

pip installation error when installing a package

So, I'm currently trying to install this package:
pip install git+https://github.com/Rapptz/discord.py#async
Github here: https://github.com/Rapptz/discord.py
but I get this error:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-khtOce/aiohttp/setup.py", line 61, in <module>
raise RuntimeError("aiohttp requires Python 3.4.1+")
RuntimeError: aiohttp requires Python 3.4.1+
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-khtOce/aiohttp/
So instead I have tried using pip3 to install the same package, but I'm currently getting a version conflict which I do not know how to solve.
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 9, in <module>
load_entry_point('pip==8.1.1', 'console_scripts', 'pip3')()
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.14- py2.7.egg/pkg_resources.py", line 305, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 2243, in load_entry_point
raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'pip3') not found
I remember doing this yesterday, and I may have toyed around installing and reinstalling pip, but before, when I tried to install the same package when pip3 was working, I still remember getting the same error, so idk if solving the version conflict will do much.
I think you have a setuptools conflict here which will probably be resolved by updating setuptools.
Try:
pip install setuptools --upgrade
You can remove the previous setuptools installation in case it gives you a problem.

Python Scrapy will not run showing pkg_resources.DistributionNotFound: service-identity

Scrapy will not run on my Ubuntu 14.04 giving the error:
Traceback (most recent call last):
File "/usr/bin/scrapy", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 444, in _build_master
ws.require(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 725, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 628, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: service-identity
Timeline: I had Python 2.7.6 installed which came with Ubuntu 14.04. I upgraded to 2.7.9 which is currently my python -V. I started by downloaded scrapy from the website (scrapy.org) following their Ubuntu instructions, and I got the error code above when attempting to use scrapy. Then I went through every imaginable stackoverflow for pip being broken, scrapy being broken but no good.
pip upgrade did not work:
pip broke. how to fix DistributionNotFound error?
This guy had almost the same error but no response:
Python(Scrapy) unpredictable mistake with "import load_entry_point"
He pointed to: Python & Scrapy: Issue with Scrapy version
I uninstalled all scrapy and reinstalled with pip (it was installing version Scrapy-1.0.3) and it initially failed but I upgraded some libraries (libffi & lxml) and the install worked with a sudo run. Same error remained when running scrappy.
Any chance anyone knows whats going on? Thanks
make sure you have installed the service identity package. you can install it by:
sudo pip install service-identity

python nosetests won't work

I was learning Python from 'learning python the hard way' and I was stuck at exercise 46 (http://learnpythonthehardway.org/book/ex46.html).
I installed pip and then the nose package and whenever i run nosetest now as in the example it doesn't work. This is the error I get:
Traceback (most recent call last):
File "/usr/local/bin/nosetests", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2807, in <module>
parse_requirements(__requires__), Environment()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 594, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: nose==1.3.0
I googled about this but couldn't find an answer.
I am on a Lubuntu 13.04 desktop.
You need to install a version of nose equal to 1.3.0 (maybe the nose version that you installed is not 1.3.0?)
You can find out what version of nose you have installed with
>>> import nose
>>> nose.__version__
'1.3.0'
Using pip this is as simple as (if you already have nose installed then you will want to use the --upgrade flag)
pip install --upgrade nose==1.3.0
or even direct from the website
pip install -Iv https://pypi.python.org/packages/source/n/nose/nose-1.3.0.tar.gz#md5=95d6d32b9d6b029c3c65674bd9e7eabe

Categories

Resources