I want to install Anaconda and do machine learning using Tensorflow, but I can't install it because I get an error saying Permission denied.

Asked 1 years ago, Updated 1 years ago, 85 views

Prerequisites/What you want to achieve

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

Problems/Error Messages you are experiencing

On my PC, I often get a "permission denied" error message during decompression and installation, and I often don't accept commands.

on the shell to install the anaconda bash/Users/keisuke/Downloads/code/Anaconda3-5.1.0-MacOSX-x86_64.sh
If you type , the installation will start, but it will stop without permission to unzip in the middle.Below is the error.

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-1.19.2.1-ha5e8f32_1...
bunzip2:Can't open input file/Users/keisuke/anaconda3/pkgs/pandoc-1.19.2.1-ha5e8f32_1.tar.bz2:Permission denied.
Traceback (most recent call last):
File"/Users/keisuke/anaconda3/pkgs/.install.py", line618, in
main2()
File"/Users/keisuke/anaconda3/pkgs/.install.py", line 599, in main2
link_dist(opts.link_dist)
File"/Users/keisuke/anaconda3/pkgs/.install.py", line454, inlink_dist
link(prefix, dist, linktype)
File"/Users/keisuke/anaconda3/pkgs/.install.py", line328, inlink
files=list(yield_lines(join(info_dir, 'files')))
File"/Users/keisuke/anaconda3/pkgs/.install.py", line96, infield_lines
for line in open (path):
FileNotFoundError: [Errno2] No such file or directory: '/Users/keisuke/anaconda3/pkgs/pandoc-1.19.2.1-ha5e8f32_1/info/files'

If you type pip install tensorflow,

Collecting sensorflow
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: [Errno13] Permission denied: u'/private/var/folder/4y/z038tqx15jvfqptw0s_tmz8w000000gp/T/pip-unpack-Sk9pwB/torflow_1027-cop_1027-cop Consumer using the --user option or check the permissions.

You will not be able to install Tensorflow anyway with permission denied as shown in .

Tried

Based on the error message, I tried the following methods by referring to various commentary sites, but all of them failed.
·Execute code by adding sudo or --user or setting umask loosely→ Same error
·Delete all folders/files related to python and reinstall anaconda→ Same error
·Try to install tensorflow using anaconda navigator → After loading, nothing is added (permission denied is probably happening behind the scenes)
·(env)(tonsorflow)$ Enter the tensorflow virtual environment and do the same thing→ Same error

Supplementary information (for example, FW/Tool Version)

Current Conditions:
·Macbook Pro 10.12.6 (high quality used item)
·echo$PATH
/anaconda3/bin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin
·.bash_profile
export PATH="/anaconda3/bin:$PATH"
·Python 2.7.15
·The same file as /Users/keisuke and /Users/keisuke/Downloads/code contains anaconda3 (the contents are different).

python python3 tensorflow anaconda

2022-09-30 20:19

1 Answers

Regarding the question, the following error appears:
bunzip2:Can't open input file/Users/keisuke/anaconda3/pkgs/pandoc-1.19.2.1-ha5e8f32_1.tar.bz2:Permission denied.

Use the following commands to determine the owner and permission of the file and modify it to the correct one.

ls-l to /anaconda3/pkgs/pandoc-1.19.2.1-ha5e8f32_1.tar.bz2

Also, check to see if you can extract it with the following command:

bunzip2 through /anaconda3/pkgs/pandoc-1.19.2.1-ha5e8f32_1.tar.bz2

Permission denied error is normal for pip install tensorflow later in the question.Since Anaconda has not been installed, pip is an operation to install the package to python 2.7 which is installed on the Mac system.In this case, root privileges are required.Note that sudo pip install tensorflow is not very appropriate because it will change the Mac system.

"I tried, ""I tried to run code with sudo"", but when I installed Anaconda in my home directory as sudo, the dot file in my home directory will also have a directory or file where root is the owner."In that case, it is only natural that the error message "permission denied" occurs frequently.First of all, why don't you learn from the shell basics of owning a directory or file in your home directory?


2022-09-30 20:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.