pip permissions issue on OS X using a basic command - python

I'm trying to install pip using this command:
python get-pip.py
The error it's spitting out is this - can you help? (I'm running macOS 10.12.1)
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/by/db2rdr7n1753qbfz0rlgk7hw0000gn/T/tmptA1AVr/pip.zip/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/var/folders/by/db2rdr7n1753qbfz0rlgk7hw0000gn/T/tmptA1AVr/pip.zip/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/var/folders/by/db2rdr7n1753qbfz0rlgk7hw0000gn/T/tmptA1AVr/pip.zip/pip/req/req_set.py", line 742, in install
**kwargs
File "/var/folders/by/db2rdr7n1753qbfz0rlgk7hw0000gn/T/tmptA1AVr/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/by/db2rdr7n1753qbfz0rlgk7hw0000gn/T/tmptA1AVr/pip.zip/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/var/folders/by/db2rdr7n1753qbfz0rlgk7hw0000gn/T/tmptA1AVr/pip.zip/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/var/folders/by/db2rdr7n1753qbfz0rlgk7hw0000gn/T/tmptA1AVr/pip.zip/pip/wheel.py", line 317, in clobber
ensure_dir(destdir)
File "/var/folders/by/db2rdr7n1753qbfz0rlgk7hw0000gn/T/tmptA1AVr/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'

To install pip you on Mac OSX you can try :
sudo easy_install pip
The "sudo" keyword is what will grant you root privileges.

You need root access. Activate your root account and try from there.

Related

How to install EbaySDK on python on Mac

I'm trying to install EbaySDK for Mac using Python but its not working. I have tried to follow this, but doesn't seem like I can use yum or apt-get for Mac. I also tried to use PIP but apparently need BeautifulSoup4 and it fails:
followed steps:
have python & pycharm environment installed
have pip installed
tried pip install beautifulsoup4 and get below error message
when trying to import EbaySDk its not found. I really need help with this guys!
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/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/beautifulsoup4-4.6.0.dist-info'
You need to execute the following:
sudo easy_install ebaysdk
This will install the correct package

PermissionError no13 on installing steem library

I'm trying to install steem library on Ubuntu 16.04 using VMplayer and Python 3.5
Getting following error on running pip3 install steem:
Exception:
Traceback (most recent call last):
File "/home/orion/.local/lib/python3.5/site-
packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/orion/.local/lib/python3.5/site-
packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/orion/.local/lib/python3.5/site-packages/pip/req/req_set.py",
line 784, in install
**kwargs
File "/home/orion/.local/lib/python3.5/site-
packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/orion/.local/lib/python3.5/site-
packages/pip/req/req_install.py",
line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/orion/.local/lib/python3.5/site-packages/pip/wheel.py", line
345,
in move_wheel_files
clobber(source, lib_dir, True)
File "/home/orion/.local/lib/python3.5/site-packages/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/usr/lib/python3.5/shutil.py", line 115, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-
packages/appdirs.py'
Run the pip3 install command as sudo to avoid running into any permissions issues: sudo pip3 install [PACKAGE]

Can't install packages in PyCharm (OSError: [Errno 13])

I can't install packages in PyCharm
throws this error
Collecting oktaauth
Downloading oktaauth-0.2-py2-none-any.whl
Requirement already satisfied: requests>=2.8 in /Library/Python/2.7/site-packages (from oktaauth)
Collecting argparse (from oktaauth)
Downloading argparse-1.4.0-py2.py3-none-any.whl
Collecting beautifulsoup4>=4.4 (from oktaauth)
Downloading beautifulsoup4-4.6.0-py2-none-any.whl (86kB)
Installing collected packages: argparse, beautifulsoup4, oktaauth
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 247, in move_wheel_files
prefix=prefix,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/locations.py", line 153, in distutils_scheme
i.finalize_options()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 346, in finalize_options
self.create_home_path()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 565, in create_home_path
os.makedirs(path, 0700)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
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: '/Users/karanj/Library/Python/2.7'
I found soltutions by asking me to try installing it by being root or trying sudo with the command and try installing the package. But I don't want to install the package by appending sudo to it.
Any solutions?
When you start a python project, always use Python virtual environemnt. Avoid using use sudo pip install.
You can either
create Pycharm virtual environment, or
Create your typical virtualenv, then add external virtualenv to Pycharm, or
Use pycharm with conda, another virtual environment.
Try with sudo
If there is a requirement file e.g. sudo pip install -r requirements.txt
Or for standalone package
sudo pip install <package-name>

Error when installing XLRD using pip for python (3.6)

I am using windows 10 64-bit and i installed pip as well as python using the python installer. When i type the command pip install xlrd the following error appears :
C:\Users\Tanmay>pip install xlrd
Collecting xlrd
Downloading xlrd-1.0.0-py3-none-any.whl (143kB)
100% |████████████████████████████████| 153kB 317kB/s
Installing collected packages: xlrd
Exception:
Traceback (most recent call last):
File "c:\program files (x86)\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "c:\program files (x86)\python36-32\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\wheel.py", line 316, in clobber
ensure_dir(destdir)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "c:\program files (x86)\python36-32\lib\os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] Access is denied: 'c:\\program files (x86)\\python36-32\\Lib\\site-packages\\xlrd'
it gives you Permission Error try to install it
as super user sudo pip install xlrd
in case of windows, in cmd try to run pip install using python executable
e.g.
`python -m pip install xlrd`
The problem got fixed simply by running the command prompt as an administrator.

Installing Virtual Environment with PIP for Python Via Mac OS X Terminal

So, just a quick question. I've installed Pip for Python via Homebrew in the Mac OS X terminal. The next thing I tried to do was install the virtual environment via pip install virtualenv --and that's where I ran into a problem. I get the following error message:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv.py'
Anyone know what to do?
I'm new to all this, so I'm completely at a loss as to what to do.
Thanks.
Have you seen http://softwaretester.info/install-and-upgrade-pip-on-mac-os-x/
this might help you i am windows user so its command is like pip install package-name but you must present in Scripts folder of the python27 in windows but i don't know about the mac-os-x . so do this also change your directory to python27/scripts and then use your command of pip
If this helps you.Support with thumbs up

Categories