Howto: installation on Windows

I had gone through a pretty tedious/painful installation last year as well (following this very helpful guide: https://github.com/philferriere/dlwin), so I had the exact same fear. However, I found that following the instructions exactly as written here worked like a charm. Good luck!

1 Like

yep. it was a pretty good feeling when it all works, so I’d encourage people not to be afraid of this on Windows now. Thanks again fastai team!
I created a little batch to popup a window showing the nvidia stats which is useful to confirm power loads, fan and temperature etc - especially if a new pc / gpu

Got this working on Windows 7, with some fixes required.

  1. defaults channel had to be disabled, otherwise ipykernel cannot be installed properly due to an error related to defaults::ipykernel-4.8.0-py36_0 (https://github.com/ContinuumIO/anaconda-issues/issues/8087)

    conda update conda
    conda update ipykernel
    conda env update # after commenting out defaults in environment.yml

  2. install the VC2017/VC2015 redistributables or runtimes

  3. One machine repeatedly crashes at the opencv commands. This only went away after applying all available Windows 7 updates (including .net framework 4.6.1), and re-installing opencv-python. Exact cause is still unknown.

3 Likes

Additional modifications that I’ve discovered through trial and error that made my installation work:

  1. After step 6, run the following in your fastai directory:
    pip install -U .

  2. If you’re getting errors:

  • Delete your fastai environment: conda remove -n fastai --all
  • Clear your conda cache: conda clean --all
  • Rerun his steps, with my #1 inserted after step 6
  1. If it ain’t broke, don’t fix it. But if you do the above and you’re getting errors or if you get to a point where something doesn’t run right, then maybe update your fastai:
  • Go to your fastai directory
  • git pull
  • pip install -U .

And if that doesn’t work, see #2.

3 Likes

Thanks @DivingStill , followed your same path last year, happy to hear you are up and working now. My new install went pretty well too, one only problem with the git from the anaconda environment for PDPbox so had to pip install a few packages manually to complete the fastai library setup. That said, I am now running the lesson1 notebooks to check my system and still fighting with the batch size for rxt50 and vgg while learn-fitting after unfreezing (my 8GB GTX 1070 is not enough on a Win 10, 16GB RAM, i7-6700HQ laptop). It seems the most is done, though. Thanks again for your reply and best of luck with your course! Gius

If anyone else uses their Windows setup on the ML course, I suspect graphviz will fail for you. Make sure to install it with
>conda install python-graphviz

Pip and conda without the python bit, causes a problem (Jupyter doesn’t find it on the path, but don’t just add it to the path, because other stuff then crashes). If it can be confirmed by others that this IS needed, maybe @jeremy would include it above?

1 Like

Just don’t forget to include graphviz.exe in your system path also…(I had to do so Win10 64 bit)

And nothing has crashed till today…(hope so that it shouldn’t)

Note, my method does not require it on the path the maintainer says adding to path is not the way to go. Glad it hasn’t caused you problems. Details at: http://github.com/ContinuumIO/anaconda-issues/issues/1666#issuecomment-301895525

I was running the conda env update command and I received the following error on a Windows 10 machine

Solving environment: failed

ResolvePackageNotFound:
  - pytorch[version='>=0.2.0']
  - ptyprocess
  - libgcc
  - glib
  - fontconfig
  - readline
  - libgfortran
  - jbig
  - libffi
  - torchvision[version='>=0.1.9']
1 Like

I followed the instructions and ran into the same issue with deleting the link, which failed for me even in an admin prompt. I deleted the old link using File Explorer, then created the Windows version in the command prompt:

(fastai) C:\Local\fastai\fastai\courses\dl1>mklink /d fastai …\fastai
symbolic link created for fastai <<===>> …\fastai

When I start to go through courses\dl1\lesson1.ipynb, I get this error from the second cell:

ModuleNotFoundError: No module named ‘fastai.imports’

NOTE: Although I typed the mklink command exactly as required, it is displaying incorrectly in this post with three periods and a single backslash.

2 Likes

you may find it easier, being windows and all, to use Link Shell Extension. I downloaded it and it is quite nice. you can read about symlinks and where to download it from here:

1 Like

Use the absolute path. Eg, if you cloned the repository in C:, move into dl1, then do:

mklink /d fastai C:\fastai\fastai

1 Like

I tried to install Link Shell Extension. The installation puts HardlinkShellExt.dll, LSEConfig.exe, Ro
ckallDLL.dll, symlink.exe and uninst-HardlinkShellExt_X64.exe into Program Files/LinkShellExtension, but it there is no HardlinkShellExt_X64.exe which seems to be the program. I installed the prerequisite redistribution code for both 64 and 32 bit before installing.

The problem was that the Python code was not being installed in the fastai/fastai directory. I started everything over from scratch and this time it was successful. dl1/lesson1.ipynb now works fine (EVGA 1080Ti). Thanks for your help.

1 Like

Twice today I’ve come across interesting packages I’d like to experiment with fastai. (but not at risk of breaking fastai functionality)
First pandas-profiling, then tpot. Both are available at conda, but both want to downgrade a whole heap of dependencies. Can anyone here advise how to deal with that?

1 Like

Just create/clone a new conda environment from the fastai one

1 Like

funny you should suggest that… I got an error trying to clone…

which I’ve now fixed and submitted a conda pull request. (my first, so blaring trumpet here loudly, hoping/presuming it gets accepted)

tpot didn’t require a lot of package changes as many will be installed with Anaconda by default…

Hi, thanks Jeremy for creating this guide for us Windows users. I’m on a windows 10 desktop and managed to get it working.

I have a problem when trying to install the spacy english model. My anaconda 3 is in the home directory.

(fastai) C:\WINDOWS\system32>pip install spacy && python -m spacy download en
Requirement already satisfied: spacy in c:\users\user\anaconda3\envs\fastai\lib\site-packages
Requirement already satisfied: numpy>=1.7 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: murmurhash<0.29,>=0.28 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: cymem<1.32,>=1.30 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: preshed<2.0.0,>=1.0.0 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: thinc<6.11.0,>=6.10.1 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: plac<1.0.0,>=0.9.6 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: six in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: pathlib in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: ujson>=1.35 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: dill<0.3,>=0.2 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: requests<3.0.0,>=2.13.0 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: regex==2017.4.5 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: ftfy<5.0.0,>=4.4.2 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: msgpack-python in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: msgpack-numpy==0.4.1 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from spacy)
Requirement already satisfied: wrapt in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from thinc<6.11.0,>=6.10.1->spacy)
Requirement already satisfied: tqdm<5.0.0,>=4.10.0 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from thinc<6.11.0,>=6.10.1->spacy)
Requirement already satisfied: cytoolz<0.9,>=0.8 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from thinc<6.11.0,>=6.10.1->spacy)
Requirement already satisfied: termcolor in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from thinc<6.11.0,>=6.10.1->spacy)
Requirement already satisfied: pyreadline>=1.7.1 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from dill<0.3,>=0.2->spacy)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from requests<3.0.0,>=2.13.0->spacy)
Requirement already satisfied: idna<2.7,>=2.5 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from requests<3.0.0,>=2.13.0->spacy)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from requests<3.0.0,>=2.13.0->spacy)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from requests<3.0.0,>=2.13.0->spacy)
Requirement already satisfied: html5lib in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from ftfy<5.0.0,>=4.4.2->spacy)
Requirement already satisfied: wcwidth in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from ftfy<5.0.0,>=4.4.2->spacy)
Requirement already satisfied: toolz>=0.8.0 in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from cytoolz<0.9,>=0.8->thinc<6.11.0,>=6.10.1->spacy)
Requirement already satisfied: webencodings in c:\users\user\anaconda3\envs\fastai\lib\site-packages (from html5lib->ftfy<5.0.0,>=4.4.2->spacy)
Traceback (most recent call last):
File “C:\Users\user\Anaconda3\envs\fastai\lib\runpy.py”, line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “C:\Users\user\Anaconda3\envs\fastai\lib\runpy.py”, line 142, in get_module_details
return get_module_details(pkg_main_name, error)
File “C:\Users\user\Anaconda3\envs\fastai\lib\runpy.py”, line 109, in get_module_details
import(pkg_name)
File "C:\Users\user\Anaconda3\envs\fastai\lib\site-packages\spacy_init
.py", line 4, in
from .cli.info import info as cli_info
File "C:\Users\user\Anaconda3\envs\fastai\lib\site-packages\spacy\cli_init
.py", line 1, in
from .download import download
File “C:\Users\user\Anaconda3\envs\fastai\lib\site-packages\spacy\cli\download.py”, line 10, in
from .link import link
File “C:\Users\user\Anaconda3\envs\fastai\lib\site-packages\spacy\cli\link.py”, line 7, in
from …compat import symlink_to, path2str
File “C:\Users\user\Anaconda3\envs\fastai\lib\site-packages\spacy\compat.py”, line 11, in
from thinc.neural.util import copy_array
File "C:\Users\user\Anaconda3\envs\fastai\lib\site-packages\thinc_init
.py", line 1, in
from .about import *
ModuleNotFoundError: No module named ‘thinc.about’

It appears I have everything I need to install spacy, but it can’t seem to find a module I should have? Do I need to do a manual install? I alrready tried an env update.

can’t say I understood that. when i ran conda install under fastai it wanted to downgrade heaps (~20). but when i cloned that and installed, it seemed to do very little. pandas-profiling did similar.

once pandas-profiling is installed, the code is basic

# can use pandas profiling to get an overview of the data
import pandas_profiling
#profile = pandas_profiling.ProfileReport(df_all)
profile = pandas_profiling.ProfileReport(df_all[:2000]) #run faster on subset of data
profile.to_file(outputfile="./tmp/myprofilereport.html")
profile