Howto: installation on Windows

to follow up to my prior issue, looks like it was a self-inflicted anaconda wound! After searching around for “jupyter kernel dead won’t restart” I landed on:

Apparently after multiple installs of anaconda you end up with a few kernel.json files (check the two highlighted)

when I compare the paths inside, the one in \envs\fastai… had the path:
C:/ProgramData/Anaconda3//envs/fastai/bin/python

while the main one in \share\jupyter… had:
C:\\ProgramData\\Anaconda3\\python.exe

After replacing the path from the fastai kernels.json with the one that contained the .exe , voila! Now the notebook successfully loads with a ready kernel!

Albeit another error on not finding spacy when trying to import

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-c51a52575a56> in <module>()
      1 # This file contains all the main external libs we'll use
----> 2 from fastai.imports import *

~\Documents\GitHub\fastai\courses\dl1\fastai\__init__.py in <module>()
----> 1 from .basic_train import *
      2 from .callback import *
      3 from .callbacks import *
      4 from .core import *
      5 from .data import *

~\Documents\GitHub\fastai\courses\dl1\fastai\basic_train.py in <module>()
      1 "Provides basic training and validation with `Learner`"
----> 2 from .torch_core import *
      3 from .data import *
      4 from .callback import *
      5 

~\Documents\GitHub\fastai\courses\dl1\fastai\torch_core.py in <module>()
      1 "Utility functions to help deal with tensors"
----> 2 from .imports.torch import *
      3 from .core import *
      4 
      5 AffineMatrix = Tensor

~\Documents\GitHub\fastai\courses\dl1\fastai\imports\__init__.py in <module>()
----> 1 from .core import *
      2 from .torch import *

~\Documents\GitHub\fastai\courses\dl1\fastai\imports\core.py in <module>()
      4 import abc, collections, hashlib, itertools, json, operator
      5 import mimetypes, inspect, typing, functools
----> 6 import html, re, spacy, requests
      7 
      8 from abc import abstractmethod, abstractproperty

ModuleNotFoundError: No module named 'spacy'

I tried to conda install -n fastai spacy and ran successfully, but still got the same error log

1 Like

switched link to …\old\fastai\ and getting this error

check the contents of your old\fastai folder vs the one in the repo. mine was somehow different, so i had to replace it manually with the correct one from the repo.

How did you figure out which ones to replace manually? The folders look way different:

\fastai

\fastai\old
image

\fastai\old\fastai

Anyone had issues with pytorch 1.0 finding CUDA on windows?

I’m trying to get fastai 1.0 up in windows, with cuda 9.0 installed. I’ve built pytorch and created a new conda env with py3.7 and:

Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type “help”, “copyright”, “credits” or “license” for more information.
import torch
print("PyTorch version: ", torch.version )
PyTorch version: 1.0.0a0+0e966fc
print("CUDA version: ", torch.version.cuda)
CUDA version: None
print(“CUDA available”, torch.cuda.is_available())
CUDA available False
print("CUDNN enabled: ", torch.backends.cudnn.enabled)
CUDNN enabled: True

previous environment still finds cuda

Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
import torch
print("PyTorch version: ", torch.version )
PyTorch version: 0.3.0b0+591e73e
print("CUDA version: ", torch.version.cuda)
CUDA version: 9.0
print("CUDNN enabled: ", torch.backends.cudnn.enabled)
CUDNN enabled: True

(deja vu… months back in this thread when i first installed fastai, cuda wasn’t found until after a couple reboots. - admittedly I’ve only tried one reboot this time)

still having issues with dead kernel when trying to run notebooks.

Reinstalled anaconda and reinstalled fastai from github. Cleared conda cache. Ran conda env update and then manually had to add pyproj and shapely using conda install -n fastai pkgname.

after looking up jupyter kernelspec list appears I have two (depending if I activate fastai or not):
image

The contents of kernel.json @ C:\Users\Stephen\Anaconda3\share\jupyter\kernels\python3 are…

{
 "argv": [
  "C:\\Users\\Stephen\\Anaconda3\\python.exe",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3",
 "language": "python"
}

The contents of kernel.json @ C:\Users\Stephen\Anaconda3\envs\fastai\share\jupyter\kernels\python3 are…

{
 "argv": [
  "C:/Users/Stephen/Anaconda3/envs/fastai/bin/python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3",
 "language": "python"
}

the …/bin/python folder directory doesn’t exist though - could this be it? should I modify this and where should it be pointing to?

my fastai conda info (rolled my recent post into this one)

 active environment : fastai
active env location : C:\Users\Stephen\Anaconda3\envs\fastai
        shell level : 2
   user config file : C:\Users\Stephen\.condarc
 populated config files : C:\Users\Stephen\.condarc
      conda version : 4.5.11
conda-build version : 3.10.5
     python version : 3.6.5.final.0
   base environment : C:\Users\Stephen\Anaconda3  (writable)
       channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                      https://repo.anaconda.com/pkgs/main/noarch
                      https://repo.anaconda.com/pkgs/free/win-64
                      https://repo.anaconda.com/pkgs/free/noarch
                      https://repo.anaconda.com/pkgs/r/win-64
                      https://repo.anaconda.com/pkgs/r/noarch
                      https://repo.anaconda.com/pkgs/pro/win-64
                      https://repo.anaconda.com/pkgs/pro/noarch
                      https://repo.anaconda.com/pkgs/msys2/win-64
                      https://repo.anaconda.com/pkgs/msys2/noarch
      package cache : C:\Users\Stephen\Anaconda3\pkgs
                      C:\Users\Stephen\AppData\Local\conda\conda\pkgs
   envs directories : C:\Users\Stephen\Anaconda3\envs
                      C:\Users\Stephen\AppData\Local\conda\conda\envs
                      C:\Users\Stephen\.conda\envs
           platform : win-64
         user-agent : conda/4.5.11 requests/2.18.4 CPython/3.6.5 Windows/7 W
indows/6.1.7601
      administrator : True
         netrc file : None
       offline mode : False

# packages in environment at C:\Users\Stephen\Anaconda3\envs\fastai:
#
# Name                    Version                   Build  Channel
asn1crypto                0.24.0                py36_1003    conda-forge
atomicwrites              1.2.1                      py_0    conda-forge
attrs                     18.2.0                     py_0    conda-forge
backcall                  0.1.0                      py_0    conda-forge
bcolz                     1.2.1                    py36_1    conda-forge
beautifulsoup4            4.6.3                     <pip>
blas                      1.0                         mkl
bleach                    3.0.0                      py_0    conda-forge
blosc                     1.14.4            h6538335_1000    conda-forge
bokeh                     0.13.0                   py36_0    conda-forge
boto3                     1.9.16                     py_0    conda-forge
botocore                  1.12.17                    py_0    conda-forge
bzip2                     1.0.6                    vc14_1  [vc14]  conda-forge
ca-certificates           2018.8.24            ha4d7672_0    conda-forge
certifi                   2018.8.24             py36_1001    conda-forge
cffi                      1.11.5          py36hfa6e2cd_1001    conda-forge
chardet                   3.0.4                 py36_1003    conda-forge
click                     7.0                        py_0    conda-forge
click-plugins             1.0.4                      py_0    conda-forge
cliff                     2.8.2                     <pip>
cligj                     0.5.0                      py_0    conda-forge
cloudpickle               0.5.6                      py_0    conda-forge
cmd2                      0.9.4                     <pip>
colorama                  0.3.9                      py_1    conda-forge
configparser              3.5.0                     <pip>
cryptography              2.3.1           py36h74b6da3_1000    conda-forge
cssselect                 1.0.3                     <pip>
cuda90                    1.0                           0    pytorch
cudatoolkit               9.0                           1
cudnn                     7.1.4                 cuda9.0_0
curl                      7.60.0                   vc14_0  [vc14]  conda-forge
cycler                    0.10.0                     py_1    conda-forge
cymem                     1.31.2              py36_vc14_0  [vc14]  conda-forge
cython                    0.28.5          py36h6538335_1000    conda-forge
cytoolz                   0.9.0.1         py36hfa6e2cd_1001    conda-forge
dask                      0.19.3                     py_0    conda-forge
dask-core                 0.19.3                     py_0    conda-forge
decorator                 4.3.0                      py_0    conda-forge
descartes                 1.1.0                     <pip>
dill                      0.2.8.2               py36_1000    conda-forge
distributed               1.23.3                   py36_0    conda-forge
docutils                  0.14                  py36_1001    conda-forge
entrypoints               0.2.3                 py36_1002    conda-forge
expat                     2.2.5                    vc14_0  [vc14]  conda-forge
feather-format            0.4.0                     <pip>
fiona                     1.8a3            py36h2fc6367_0    conda-forge
freetype                  2.9.1             he8b6a0d_1004    conda-forge
freexl                    1.0.5                    vc14_0  [vc14]  conda-forge
gdal                      2.2.4            py36h2fc6367_1    conda-forge
geopandas                 0.4.0                     <pip>
geos                      3.6.2                he025d50_3    conda-forge
geotiff                   1.4.2                    vc14_1  [vc14]  conda-forge
graphviz                  0.9                       <pip>
hdf4                      4.2.13                   vc14_0  [vc14]  conda-forge
hdf5                      1.10.2                   vc14_0  [vc14]  conda-forge
heapdict                  1.0.0                 py36_1000    conda-forge
html5lib                  1.0.1                      py_0    conda-forge
icc_rt                    2017.0.4             h97af966_0
icu                       58.2                     vc14_0  [vc14]  conda-forge
idna                      2.7                   py36_1002    conda-forge
intel-openmp              2019.0                      118
ipykernel                 5.0.0              pyh24bf2e0_1    conda-forge
ipython                   7.0.1            py36h39e3cac_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.4.2                      py_0    conda-forge
isoweek                   1.3.3                     <pip>
jedi                      0.13.1                py36_1000    conda-forge
jinja2                    2.10                       py_1    conda-forge
jmespath                  0.9.3                      py_1    conda-forge
jpeg                      9c                hfa6e2cd_1001    conda-forge
jsonschema                2.6.0                 py36_1002    conda-forge
jupyter                   1.0.0                      py_1    conda-forge
jupyter_client            5.2.3                      py_1    conda-forge
jupyter_console           6.0.0                      py_0    conda-forge
jupyter_core              4.4.0                      py_0    conda-forge
kaggle-cli                0.12.13                   <pip>
kealib                    1.4.9                h4380d0d_2    conda-forge
kiwisolver                1.0.1           py36he980bc4_1002    conda-forge
krb5                      1.14.6                   vc14_0  [vc14]  conda-forge
libgdal                   2.2.4                h47ac16f_8    conda-forge
libiconv                  1.15              hfa6e2cd_1003    conda-forge
libnetcdf                 4.6.1                ha2173a7_8    conda-forge
libpng                    1.6.35            h7602738_1002    conda-forge
libpq                     9.6.3                    vc14_0  [vc14]  conda-forge
libsodium                 1.0.16                   vc14_0  [vc14]  conda-forge
libspatialite             4.3.0a            h582a839_1023    conda-forge
libssh2                   1.8.0             hc4dcbb0_1002    conda-forge
libtiff                   4.0.9                    vc14_0  [vc14]  conda-forge
libxml2                   2.9.8             h9ce36c8_1005    conda-forge
locket                    0.2.0                      py_2    conda-forge
lxml                      4.0.0                     <pip>
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markupsafe                1.0             py36hfa6e2cd_1001    conda-forge
matplotlib                3.0.0            py36h7b168c4_1    conda-forge
MechanicalSoup            0.8.0                     <pip>
mistune                   0.8.3           py36hfa6e2cd_1002    conda-forge
mizani                    0.4.6                     <pip>
mkl                       2019.0                      118
mkl_fft                   1.0.6                    py36_0    conda-forge
mkl_random                1.0.1                    py36_0    conda-forge
more-itertools            4.3.0                 py36_1000    conda-forge
msgpack-numpy             0.4.3.2                    py_0    conda-forge
msgpack-python            0.5.6           py36he980bc4_1003    conda-forge
msys2-conda-epoch         20160418                      1
munch                     2.3.2                      py_0    conda-forge
murmurhash                0.28.0              py36_vc14_0  [vc14]  conda-forge
nbconvert                 5.3.1                      py_1    conda-forge
nbformat                  4.4.0                      py_1    conda-forge
notebook                  5.7.0                 py36_1000    conda-forge
numexpr                   2.6.6                    py36_0    conda-forge
numpy                     1.15.2           py36ha559c80_0
numpy-base                1.15.2           py36h8128ebf_0
olefile                   0.46                       py_0    conda-forge
opencv-python             3.4.3.18                  <pip>
openjpeg                  2.3.0             h25a6d84_1003    conda-forge
openssl                   1.0.2p            hfa6e2cd_1000    conda-forge
packaging                 18.0                       py_0    conda-forge
palettable                3.1.1                     <pip>
pandas                    0.23.4           py36h830ac7b_0    conda-forge
pandas-summary            0.0.5                     <pip>
pandoc                    2.3.1                         0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parso                     0.3.1                      py_0    conda-forge
partd                     0.3.8                      py_1    conda-forge
path.py                   11.0.1                     py_0    conda-forge
patsy                     0.5.0                      py_1    conda-forge
pbr                       4.3.0                     <pip>
pcre                      8.41                     vc14_1  [vc14]  conda-forge
pexpect                   4.6.0                 py36_1000    conda-forge
pickleshare               0.7.5                 py36_1000    conda-forge
pillow                    5.3.0           py36h9a613e6_1000    conda-forge
pip                       18.1                  py36_1000    conda-forge
plac                      0.9.6                      py_1    conda-forge
plotnine                  0.4.0                     <pip>
pluggy                    0.7.1                      py_0    conda-forge
preshed                   1.0.0               py36_vc14_0  [vc14]  conda-forge
prettytable               0.7.2                     <pip>
progressbar2              3.34.3                    <pip>
proj4                     4.9.3                    vc14_5  [vc14]  conda-forge
prometheus_client         0.4.0                      py_0    conda-forge
prompt_toolkit            2.0.5                      py_0    conda-forge
psutil                    5.4.7           py36hfa6e2cd_1001    conda-forge
py                        1.6.0                      py_0    conda-forge
pyarrow                   0.10.0                    <pip>
pycparser                 2.19                       py_0    conda-forge
pygments                  2.2.0                      py_1    conda-forge
PyHamcrest                1.9.0                     <pip>
pyopenssl                 18.0.0                   py36_0    conda-forge
pyparsing                 2.2.2                      py_0    conda-forge
pyperclip                 1.7.0                     <pip>
pyproj                    1.9.5.1                  py36_0
pyqt                      5.6.0            py36h764d66f_7    conda-forge
pyreadline                2.1                   py36_1000    conda-forge
pysocks                   1.6.8                 py36_1002    conda-forge
pytables                  3.4.4            py36h7e76658_1    conda-forge
pytest                    3.8.2                 py36_1000    conda-forge
python                    3.6.6                he025d50_0    conda-forge
python-dateutil           2.7.3                      py_0    conda-forge
python-utils              2.3.0                     <pip>
pytorch                   0.3.1           py36_cuda90_cudnn7he774522_2  [cuda90]
  peterjc123
pytz                      2018.5                     py_0    conda-forge
pywinpty                  0.5.4                 py36_1002    conda-forge
pyyaml                    3.13            py36hfa6e2cd_1001    conda-forge
pyzmq                     17.1.2          py36hf576995_1000    conda-forge
qt                        5.6.2                    vc14_1  [vc14]  conda-forge
qtconsole                 4.4.1                    py36_1    conda-forge
regex                     2017.11.09               py36_0    conda-forge
requests                  2.19.1                   py36_1    conda-forge
s3transfer                0.1.13                py36_1001    conda-forge
scikit-learn              0.20.0                    <pip>
scipy                     1.1.0            py36h4f6bf74_1
seaborn                   0.9.0                      py_0    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                40.4.3                   py36_0    conda-forge
shapely                   1.6.4            py36hc90234e_0
simplegeneric             0.8.1                      py_1    conda-forge
sip                       4.18.1           py36h6538335_0    conda-forge
six                       1.11.0                py36_1001    conda-forge
sklearn-pandas            1.7.0                     <pip>
sortedcontainers          2.0.5                      py_0    conda-forge
spacy                     2.0.12           py36h830ac7b_0    conda-forge
sqlite                    3.25.2            hfa6e2cd_1000    conda-forge
statsmodels               0.9.0                    py36_0    conda-forge
stevedore                 1.29.0                    <pip>
tblib                     1.3.2                      py_1    conda-forge
termcolor                 1.1.0                      py_2    conda-forge
terminado                 0.8.1                 py36_1001    conda-forge
testfixtures              6.3.0                      py_0    conda-forge
testpath                  0.3.1                    py36_1    conda-forge
thinc                     6.10.3           py36h830ac7b_3    conda-forge
tk                        8.6.8                    vc14_0  [vc14]  conda-forge
toolz                     0.9.0                      py_1    conda-forge
torchtext                 0.2.3                     <pip>
torchvision               0.2.1                     <pip>
tornado                   4.5.3                    py36_0    conda-forge
tqdm                      4.26.0                     py_0    conda-forge
traitlets                 4.3.2                 py36_1000    conda-forge
ujson                     1.35            py36hfa6e2cd_1001    conda-forge
urllib3                   1.23                     py36_1    conda-forge
vc                        14                            0    conda-forge
vs2015_runtime            14.0.25420                    0    conda-forge
wcwidth                   0.1.7                      py_1    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.32.1                   py36_0    conda-forge
widgetsnbextension        3.4.2                 py36_1000    conda-forge
win_inet_pton             1.0.1                 py36_1002    conda-forge
wincertstore              0.2                   py36_1002    conda-forge
winpty                    0.4.3                         4    conda-forge
wrapt                     1.10.11         py36hfa6e2cd_1001    conda-forge
xerces-c                  3.2.0                    vc14_0  [vc14]  conda-forge
xz                        5.2.4             h2fa13f4_1001    conda-forge
yaml                      0.1.7                    vc14_0  [vc14]  conda-forge
zeromq                    4.2.5                    vc14_2  [vc14]  conda-forge
zict                      0.1.3                      py_0    conda-forge
zlib                      1.2.11                   vc14_0  [vc14]  conda-forge

I’ve removed the dependency on pyproj now, so you should be ok to install without a windows compiler after you git pull.

1 Like

Hi all,

Can anyone kindly help me with the installation of fast ai on windows 10. I dont have access to conda and git environment due to network restrictions.So im not able to install Fast ai libraries.so i used pip install and it gave the below error.

RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).
Please follow the instructions at http://pytorch.org/ to install with miniconda instead.

Command “python setup.py egg_info” failed with error code 1 in C:\Users\AppData\Local\Temp\pip-build-zi9bjbf2\torch\

1 Like

my fastai\old\fastai folder did not have any files in it, just folders.
so i copied the one from the repo.

Hi. i have the same problem. can u help me?? how did u fix it???

If you don’t have admin rights on the PC

You can try two things.
Copy the folder fastai to the folder where the notebook page is located.
or
include on top of your notebooks at the very beginning before the fastai stuff

import os
import sys
sys.path.append(“PATH TO THE FASTAI FOLDER”)

1 Like

I followed all steps from jeremys original post, however, when I run “lesson1.ipynb”, I receive the following error in line [3] from fastai.transforms import *

"AttributeError: module ‘torch’ has no attribute ‘float32’ "

1 Like

a reinstall of pytorch solved the problem for me:

(fastai)> conda uninstall pytorch
(fastai)> conda install pytorch -c pytorch

I received the following errors when running ‘conda env update’. Is this anything to worry about?

pexpect 4.6.0 requires ptyprocess>=0.5, which is not installed.

spacy 2.0.12 has requirement regex==2017.4.5, but you’ll have regex 2018.7.11 which is incompatible.

Thanks Jeremy!

I managed to run lesson1.ipynb on my laptop with NVIDIA GeForce 840M GPU with Windows 10 following your instructions. But the PyTorch version which got installed conda env update did not support my GPU. I got this error message:
Found GPU0 GeForce 840M which is of cuda capability 5.0.
PyTorch no longer supports this GPU because it is too old.

After scavenging the forums, I followed the instructions listed on this thread:

Finally, everything worked. But when I monitored CPU and GPU performance on Task Manager while learning, the learner’s GPU utilisation was around 2.5-3 percent whereas the CPU utilisation was much higher around 50 percent (in certain stages).

I wonder if this is normal. Thanks. In any case, being able to do deep learning on my own laptop feels nice.

What did you exactly to run an older card? :slight_smile: I have a DELL M6700 with a Quadro M4000 sending the same error…

Hello, first time setting up Anaconda on Windows.

During environment setup I got the following errors:

pexpect 4.6.0 requires ptyprocess>=0.5, which is not installed.
spacy 2.0.16 has requirement regex==2018.01.10, but you’ll have regex 2018.8.29 which is incompatible.

So i did:

python -m pip install --upgrade pip
python -m pip install spacy

I had to revert to regex-2018.1.10 from regex-2018.8.29 to install spacy. What this suppose to happen?

3 Likes

I’m on Windows 10 using Anaconda conda 4.5.11 python 3.6.6
After redoing the symlink to fastai I got errors about missing Module spacy
I then ran
conda install -c conda-forge spacy
some packages were downgraded and then I got missing Module dataclasses
after
conda install -c conda-forge dataclasses
some packages were downgraded
now I’ve got missing Moduie fastprogress

I can’t get PyTorch to use my GPU. It says that my graphics card is too old (Gtx 760). It says that PyTorch 0.3.0 will work but I can’t find it to install. Anyone find it? with instructions?