Reputation: 79
Wameedhs-MacBook-Air:Desktop wameedh$ cd
Wameedhs-MacBook-Air:~ wameedh$ export PYTHONPATH=.
Wameedhs-MacBook-Air:~ wameedh$ python ~/Downloads/get-pip.py
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Collecting wheel
Using cached wheel-0.29.0-py2.py3-none-any.whl
Installing collected packages: pip, wheel
Exception:
Traceback (most recent call last):
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpZqkyAz/pip.zip/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpZqkyAz/pip.zip/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpZqkyAz/pip.zip/pip/req/req_set.py", line 742, in install
**kwargs
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpZqkyAz/pip.zip/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpZqkyAz/pip.zip/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpZqkyAz/pip.zip/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpZqkyAz/pip.zip/pip/wheel.py", line 317, in clobber
ensure_dir(destdir)
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpZqkyAz/pip.zip/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Wameedhs-MacBook-Air:~ wameedh$ sudo chown -R $USER /Library/Python/2.7
Password:
Wameedhs-MacBook-Air:~ wameedh$ python ~/Downloads/get-pip.py
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Collecting wheel
Using cached wheel-0.29.0-py2.py3-none-any.whl
Installing collected packages: pip, wheel
Exception:
Traceback (most recent call last):
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpPhatQx/pip.zip/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpPhatQx/pip.zip/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpPhatQx/pip.zip/pip/req/req_set.py", line 742, in install
**kwargs
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpPhatQx/pip.zip/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpPhatQx/pip.zip/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpPhatQx/pip.zip/pip/wheel.py", line 463, in move_wheel_files
generated.extend(maker.make(spec))
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpPhatQx/pip.zip/pip/_vendor/distlib/scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpPhatQx/pip.zip/pip/_vendor/distlib/scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpPhatQx/pip.zip/pip/_vendor/distlib/scripts.py", line 250, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File "/var/folders/7x/jx8z1sg941vfxf3p7tznf8ch0000gn/T/tmpPhatQx/pip.zip/pip/_vendor/distlib/util.py", line 405, in write_binary_file
with open(path, 'wb') as f:
IOError: [Errno 13] Permission denied: '/usr/local/bin/pip'
Wameedhs-MacBook-Air:~ wameedh$ sudo python ~/Downloads/get-pip.py
The directory '/Users/wameedh/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/wameedh/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: pip in /Library/Python/2.7/site-packages
Collecting wheel
Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
100% |████████████████████████████████| 71kB 1.8MB/s
Installing collected packages: wheel
Successfully installed wheel-0.29.0
Wameedhs-MacBook-Air:~ wameedh$ pip install requests
-bash: pip: command not found
Wameedhs-MacBook-Air:~ wameedh$ which python
/usr/bin/python
Wameedhs-MacBook-Air:~ wameedh$ pip
-bash: pip: command not found
Wameedhs-MacBook-Air:~ wameedh$ export PYTHONPATH=.
Wameedhs-MacBook-Air:~ wameedh$ pip
-bash: pip: command not found
Wameedhs-MacBook-Air:~ wameedh$ which python
/usr/bin/python
Wameedhs-MacBook-Air:~ wameedh$ python -V
Python 2.7.10
Wameedhs-MacBook-Air:~ wameedh$ pip
-bash: pip: command not found
Wameedhs-MacBook-Air:~ wameedh$ man pip
No manual entry for pip
Wameedhs-MacBook-Air:~ wameedh$
[Restored Oct 9, 2016, 6:33:31 PM]
Last login: Sun Oct 9 18:33:31 on ttys000
Restored session: Sun Oct 9 18:32:03 PDT 2016
Wameedhs-MacBook-Air:~ wameedh$
It says:
Requirement already up-to-date: pip in /Library/Python/2.7/site-packages
Wameedhs-MacBook-Air:~ wameedh$ pip install requests
Still I am getting this:
-bash: pip: command not found
Upvotes: 0
Views: 9609
Reputation: 2914
This error also comes up when using the -i flag to specify your own resource location (ex: an Artifactory instance) and the path specified is incorrect. Verify the artifactory location by copy-pasting it as a url in the browser.
Upvotes: 0
Reputation: 79
Thanks all for the help. I fixed it! The problem was I didn't have the latest version of Xcode! I ran xcode-select --install before installing pip! that's it!!
Upvotes: 1