Anaconda installation of Tensorflow fails with Debian 8 VirtualBox - python

I'm trying to install Tensorflow.
I created a fresh Debian 8 VirtualBox for this purpose. Following the instructions here I downloaded and installed Anaconda with Python 3.
I created a conda environment for Tensorflow and activated it.
When trying to pip install Tensorflow it fails:
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl
The error is
not a supported wheel on this platform
I found a similar thread where a person had this problem with Python 2.7 and VMware, but their solution didn't work for me (and also not for another person who commented that they were using VirtualBox).
I also tried specifying pip3 and pip3.5 rather than just pip.

This appears to be a "known" issue from the following issue. Which paraphrased you should be able to download https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl and change the name of the .whl to tensorflow-0.8.0-py3-none-linux_x86_64.whl and install it correctly. There has been a change to the github documentation for Tensorflow to set the python version to 3.4 instead of 3.5. However, it appears this change hasn't made it to Tensorflow.org's documentation
# Python 3.4
$ conda create -n tensorflow python=3.4

Related

How to use lower version of keras and tensorflow

I'm running a code which requires keras version 1.2.0 and tensorflow version 1.1.0.
I'm using Jupyter notebook and I created an environment for all the dependencies.
However, I mistakenly installed both libraries again through pip command which installed the latest versions.
I closed the notebook, opened it again and created the environment once again so the older version of both libraries were installed again.
But when I run keras.__version___ command, it shows 2.4.3, which i do not want.
I also ran conda remove keras --force and pip uninstall keras, but it's still showing the latest version.
The code is only compatible with the older version. Please help.
It's probably because it is getting uninstalled on a different environment. Identify which python and pip executable you are using by running the following commands:
$ which pip
$ which python
These two commands will give out the path of the executable from which we can determine the environment. If it is different from what you were using you can try installing to the desired environment by running:
/path/to/desired/pip uninstall keras
/path/to/desired/pip install keras==1.2.0

tensorflow installation in python 3.9.0(64 bit) and pip version 20.2.3 .?

I want to install TensorFlow, I have tried everything from reinstalling everything to trying different versions it doesn't help.
I have tried it with python 3.9.0 and pip version 20.0.3
Currently (1st of March, 2021), there is no official stable tensorflow version for the latest stable python 3.9.
However, nightly version of tensorflow supports python 3.9.
Simply pip install tf-nightly-gpu or pip install tf-nightly
Note, the library name is the same, e.g. importing works as import tensorflow as tf without any problems. This means you will not have to update your code once official support is added and you've migrated to the stable version.
The Official TensorFlow website specifies python 3.5-3.8.
You need to create a new environment as suggested in the previous answer with a new version of python, or uninstall python 3.9 and install other version. I use python 3.6.8 for Tensorflow and it works great.
I had the similar problem but I am able to resolve it by downloading the python version 3.8.6 and installing it. Please pay attention to add the python and the respective pip path in the environment.
Then give the command, which will install tensorflow version 2.3.1
pip install tensorflow
You may upgrade the pip by following command,
py -m pip install --upgrade pip
I hope that it works for you.

Installing a package from git in Anaconda environment which is afterwards not recognized in Python

I'm trying to install a python package directly from github. In my case that's SciANN. When I selected my environment in conda using conda activate myenv and afterwards install this package as explained in this post using the following lines of code:
conda install git pip
pip install git+git://github.com/sciann/sciann.git
it is successfully installed and I get the message "Successfully built SciANN" in the end of the insatllation procedure. When I then open spyder and type import sciann I get the error ModuleNotFoundError: No module named 'sciann'. I also tried to use pip3 instead of pip but this did not change something.
Have I missed something? Is this package now installed correctly into my environment myenv?
The deleted answer from Jay Prakash together with the comments brought me on track. Yes there can be different versions of packages installed. So in my case SciANN was installed using pip as they currently do not offer a conda installation while all my other packages where installed with conda. I ended up having two different versions of tensorflow installed, one from pip and one from conda so I deleted one. Additionally I used Python version 3.7 while this package supports only up to 3.6. And I had to use a non official tensorflow version because my CPU does not support AVX which is a whole new topic.

Unavailable to install Tensorflow 1.x on Ubuntu 20.04 LTS using pip

I have a reason that I should use Tensorflow 1.x release, but it returns an error with message:
ERROR: Could not find a version that satisfies the requirement tensorflow==1.15.2 (from versions: 2.2.0.rc1 ~~~~~
ERROR: No matching disribution found for tensorflow==1.15.2
I also tried .whl installation but the latest Tensorflow 1.15.2 support cp37 which I can't use it anymore.
Is tensorflow 1.x is no longer supported on pip or pypi? Or should I downgrade python(3.8 > 3.7) and install Tensorflow using .whl file?
[System Environment]
Ubuntu 20.04 LTS
Python version : 3.8.2
pip version : 20.0.2
Thanks.
According to tensorflow installation guide tensorflow is available on Python 3.5–3.7 you are using a newer version of Python.
The answer above is outdated
Tensorflow supports Python 3.8 now, but Python 3.8 support requires
TensorFlow 2.2 or later
pip 19.0 or later
Ubuntu 16.04 or later
macOS 10.12.6 (Sierra) or later
Windows 7 or later
Raspbian 9.0 or later
Also GPU support requires a CUDA-enabled card (Ubuntu and Windows)
You can check your Python and pip version with these commands:
python --version | python3 --version
Out: Python 3.8.2
pip --version | pip3 --version
Out: pip 20.1.1
You can upgrade your pip with:
pip install --upgrade pip
More info can be found on this link: Install TensorFlow with pip
I would recommend that you avoid installing third-party Python libraries system-wide using pip that will then rely on your system Python. You also really don't want to avoid manually upgrading/downgrading your system Python.
I prefer to use Conda to install TensorFlow. Instructions for installing Conda on Linux are pretty straightforward.
Once you have installed Conda you can install TensorFlow 1.15 with a single command.
conda create --name tensorflow-15 \
tensorflow-gpu=1.15 \
cudatoolkit=10.1 \
cudnn=7.6 \
nccl=2.4 \ # only relevant if you have more than one GPU
python=3.6 \
pip=20.0
One of the many things I like about Conda is that it provides a single tool to manage environments and packages within a particular environment. It also has a much gentler learning curve compared with other tools for isolating software environments like Docker.
If you are interested in learning more about Conda, then you can check out these teaching materials that I am developing.
https://carpentries-incubator.github.io/introduction-to-conda-for-data-scientists/
Seems more and more we have to switch to using containers (Docker, and probably cloud VMs), because everything is incompatible with everything. Yes, you can start a Docker container running Python 3.7 and Tensorflow 1.x, on any version of Linux, but then you want to load files from that container, you have to pass black-magic command line options to mount volumes. Tried using Tensorflow 2 and everything fails. No more tf.Session(), no more tf.global_variables_initializer(), etc. So no working Tensorflow in Ubuntu, you have to use Docker.
Try to isolate your dependencies by using Docker or conda environments, I used:
conda create -n new_env python=3.6 tensorflow-gpu=1.2.1 anaconda
and works fine:)

How do you install Tensorflow on Windows?

I am trying to install Tensorflow on Windows.
I have Anaconda 4.2.0. I tried running
conda create -n tensorflow python=3.5
in my command prompt. This seemed to do something, but I'm not sure what this accomplished. It created a folder within the Anaconda3 program in my username folder.
This folder is filled with the following content:
Over the summer, I used mainly Jupyter Notebooks to do my python coding. Within this environment, there is a tab marked Condas
So it looks like I should be able to switch to the Tensorflow environment. But this doesn't work when I try to switch, there is no option to change my kernel to a Tensorflow one.
I tried running
conda search tensorflow
But nothing appears.
I'm not sure what to do. I asked a few grad students in my economics research group, but they weren't sure what to do either.
My Question
How do I properly install Tensorflow on Windows?
The syntax of the command is conda create -n <name_of_new_env> <packages>. As a result, you created a clean environment named tensorflow with only Python 3.5 installed. Since conda search tensorflow returned nothing, you will have to use pip or some other method of installing the package. Since there is spotty official support for Windows, the conda-forge package (CPU only) at https://github.com/conda-forge/tensorflow-feedstock is probably the best way.
People have also reported success installing Tensorflow with docker, if you have docker set up already.
I was able to run it under the Windows 10 linux subsystem (https://msdn.microsoft.com/en-us/commandline/wsl/install_guide)
Which is basically a linux environment within windows.
The latest tensorflow version (0.12) added windows support
https://www.tensorflow.org/get_started/os_setup#pip_installation_on_windows
just run:
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl
(the url is for the specific version - you will need to change it for future versions or other setups)
An Anaconda environment isolates itself completely with the outer world, so all the packages you installed outside the virtualenv is nothing in the virtualenv, if you want to use Tensorflow in the environment(seems like the only way with Anaconda), use activate tensorflow command and install the packages you want seperately.
pip provides an easy method to install tensorflow on windows machine.
use the following pip command
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
Tensorflow only support python3.5 x64 bit on windows machines and it requires that you install Visual C++ 2015 redistributable (x64 version) to be able to import tensorflow

Categories

Resources