I want to study a machine learning model for image recognition, so I want to install Anaconda and study it myself using Tensorflow and Keras.
Therefore, I installed Anaconda 5.1 for Python 3.6 version mac and ran it from the command prompt. I am a beginner in programming including machine learning and environment construction, and have no development experience.

Error message

On my PC, the error message "permission denied" occurs frequently during decompression and installation, and commands are often not accepted.
Try to install anaconda on the shell
bash /Users/keisuke/Downloads/code/Anaconda3-5.1.0-MacOSX-x86_64.sh
If i hit, the installation will start, but it will stop without defrosting permission. The following is the error content.


installing: python-3.6.4-hc167b69_1 ...
  Python 3.6.4 :: Anaconda, Inc.
  installing: bzip2-1.0.6-hd86a083_4 ...
  installing: ca-certificates-2017.08.26-ha1e5d58_0 ...
  installing: conda-env-2.6.0-h36134e3_0 ...
  installing: intel-openmp-2018.0.0-h8158457_8 ...
  installing: jbig-2.1-h4d881f8_0 ...
  installing: jpeg-9b-he5867d9_2 ...
  installing: libcxxabi-4.0.1-hebd6815_0 ...
  installing: libgfortran-3.0.1-h93005f0_2 ...
  installing: libiconv-1.15-hdd342a3_7 ...
  installing: libsodium-1.0.15-hd9e47c5_0 ...
  installing: lzo-2.10-h362108e_2 ...
  installing: pandoc- ...
  bunzip2: Can't open input file /Users/keisuke/anaconda3/pkgs/pandoc- Permission denied.
  Traceback (most recent call last):
    File"/Users/keisuke/anaconda3/pkgs/.install.py" ;, line 618, in<module>
      main2 ()
    File"/Users/keisuke/anaconda3/pkgs/.install.py" ;, line 599, in main2
      link_dist (opts.link_dist)
    File"/Users/keisuke/anaconda3/pkgs/.install.py" ;, line 454, in link_dist
link (prefix, dist, linktype)
    File"/Users/keisuke/anaconda3/pkgs/.install.py" ;, line 328, in link
      files = list (yield_lines (join (info_dir,'files')))
    File"/Users/keisuke/anaconda3/pkgs/.install.py" ;, line 96, in yield_lines
      for line in open (path):
  FileNotFoundError: [Errno 2] No such file or directory:'/Users/keisuke/anaconda3/pkgs/pandoc-'

If i type pip install tensorflow,


Collecting tensorflow
    Using cached https://files.pythonhosted.org/packages/9b/1e/d89f1369b5b8045e5aedf43718b45d2396d3c61e9cc56123c24b7758dd9f/tensorflow-1.8.0-cp27-cp27m-macosx_10_11_x86_64.whl
  Could not install packages due to an EnvironmentError: [Errno 13] Permission denied:u'/private/var/folders/4y/z038tqx15jvfqptw0s_tmz8w0000gp/T/pip-unpack-Sk9pwB/tensorflow-1.8.0- cp27-cp27m-macosx_10_11_x86_64.whl'
  Consider using the-useroption or check the permissions.

As in

, [permission denied] appears and Tensorflow cannot be installed anyway.


Relying on the error message, I tried the following methods with reference to various commentary sites, but everything was wrong.
-Execute code with sudo or --user attached, or set umask loosely → Same error
・ Delete all folders/files related to python and reinstall anaconda → same error
-Trying to install tensorflow using anaconda navigator->ends without adding anything after loading (perhaps a permission denied occurs behind the scenes)
・ Enter the virtual environment of tensorflow and execute the same thing like (env) (tonsorflow) $→ Same error

Supplemental information (FW/tool version etc.)

Current conditions:
・ Macbook Pro 10.12.6 (Good quality second-hand goods)
・ Echo $PATH
/ anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
・ .Bash_profile
export PATH ="/anaconda3/bin: $PATH"
・ Python 2.7.15
・ The same file "anaconda3" is included under/Users/keisuke and/Users/keisuke/Downloads/code (the contents are different).

  • Answer # 1


    Perhaps/private/var/folders/4y/z038tqx15jvfqptw0s_tmz8w0000gp/T/pip-unpack-Sk9pwB/・ This directory did not exist (it was not created automatically due to restrictions), so it seems that an error had occurred.

    First, create this directory yourself and access restrictions are applied.
    Search for the file, download it and place it there. If you hit pip3 install -U tensorflow-1.8.0-cp27-cp27m-macosx_10_11_x86_64.whl at that location, you could download it.

    You can now use Keras and others that you can't use without a tensorflow upgrade.