Permission denied when installing Tensorflow

前端 未结 9 1407
长情又很酷
长情又很酷 2020-12-07 00:52

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 h         


        
相关标签:
9条回答
  • 2020-12-07 01:41

    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:

    1. Uninstall Anaconda
    2. 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
    3. 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.
    4. Open an Anaconda Promp with administrator privileges and:
    5. Create a environment named tensorflow by invoking the following command:

      conda create -n tensorflow python=3.5

    6. Activate the conda environment by issuing the following command:

      activate tensorflow

    7. Install TensorFlow:

      conda install -c conda-forge tensorflow

    8. Install Jupyter and Spyder at least, but surely you will need to install scipy too for example:

      conda install spyder

      conda install jupyter

    9. 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))
      
    10. Now you can check if Spyder works. Exit from Python, invoke Spyder from Anaconda prompt and try de program.

    11. If you have any problem with iPython, install it on the tensorflow enviroment.

      conda install ipython

    12. 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.

    0 讨论(0)
  • 2020-12-07 01:49

    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.)

    0 讨论(0)
  • 2020-12-07 01:52

    I solved problem by below command

    pip install  --upgrade
    https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
    
    0 讨论(0)
提交回复
热议问题