TensorFlow 1.9.0 and Python 3.6.5 - python

I'm trying to upgrade to Tensorflow 1.9 within a conda environment (Ubuntu 16.04). I am using python 3.6.5. When I try this:
source activate myenv
sudo -H pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0rc0-cp36-cp36m-linux_x86_64.whl
I get the error:
tensorflow-1.9.0rc0-cp36-cp36m-linux_x86_64.whl is not a supported wheel on this platform.
Seems strange because the same thing worked fine for TF 1.8
TensorFlow seems to install fine without sudo -H but then when I try:
python -c "import tensorflow as tf; print(tf.__version__)"
I get the following error:
from tensorflow.python.keras._impl.keras.backend import abs
ImportError: cannot import name 'abs'
I can't install from conda because it still has 1.8 when I check with:
conda install -c conda-forge tensorflow

With sudo you're installing locally. So, remove sudo -H to install over your Environment.
also, you need the python developer library locally:
Ubuntu: apt-get install python3-dev
RHEL/Fedora: dnf install python3-devel
Mac OS: check your environment variables or try re-installing?
Windows: check your environment variables or try re-installing?

Sometimes because of outdated pip also this can happen . Try this inside that environment and let me know
python -m pip install --upgrade pip
Try to check if conda has 1.9
conda install -c conda-forge tensorflow
I figured out that this Tensorflow is a pre-release not the complete release, as a result you can upgrade it using pip directly.
You can remove your installed release and try to install this else wait for couple of weeks after that you can directly update via conda forge or pip.

Related

AWS EC2 Python ModuleNotFoundError

I am using an EC2 instance with Deep Learning AMI based on Ubuntu 18.04.
I am doing the following:
Start the terminal
Activate the conda environment: conda activate tensorflow2_latest_p37
Install the package pip3 install tensorrt
Run my code python3 mycode.py
And I get the following error:
ModuleNotFoundError: No module named 'tensorrt'
I also trying to install as sudo or with -U or -m option. Nothing work. I can't install with conda install because tensorrt is not available in it.
pip3 will use ubuntu's level pip3, not from anaconda. You can confirm this by using which pip3 after you activate your environemnt. ALso tensorrt is not available for python other then 3.6
So to install tensorrt on Ubuntu 18.04 Deep Learnig:
conda activate tensorflow2_p36
# then in tensorflow2_p36 environment
pip install nvidia-pyindex
pip install --upgrade nvidia-tensorrt

Upgrading pip for different versions of python

I have two versions of python installed on my computer (3.6 and 3.7). Just upgraded pip to the latest version (19.0.1) using the command python -m pip install --upgrade pip however i think it only upgraded the pip for python version 3.6. When attempting to install a package specifically for python version 3.7 with the following command pip3.7 install scipy i got the message saying You are using pip version 18.1, however version 19.0.1 is available. Clearly only the pip for version 3.6 was upgraded. I cannot figure out a command to upgrade 3.7 pip as well. I tried the following:
python -m pip3.7 install --upgrade pip
This did not work (Trying to use the logic of how packages are handled for different versions of python). Could not find a question that addressed this specific issue. Any help would be greatly appreciated.
Use the python 3.7 interpreter to run the command:
python3.7 -m pip install --upgrade pip
Or use the pip3.7 binary directly:
pip3.7 install --upgrade pip
export LD_LIBRARY_PATH=/usr/lib64
activate pip3
I ran into the same problem. If you have Microsoft Visual also installed the best command to use is
py -m pip install --upgrade pip --user
I used that command, and it worked like a charm.

pip is a package and cannot be directly executed

Im trying to install google assistant on my Raspberry Pi, but when I keep getting an error: pip is a package and cannot be directly executed
Instead of
pip [...]
Try doing
python -m pip [...]
Can't really help more without more info.
I think your version of pip is old. You need to upgrade it first, like this:
pip install -U pip
You may need to upgrade setuptools too:
pip install -U setuptools
Since google-assistant-library is available as a wheel, you need to install wheel too:
pip install wheel
I don't know if you can do that with Raspberry Pi, but I recommend you to used a virtualenv. That way, you have a fresh and isolated Python executable and a recent version of pip.
virtualenv your_proj
source your_proj/bin/activate
pip install wheel
pip install google-assistant-library
For newer version ie. using pip3:
pip3 install -U <<package name>>
I had the same problem.
I think it was an outcome of a failed
> .\python.exe -m pip install --upgrade pip
do to some environment misconfiguration.
So it first removed the existing version 10.0.1, and then the installation of the new version 22.3.1 failed, leaving me with no pip.
From official documentation, I ran
> .\python.exe -m ensurepip --upgrade
which restored the original pip 10.0.1.
Then I fixed the environment problem, and then again
> .\python.exe -m pip install --upgrade pip
I now have pip 22.3.1.

how to install python package on azure hdinsight pyspark3 kernel?

I would like to install python 3.5 packages so they would be available in Jupyter notebook with pyspark3 kernel.
I've tried to run the following script action:
#!/bin/bash
source /usr/bin/anaconda/envs/py35/bin/activate py35
sudo /usr/bin/anaconda/envs/py35/bin/conda install -y keras tensorflow theano gensim
but the packages get installed on python 2.7 and not in 3.5
You can use:
#!/usr/bin/env bash
/usr/bin/anaconda/envs/py35/bin/conda install -y ...
or (if conda doesn't have the package)
/usr/bin/anaconda/envs/py35/bin/pip install ...
According to the help information of the command conda help install, there is a parameter -n ENVIRONMENT to do the package installation on a specified environment like envs/py35, the explaination as below.
$ conda help install
.......
-n ENVIRONMENT, --name ENVIRONMENT
Name of environment (in
/home/sshuser/.conda/envs:/usr/bin/anaconda/envs).
So you can install these packages you want via the command as below.
sudo /usr/bin/anaconda/bin/conda install -y keras tensorflow theano gensim -n py35
Hope it helps.
Have you tried installing using pip?
In some cases where you have both Python 2 and Python 3, you have to run pip3 instead of just pip to invoke pip for Python 3.

install Tensorflow 1.0 on windows by Anaconda error

By following the instructions on Tensorflow website, I tried to install cpu-only version Tensorflow by Anaconda. However, the 4th step
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl
outputs an error:
tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl is not a supported wheel on this platform. Could anyone tell me the reason behind this?
The command on the website is currently wrong. Replace x86_64 at the end of the URL with amd64 to get the correct command:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_amd64.whl
Alternatively you can use the following simpler command to install the latest CPU version:
pip install --ignore-installed --upgrade tensorflow
I think your problems could be one of this:
your python version is not Python3.5
Your system is not x64 windows.
So you can change install method below.
You can install tensorflow with pip direct like this:
pip install tensorflow
but this works only pip version > 9,
if you're using pip version under 9, you have to upgrade pip first.
you can upgrade your pip with this:
pip install -U pip
if you've installed python for all user, you might run this code with administrator account.

Categories

Resources