Permission Denied When Installing Tensorflow
Solution 1:
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--all2) 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.
Solution 2:
Run the cmd console as adminstrator, then execute you installation.
You can key cmd in run or Cortana, then right click the console and select run as adminstrator.
Solution 3:
I had the same problem on several Windows machines (W7, W8.1 and W10). At last I solved the problem in the same way in all of them:
- Uninstall Anaconda
- Download Anaconda3-4.2.0 from Anaconda Installer Archive. This version of Anaconda includes Python 3.5.2. TensorFlow only supports version 3.5.x of Python on Windows.Although you can create an environment with version 3.5 of Python, I recommend installing Anaconda 4.2.0
- Install Anaconda3-4.2.0 on a different drive than the Windows drive, for example in D:\Programdata\Anaconda3. Although installing on another drive is no longer necessary, better to select to install for all users.
- Open an Anaconda Promp with administrator privileges and:
Create a environment named tensorflow by invoking the following command:
conda create -n tensorflow python=3.5
Activate the conda environment by issuing the following command:
activate tensorflow
Install TensorFlow:
conda install -c conda-forge tensorflow
Install Jupyter and Spyder at least, but surely you will need to install scipy too for example:
conda install spyder
conda install jupyter
After that you can check if all is correct by invoking python and trying the next program:
import tensorflow as tf hail = tf.constant('Hello World') session = tf.Session() print(session.run(hail))
Now you can check if Spyder works. Exit from Python, invoke Spyder from Anaconda prompt and try de program.
If you have any problem with iPython, install it on the tensorflow enviroment.
conda install ipython
If you want to update spyder write the following command:
conda update spyder
Remember to launch Spyder from the Anaconda prompt after you have activated the tensorflow enviroment.
I hope it works for you.
Edited: TensorFlow, since version 1.2.0, is compatible with Python 3.6, so you can already install the latest version of Anaconda (4.4.0 | Release Date: May 31, 2017), which incorporates Python 3.6.
Solution 4:
Maybe because there are other processes using tensorflow. Try to close these processes and then install or update tensorflow.
Solution 5:
I had the same error and fixed it by running conda update --all
first.
BUt be careful with conda update: (https://github.com/ContinuumIO/anaconda-issues/issues/830) Updating packages
conda: 4.0.5-py35_0 --> 4.1.1-py35_0
conda-env: 2.4.5-py35_0 --> 2.5.0-py35_0
matplotlib: 1.5.1-np110py35_0 --> 1.5.1-np111py35_0
mkl: 11.3.1-0--> 11.3.3-1
mkl-service: 1.1.2-py35_0 --> 1.1.2-py35_1
numexpr: 2.5-np110py35_0 --> 2.5.2-np111py35_1
numpy: 1.10.4-py35_0 --> 1.11.0-py35_1
pandas: 0.18.0-np110py35_0 --> 0.18.1-np111py35_0
scikit-learn: 0.17.1-np110py35_0 --> 0.17.1-np111py35_1
scipy: 0.17.0-np110py35_0 --> 0.17.0-np111py35_4
will break Scripts/activate.bat under Windows if the install path contains spaces. (Replacing activate.bat with the original one just works fine.)
Post a Comment for "Permission Denied When Installing Tensorflow"