Windows Anaconda Keras Install error - windows

Collecting keras
Using cached Keras-2.0.0.tar.gz
Collecting tensorflow (from keras)
Could not find a version that satisfies the requirement tensorflow (from keras) (from versions: )
No matching distribution found for tensorflow (from keras)

Your question definitely needs more info, but probably you need to install the right version of tensorflow first.
Keras 2 goes well with tensorflow 1, which goes well with python 3.5. If your anaconda runs python 2 or 3.6, first create a python 3.5 conda environment, and install tensorflow and keras there:
conda create -n myenv python=3.5 anaconda
activate myenv
(myenv) pip install tensorflow
(myenv) conda install keras

Related

Conda CMD Crashes Upon Theano Installation

Here are all the lines that I used to install theano:
# Create env.
conda create --name PyMC3 python=3.6
# Activate
activate PyMC3
# update pip
python -m pip install --upgrade pip
# Install theano reqirements
conda install numpy scipy mkl-service libpython m2w64-toolchain
# Install theano
conda install theano pygpu
I have CUDA drivers installed, which I use for tensorflow in another environment.
At the end of the installation, the CMD closes itself. Then every time I type:
activate PyMC3
It also closes / crashes.
At this time (March 14th of 2019), it seems like Theano doesn't support python 3.6, even though there is a conda package for it.
I used python 3.5 and it installs.

Installing PyTorch via Conda

Objective: Create a conda environment with pytorch and torchvision. Anaconda Navigator 1.8.3, python 3.6, MacOS 10.13.4.
What I've tried:
In Navigator, created a new environment. Tried to install pytorch and torchvision but could not because the UI search for packages does not find any packages available matching pytorch, torch, torchvision, or similar strings.
conda install pytorch torchvision -c pytorch
conda update --all
pytorch 0.3.1, torch 0.3.1, and torchvision 0.2.0 now appear as installed in the root environment. However, the root environment is no longer cloneable; the clone button is gray/disabled (it used be enabled/cloneable). I could use the root environment as a fallback but the main point of conda is to be able to create separate and disposable environments. What am I missing?
UPDATE -----------------
Running conda install -c pytorch pytorch yields:
# All requested packages already installed. But if I activate the pytorch environment and list the packages therein, there is no package containing the word "torch". If I then do conda search pytorch I get PackagesNotFoundError: The following packages are not available from current channels: - pytorch. If I activate the base environment and then do conda list then pytorch is in the package list for base. So how does one create a separate environment containing pytorch?
You seem to have installed PyTorch in your base environment, you therefore cannot use it from your other "pytorch" env.
Either:
directly create a new environment (let's call it pytorch_env) with PyTorch: conda create -n pytorch_env -c pytorch pytorch torchvision
switch to the pytorch environment you have already created with: source activate pytorch_env and then install PyTorch in it: conda install -c pytorch pytorch torchvision
I struggled with this and was reminded to RTFM (Read The F'ing Manual) documentation...
See Verify the installation with import torch not pytorch. which is from Pytorch

Installing tensorflow on anaconda/mac?

I can not find a solution to install tensorflow on anaconda/mac.
When i try: conda install tensorflow,
I get:
UnsatisfiableError: The following specifications were found to be in conflict:
- blaze -> numba -> numpy=1.13
- tensorflow
Use "conda info " to see the dependencies for each package.
I tried reinstalling numpy, and could not find any relevant documentation.
On mac use following command:
conda install -c conda-forge tensorflow
This will install the latest Tensorflow on your system. if you wish to upgrade it to newer version then you can use the following command
conda update -f -c conda-forge tensorflow
I have had success installing tensorflow through pip...
pip install tensorflow
or, if you have all of the proper libraries...
pip install tensorflow-gpu
But if you have already removed numpy form the anaconda install, you might be in for a long day because almost all of the numeric packages require it. If the above pip install doesn't work, you might want to start from a clean anaconda install.
I have installed tensorflow using -
pip install tensorflow
Or, you can use Anaconda in following way -
Open Anaconda Navigator
On Left side go to Environments
Create a new environment (eg :- tensorflow_tf), select python 3.7
then select Not installed and Search "tensorflow"
click on tensorflow and apply

How should I install keras if I have anaconda?

Which one should I use to install keras if I have anaconda?
conda install -c conda-forge keras
&
pip install --upgrade keras
Also, what is conda-forge? Why need to do it this way?
The advantages of using conda rather than pip to install packages in your Anaconda environment(s) are that:
conda should determine what dependencies your requested package has, and install those too in one operation, and
you can then keep the installed packages up to date using the conda update command:
pip, PyPI, and setuptools?
None of this is going to help with updating packages that have been
installed from PyPI via pip, or any packages installed using python
setup.py install. conda list will give you some hints about the
pip-based Python packages you have in an environment, but it won’t do
anything special to update them.
The conda-forge channel is where you can find packages that have been built for conda but are not part of the official Anaconda distribution (yet).
See answers to this question for more detail on the two options (although bear in mind some of the answers may be out of date).

Pytorch install with anaconda error

I get this error:
C:\Users>conda install pytorch torchvision -c soumith
Fetching package metadata .............
PackageNotFoundError: Package missing in current win-64 channels:
- pytorch
I got conda install pytorch torchvision -c soumith from Pytorch official website and I have OSX/conda/3.6/none for settings on Pytorch site(should be correct). I am new to conda, any tips how to solve this?
Update: From PyTorch 0.4, there is an official Anaconda channel with packages for Windows as well.
You can install the latest pre-built (binary) version of PyTorch (GPU version by default) on windows using:
conda install -c pytorch pytorch
For CPU only version:
conda install -c pytorch pytorch-cpu
For specific version of CUDA say CUDA9.1:
conda install -c pytorch pytorch cuda91
Official instructions for windows are now available here
Old answer for previous versions (<0.4) of PyTorch on Windows:
It looks like you are on windows (win 64) and you are trying to install pytorch by choosing OSX because you don't have an option listed for win64 on pytorch site. (Correct me if that is not the case, I will revise my answer). -c soumith will use soumith's channel which only has packages for Linux and OSX not for windows. That is why you got that error when you ran conda from a windows machine.
You can install pytorch on windows through conda using this command:
conda install -c peterjc123 pytorch
This will fetch the pytorch package using peterjc123's channel which has packages for Win64.
You can install the torchvision package using pip like this:
pip install torchvision
On June,2019, The command generated at pytorch will require dependencies before it can be executed successfully. For example I chose stable pytorch 1.1 build with python 3.6 and Cuda 10.0. The command generated by pytorch page was as follows:
conda install pytorch torchvision cudatoolkit=10.0 -c pytorch
But it will not work if you have created a new conda environment like me. The step by step process for setting up pytorch is as follows:
First install the cudatoolkit as follows:
conda install -c anaconda cudatoolkit=10.0
Then install the mkl_fft as follows:
conda install -c anaconda mkl_fft
Assuming you will face no more dependency issues. Use the following command to setup pytorch:
conda install -c pytorch pytorch
This worked for me. But I had setup my new conda environment with scikit-learn and jupyter notebook before starting the pytorch setup. So if any dependency problem arise, it would be a good idea to install both scikit-learn and jupyter notebook as well.
Use the following commands to install pytorch on windows
for Windows 10 and Windows Server 2016, CUDA 8
conda install -c peterjc123 pytorch cuda80
for Windows 10 and Windows Server 2016, CUDA 9
conda install -c peterjc123 pytorch cuda90
for Windows 7/8/8.1 and Windows Server 2008/2012, CUDA 8
conda install -c peterjc123 pytorch_legacy cuda80
I have face similar problem because I have installed pytorch cpu only version. I tried everything and update pytorch to gpu version but nothing helped.
Simple solution is to create new environment and then install pytorch gpu version. It resolve my problem

Resources