TensorFlow installation denied due to user permissions - python-3.x

I tried to run tensorflow on Jupiter netbook, python 2.7 but I realized it requiered 3.6 pythong version so I followed this steps :
Installing with Anaconda
Create a conda environment named tensorflow by invoking the following command:
C:> conda create -n tensorflow pip python=3.5
Activate the conda environment by issuing the following command:
C:> activate tensorflow
(tensorflow)C:> # Your prompt should change
Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command:
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
To install the GPU version of TensorFlow, enter the following command (on a single line):
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu
**
But this line of code
**
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
Show me the this error:
Could not install packages due to an EnvironmentError: [WinError 5]
Access is denied:
'C:\Users\idan\AppData\Local\Continuum\anaconda2\envs\tensorflow\Lib\site-packages\numpy\.libs\libopenblas.BNVRK7633HSX7YVO2TADGR4A5KEKXJAW.gfortran-win_amd64.dll'
Consider using the --user option or check the permissions.
I tried to change user permission and also open anaconda cmd as administrator but it doesn't help.

This answer has the necessary information for the pip permission error. It can be resolved with the --user flag, which is a conservative approach.
There is another way to install tensorflow for conda-environment. Write below on the Anaconda Command Prompt after activating environment.
conda install tensorflow
Test it :
python
import tensorflow as tf
And it should work.

I had the similar problem. The following solved mine.
Try updating the LD_LIBRARY_PATH using the following:
sudo ldconfig /usr/local/cuda/lib64
I found the solution from https://abdel.me/2017/09/28/aws-ami-deep-learning-keras/

Related

Error when trying to install oct2py package

I am trying to install to oct2py package to import in my python script. However whenever I run the command pip install oct2py I get the following error:
Fatal error in launcher: Unable to create process using '"c:\python37\python.exe" "C:\Program Files\Python37\Scripts\pip.exe" ': file cannot be found.
How can I install oct2py?
Found the answer
Deinstalled python and reinstalled it. I checked the environment variable and changed it from this one : 'C:\Program Files\Python39' to this one 'C:\Users\lsee\AppData\Local\Programs\Python\Python39'.
Is unable to locate your pip installer, easy fix is unusually to either upgrade or test pip :
# to upgrade your pip
python -m pip install --upgrade pip
pip --version
# test you have pip in your machine
If your pip version is showing that means you have it installed, it could be a problem activating your virtual environnement, or your path.
It says the file cannot be locate, are you sure your path for Python and pip is correct ?
Try:
python -m pip install oct2py
This should work (as python -m pip install gave not errors)

Couldn't install scikit

While installing scikit learn this is what I get in terminal:
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'd:\anaconda\lib\site-packages\scipy\interpolate\dfitpack.cp37-win_amd64.pyd'
Consider using the --user option or check the permissions.
How do I find the main user folder?
I've tried this code:
pip install -U scikit-learn scipy matplotlib
Try to install packages using anaconda navigator. Launch the app then go to environments and select the packages that you want to install and then click apply.
Its not a problem to install libs with pip as long as your conda config has pip installed.
To your problem:
either do sudo pip install -U scikit-learn scipy matplotlib
or as state pip install -U scikit-learn scipy matplotlib --user
Your problem is with the permissions because you probably do not have an vena active.

i tried installing tensorflow using 'pip install tensorflow ' in anaconda prompt and command prompt. its showing following output

Found existing installation: wrapt 1.10.11
Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Try the below commands mentioned, it worked for me
conda update wrapt
pip install tensorflow
(1) First try to install wrapt manually using following command
pip install wrapt --upgrade --ignore-installed
make sure that you use "--ignore-installed" flag when install 'wrapt' as above mentioned command
(2) Then install tensorflow with pip
eg:
pip install tensorflow==1.14
this should work
You might want to upgrade numpy with following incase its not compatible otherwise it will throw errors.
pip install numpy --upgrade
I was getting this error while installing from conda environment. Always upgrade conda or pip before a new installation.
Following worked for me:
[Optional] If installing in conda environment, then temporarily remove the conda env:
conda remove --name myenv --all
Update all conda packages:
conda update --all
Create conda env again:
conda create -n myenv
Activate conda env:
conda activate
Install tensorflow:
pip install tensorflow

Python 3.5.2 Windows x86-64 web-based, but installer not installing pip

I am trying to install TensorFlow. The installation instruction for Windows (https://www.tensorflow.org/install/install_windows) have as first step to install Python 3.5.2. And I'm doing the 'TensorFlow with CPU support only'.
Python was successfully installed in my computer as I can run it via the Start menu.
However, when I try to do the 2nd step of the installation instructions in order to install TensorFlow, this step says to:
To install TensorFlow, start a terminal. Then issue the appropriate pip3 install command in that terminal. To install the CPU-only version of TensorFlow, enter the following command:
C:\> pip3 install --upgrade tensorflow
But I'm getting an error when I perform the above statement, the error is
'pip' is not recognized as an internal or external command, oprable program or batch file.
I looked at several postings in StackOverflow and tried the commands provided in one of the postings, but I would get the same type of error.
So, how is 'pip3' installed? from what I read, it is supposed to be installed together with the installation, but obviously that did not happen.
How do I install it? I need to install TensorFlow and it seems that it needs to be done via the pip3 installation tool.
Thank you in advance for your help!
Either set the system environment path variable to include the python 3.5.x path in it, or just cd into the correct python folder to run pip3 from there.
The folder in windows 10 should be something like this:
C:\Users\YOUR_USERNAME\AppData\Local\Programs\Python\Python35\Scripts
Open the terminal, cd to that path (change YOUR_USERNAME to the correct user) and then just run the following command:
pip3 install --upgrade tensorflow
and if you want the gpu version:
pip3 install --upgrade tensorflow-gpu
Pip3 is already installed when you install Python, so there is no need to do anything else.

pip3 not found in Tensorflow environment: "-bash: pip3: command not found"

I'm following instructions to create a Tensorflow environment for a Machine Learning course, with python 3.5, ipython and jupyter.
I created a Tenserflow environment with python 3.5 using conda create -n tensorflow python=3.5. That worked.
Then I ran conda install -c conda-forge tensorflow. That also worked.
Then I installed ipython with conda install ipython, which also worked fine.
However, when I ran pip3 install jupyter, I got error message bash: pip3: command not found.
I found a few posts about variations on pip3 problems and (within the Tensorflow environment):
When I type pip --version, it tells me I have version 8.1.2
When I try locate pip3, I get WARNING: The locate database (/var/db/locate.database) does not exist
I tried using pip-3.2 as recommended in one of the other questions' solutions (which worked for that OP), and I get the same command not found error message.
I'm using OS X 10.8.5
pip is different from pip3. So you might need to install it if it can't be found. If it is installed run this:
sudo updatedb
this will update the locate function.
if you're using conda why do you want to install it with pip anyways?
Jupyter is the new version of ipython. running conda install ipython installs ipython (now jupyter).

Resources