how to install fastai on windows 10 - pip

I cant seem to install the right version of torch and I cant get fast ai libraries working
I try
Python 3.7
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1-cp37-cp37m-win_amd64.whl
pip3 install torchvision
Could not find a version that satisfies the requirement torch>=1.1.0 (from torchvision) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
No matching distribution found for torch>=1.1.0 (from torchvision)
I feel like I may of downgraded my gpu when I tried conda install fast ai
and then I tried pip and it couldnt find a file C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\caffe2\python\serialized_test\data\operator_test
I finally got to the point where it said successfully installed six, pillow, and torch but torch is at 0.3 which is incompatiable.
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1-cp37-cp37m-win_amd64.whl
pip3 install torchvision
expected to install pytorch or fastai nothing seems to work

You may try installing the course by creating a conda environment provided anaconda is already installed in your windows machine.
conda update conda
conda create -n fastai_conda python=3.6
conda activate fastai_conda
conda install fastai pytorch=1.0.0 -c fastai -c pytorch -c conda-forge
Or for installing CPU version you can use the below commands after the environment is created
conda install -c pytorch pytorch-cpu torchvision
conda install -c fastai fastai
You can check if installation went right with this command
python -m fastai.utils.show_install
You may further need to install ipykernel to use the conda environment in your jupyter notebook.For that activate environment and run the following commands:
conda install nb_conda_kernels
python -m ipykernel install --user --name fastai_v1 --display-name "fastai v1"
conda install ipywidgets

Related

ModuleNotFoundError: No module named 'dask_geopandas'

i have dask, dask-core and dask geopandas installed as shown:
dask 2021.7.1 pyhd8ed1ab_0 conda-forge
dask-core 2021.7.1 pyhd8ed1ab_0 conda-forge
dask-geopandas 0.1.0a4 pypi_0 pypi
however, when importing I kept getting an error message :
"ModuleNotFoundError: No module named 'dask_geopandas'"
I wonder what has gone wrong with installation, thank you.
This could happen if pip install and conda install installed packages in different paths (this typically happens when the conda environment does not have its own pip).
A simple way out of this is to install everything with conda, so in this case you would run the following within your conda environment:
conda install -c conda-forge dask dask-geopandas
Alternatively, make sure that your conda environment has pip installed also and then run the pip within the conda environment:
conda install -c conda-forge dask pip
# if the conda environment is not activate, then activate it
# using: conda activate the_name_of_your_env
pip install dask-geopandas
In addition, there are specific instructions at https://geopandas.readthedocs.io/en/latest/getting_started/install.html#installing-with-pip about extra steps you may need to take when using pip - you might need a compiler available in your system.

What are the differences between two methods- 'conda install anaconda' and 'conda install conda-forge' to install a package through conda?

One method of installing a package through conda is-
conda install -c anaconda lxml
And another is-
conda install -c conda-forge lxml
What are the differences between these two?
In the conda install -c or conda install --channel context, anaconda and conda-forge are CHANNELs to two different package repositories.
anaconda repo is managed by Anaconda, Inc. (https://anaconda.org/), and
conda-forge repo is managed through community effort. (See https://conda-forge.org/docs/user/introduction.html for more info).

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

Pip list shows only one version of `torch`, yet conda list shows two

pip list
conda list
I once install torch 0.1.12, then I remove it, and reinstall it.
How can I remove the 0.1.12 version?
If you install torch 0.1.12 with
conda install pytorch torchvision cuda80 -c soumith,
then just try
conda uninstall pytorch torchvision cuda80 -c soumith.
I tested on my mac and it successfully removed pytorch and all its dependencies, also pytorch 0.1.12 never shows in conda list later.
P.S.: a virtual environment is highly recommended with anaconda.

Tensorflow installation on Windows 10, error 'Not a supported wheel on this platform'

This question is for a Windows 10 laptop. I'm currently trying to install tensorflow, however, when I run:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl
I get the following error:
tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl is not a supported wheel on this platform.
I am trying to install the cpu-version only of tensorflow in an Anaconda 4.3.0 version. I had python 3.6.0 and then I downgraded to 3.5.0, none of them worked.
I also had same problem when I installed anaconda 4.3 version
Here is my solution.
Instead of using Anaconda3 4.3, install Anaconda3 4.2(Anaconda3-4.2.0-Windows-x86_64.exe)
Type on command line(If you are using GPU version)
pip install -U --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.0.0-cp35-cp35m-win_amd64.whl
Typeon command line(If you are using CPU only)
pip install -U --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_amd64.whl
I'm working on win10 with python version=3.5.2, 64 bit
You can use same version of anaconda and execute this command
conda create -n tensorflow python=3.5
activate tensorflow
pip install tensorflow-gpu
It worked for conda 4.0.8
So are you sure you correctly downgraded your python? Run this command on command line pip -V. This should print the pip version and the python version.
Inside your Anaconda environment, try running this:
pip install --upgrade tensorflow
This will do the job. The issue was discussed here also.
Here is the screenshot of how this helped me:
If you have python3 on Windows insatalled, you can use the following command(non GPU):
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0-py3-none-any.whl
Worked for me.

Resources