[PYTHON] Permission denied with pip install pyopenssl

Solution for Permission denied with pip install pyopenssl

~ pip install pyopenssl
Collecting pyopenssl
  Using cached pyOpenSSL-16.1.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /usr/local/lib/python2.7/site-packages (from pyopenssl)
Collecting cryptography>=1.3.4 (from pyopenssl)
  Using cached cryptography-1.5.2-cp27-cp27m-macosx_10_10_intel.whl
Collecting enum34 (from cryptography>=1.3.4->pyopenssl)
  Using cached enum34-1.1.6-py2-none-any.whl
Collecting ipaddress (from cryptography>=1.3.4->pyopenssl)
  Using cached ipaddress-1.0.17-py2-none-any.whl
Collecting idna>=2.0 (from cryptography>=1.3.4->pyopenssl)
  Using cached idna-2.1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): setuptools>=11.3 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.3.4->pyopenssl)
Collecting cffi>=1.4.1 (from cryptography>=1.3.4->pyopenssl)
  Using cached cffi-1.8.3-cp27-cp27m-macosx_10_10_intel.whl
Collecting pyasn1>=0.1.8 (from cryptography>=1.3.4->pyopenssl)
  Using cached pyasn1-0.1.9-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.4.1->cryptography>=1.3.4->pyopenssl)
Installing collected packages: enum34, ipaddress, idna, pycparser, cffi, pyasn1, cryptography, pyopenssl
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 324, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/usr/local/Cellar/python/2.7.12_2/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: '/lib/python2.7/site-packages/enum/__init__.py'

When I searched for it, I found `sudo chown -R $ USER /lib/python2.7/site-packages/`. There was also a method, but it feels bad to easily change the ownership of such a system-wide folder. When I was looking for another way, I arrived at the following.

http://stackoverflow.com/questions/25816674/pip-is-not-able-to-install-packages-correctly-permission-denied-error

pip install pyopenssl --userYou can use it.

Confirmed just in case.

~ pip install --user
--user   Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on Windows. (See the Python documentation for site.USER_BASE for full details.)

And that.

~ pip install pyopenssl --user
Collecting pyopenssl
  Using cached pyOpenSSL-16.1.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /usr/local/lib/python2.7/site-packages (from pyopenssl)
Collecting cryptography>=1.3.4 (from pyopenssl)
  Using cached cryptography-1.5.2-cp27-cp27m-macosx_10_10_intel.whl
Collecting enum34 (from cryptography>=1.3.4->pyopenssl)
  Using cached enum34-1.1.6-py2-none-any.whl
Collecting ipaddress (from cryptography>=1.3.4->pyopenssl)
  Using cached ipaddress-1.0.17-py2-none-any.whl
Collecting idna>=2.0 (from cryptography>=1.3.4->pyopenssl)
  Using cached idna-2.1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): setuptools>=11.3 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.3.4->pyopenssl)
Collecting cffi>=1.4.1 (from cryptography>=1.3.4->pyopenssl)
  Using cached cffi-1.8.3-cp27-cp27m-macosx_10_10_intel.whl
Collecting pyasn1>=0.1.8 (from cryptography>=1.3.4->pyopenssl)
  Using cached pyasn1-0.1.9-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.4.1->cryptography>=1.3.4->pyopenssl)
Installing collected packages: enum34, ipaddress, idna, pycparser, cffi, pyasn1, cryptography, pyopenssl
Successfully installed cffi-1.8.3 cryptography-1.5.2 enum34-1.1.6 idna-2.1 ipaddress-1.0.17 pyasn1-0.1.9 pycparser-2.14 pyopenssl-16.1.0

Good.

Reference URL

http://stackoverflow.com/questions/7143077/how-can-i-install-packages-in-my-home-folder-with-pip/7143496#7143496 http://stackoverflow.com/questions/25816674/pip-is-not-able-to-install-packages-correctly-permission-denied-error

Recommended Posts

Permission denied with pip install pyopenssl
Error with pip install
Install scikit.learn with pip
When moss with pip install
Install github repository with pip
Install Python 2.7.9 and Python 3.4.x with pip.
Manipulate colors with pip install color
How to install mysql-connector with pip3
[Python Windows] pip install with Python version
SSL certificate related with pip install? Error
I want to pip install with PythonAnywhere
Install by specifying the version with pip
scipy stumbles with pip install on python 2.7.8
I can't install the package with pip.
Let's install box2d-py with Windows 10 environment pip
sudo pip install
Avoiding "'ascii' codec can't decode" with pip install
Install pip and pandas with Ubuntu or VScode
Steps to install your own library with pip
Install pip on Mavericks
PIL installation with pip
pip install ○○○ error Command errored out with exit status 1:
Installing packages with pip3
How to install pip
Use pip with MSYS2
[android] When AVD cannot be used with permission denied
Install Voluptuous with Python 2.5
Install the pip command
Install torch-scatter with PyTorch 1.7
Install python with pyenv
A memorandum when an error occurs with pip install
Until you install TensorFlow-GPU with pip in Windows environment
Install pip / pip3 on Ubuntu
When pip install fails
Install tweepy with pip and use it for API 1.1
[Road to intermediate Python] Install packages in bulk with pip
Until you can install your own Python library with pip
Can't find the package you installed with pip install --user?
Steps to install a Git cloned package locally with pip
Install Jupiter Notebook on Windows with pip in proxy environment
I have libncurses but get angry with pip install readline
Bulk update with pip (with confirmation)
Install Python environment with Anaconda
Install Keras (used with Anaconda)
Use pip with Jupyter Notebook
Specify version with conda install
Pip install in proxy environment
Install external libraries with Python
Pip install the GitHub repository
Dealing with PermissionError [Error 1] for pip install -U pip on macOS Sierra
What to do if you can't install pyaudio with pip #Python
I get an error when trying to install maec 4.0.1.0 with pip
What to do if you get a UnicodeDecodeError with pip install
Install packages that need to be compiled with Python3 with pip [Windows]
Read this if you get SSL related errors with pip install! !! !!
Install pip in Serverless Framework and AWS Lambda with Python environment
[TensorFlow] If you want to run TensorBoard, install it with pip