Anaconda install keras-tuner in tensorflow environment - tensorflow

I am using Anaconda 3 and would like to install keras-tuner in the tensorflow environment.
I've tried
conda install -c conda-forge keras-tuner
in the Anaconda Prompt (see https://anaconda.org/conda-forge/keras-tuner) which worked fine. However, the package has been installed in the base environment (and not in the tensorflow environment).
How can I choose the environment in which I want to install keras-tuner?
I use tensorflow 2.1.0 on a Windows machine

There are multiple ways of doing it.
activating the target environment and running the same command.
You can install a conda package also without activating the environment. Just use
conda install -n <env_name> <package> or conda install -p <path/to/env> <package>

Related

Problem with installing tensorflow on windows along with pytorch using conda environment

I am trying to install "Tensorflow" on windows using conda environment.
Please note that -
I am installing tensorflow along with pytorch in the same environment.
I am getting "Remove Error": 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.
I getting this error with both of these commands
pip install tensorflow
conda install tensorflow
A snap of the error can be seen below.
I sorted this issue by fixing the installation of the "httptools".
I recently found that many of the conda supports of have been migrated to conda forge.
HENCE, BEFORE INSTALLING THE TENSORFLOW. I INSTALLED THE "httptool" using the following command in the anaconda prompt.
conda install -c conda-forge httptools
Now everything works really fine.

What's the minimal conda environment build for pandas?

I'm using Miniconda 3, and I'm trying to build a minimal Conda environment containing pandas. However, when I try to load the pandas module, Jupyter gives me the following error:
The kernel appears to have died. It will restart automatically.
When doing the same thing via Python in the Terminal, Python crashes.
I have created a minimal Conda environment, which can be reproduced via the code below.
conda create -n testenv
conda activate testenv
conda install python
conda install pandas
conda install jupyter
The problem doesn't occur anymore when I follow up with a full Anaconda install, via conda install anaconda.
Any ideas as to how this problem can be resolved without installing Anaconda?
I figured out what the problem was. What I should have mentioned is that I built a global channel list according to Bioconda recommendation, using
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
This makes conda-forge the highest-priority channel. For reasons I don't understand, conda-forge builds a dependency hell. (I noticed the guys at conda-forge: https://github.com/conda-forge/pandas-feedstock/issues/63).
For now, install using conda install -c defaults pandas.

conda install -c conda-forge tensorflow just stuck in Solving environment

I am trying to run this statement in MacOS.
conda install -c conda-forge tensorflow
It just stuck at the
Solving Environment:
Never finish.
$ conda --version
conda 4.5.12
Nothing worked untill i ran this in conda terminal:
conda upgrade conda
Note that this was for poppler (conda install -c conda-forge poppler)
On win10 I waited about 5-6 minutes but it depends of the number of installed python packages and your internet connection.
Also you can install it via Anaconda Navigator
One can also resolve the "Solving environment" issue by using the mamba package manager.
I installed tensorflow-gpu==2.6.2 on Linux (CentOS Stream 8) using the following commands
conda create --name deeplearning python=3.8
conda activate deeplearning
conda install -c conda-forge mamba
mamba install -c conda-forge tensorflow-gpu
To check the successful usage of GPU, simply run either of the commands
python -c "import tensorflow as tf;print('\n\n\n====================== \n GPU Devices: ',tf.config.list_physical_devices('GPU'), '\n======================')"
python -c "import tensorflow as tf;print('\n\n\n====================== \n', tf.reduce_sum(tf.random.normal([1000, 1000])), '\n======================' )"
References
Conda Forge blog post
mamba install instead of conda install
The same error happens with me .I've tried to install tensorboard with anaconda prompt but it was stuck on the environment solving .So i've added these paths to my environment variables:
C:\Anaconda3
C:\Anaconda3\Library\mingw-w64\bin
C:\Anaconda3\Library\usr\bin
C:\Anaconda3\Library\bin
C:\Anaconda3\Scripts
and it worked well.
Follow the instruction by nekomatic.
I left it running for 1 hour. Yes. it is finally finished.
But now I got the conflicts
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- anaconda==2018.12=py37_0 -> bleach==3.0.2=py37_0
- anaconda==2018.12=py37_0 -> html5lib==1.0.1=py37_0
- anaconda==2018.12=py37_0 -> numexpr==2.6.8=py37h7413580_0
- anaconda==2018.12=py37_0 -> scikit-learn==0.20.1=py37h27c97d8_0
- tensorflow
Use "conda info <package>" to see the dependencies for each package.

How to make default environment as conda environment in Spyder

I have installed tensorflow in conda environment and managed to connect it to jupyter by installing nb_conda and its working. But in Spyder it still shows "tensorflow module name not found" (perhaps Spyder is not connected to the conda environment). I have two questions :
1. How to enable Spyder to connect with conda environment so that I can run tensorflow
2. How to change default environment from "root" in conda prompt to my own created environment.
Spyder runs in the conda enviroment in which it is installed. With Anaconda install, you get it installed in the base interpreter.
For TensorFlow, create a new conda enviroment.
Install tensorflow in it.
conda install tensorflow
Install Spyder in the same enviroment.
conda install spyder
Or, directly install tensorflow in the base interpreter. Open the Anaconda prompt and enter ,
( base ) $ conda install tensorflow

Conda install tensorflow - Unsatisfiable error [duplicate]

This is the error :
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- numba -> numpy[version='>=1.14,<1.15.0a0']
- tensorflow
Use "conda info " to see the dependencies for each package.
You have to run the conda info tensorflow and conda info numba to see each dependencies for each package and then you have to install those package like conda install package=version to fix the problem.
First create a conda environment if you would like using
conda create -n my_env python=3.6
Here "my_env" is the name of my environment
Then activate your environment using
source activate my_env #(for mac)
conda activate my_env #(for windows)
Once the Environment is active. you can now install the packages you need as follows:I am showing you the packages which i work upon on virtual environment and this will take care of most of your dependencies
conda update conda
conda upgrade conda
conda upgrade anaconda
conda update numpy
conda install tensorflow
Hope this will solve your problem or else try to upgrade numpy using pip:
pip install --upgrade numpy