Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied when installing Tensorflow

I am trying to install TensorFlow by Anaconda(My Python is 3.5.2 edition).

When I run:

(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl 

According to the guide in Tensorflow.org, the following tips emerge:

Exception:
Traceback (most recent call last):
File "C:\Users\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
File "C:\Users\Anaconda3\lib\site-packages\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:Anaconda3\lib\site-packages\pip\req\req_set.py", line 742, in install
**kwargs
File "C:\Users\Anaconda3\lib\site-packages\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\Anaconda3\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Users\Anaconda3\lib\site-packages\pip\wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "C:\Users\Anaconda3\lib\site-packages\pip\wheel.py", line 324, in clobber
shutil.copyfile(srcfile, destfile)
File "C:\Users\Anaconda3\lib\shutil.py", line 115, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Anaconda3\\Lib\\site-packages\\numpy\\core\\multiarray.cp35-win_amd64.pyd'

I don't know what causes this error. Can someone help me with that?

like image 910
yu liu Avatar asked Apr 10 '17 12:04

yu liu


People also ask

Can you install TensorFlow with PIP?

TensorFlow requires a recent version of pip, so upgrade your pip installation to be sure you're running the latest version. Then, install TensorFlow with pip. Note: Do not install TensorFlow with conda. It may not have the latest stable version.

Is TensorFlow available in Anaconda?

Anaconda makes it easy to install TensorFlow, enabling your data science, machine learning, and artificial intelligence workflows. This page shows how to install TensorFlow with the conda package manager included in Anaconda and Miniconda.

How do I know my TensorFlow version?

To check your TensorFlow version in your Jupyter Notebook such as Google's Colab, use the following two commands: import tensorflow as tf This imports the TensorFlow library and stores it in the variable named tf . print(tf. __version__) This prints the installed TensorFlow version number in the format x.y.z .


2 Answers

Might be late but I got the exact same error and this is what happened. My issue was that there was some file that was being used inside numpy that was locked by anaconda(or some other process) I guess and tensorflow needed that file. Hence I got permission denied. All I did was shut down every process anaconda, jupyter etc and ran:

1) conda update --all
2) pip install --ignore-installed tensorflow

Open your cmd as an administrator and do not activate tensorflow. Just simply fire commands from your cmd. For eg: C:\\> pip install --ignore-installed tensorflow (your directory may vary) should be fine. Let me know if you get stuck.

like image 96
Digvijay Sawant Avatar answered Sep 18 '22 19:09

Digvijay Sawant


Maybe because there are other processes using tensorflow. Try to close these processes and then install or update tensorflow.

like image 41
BigPeter Avatar answered Sep 22 '22 19:09

BigPeter