I had the same issue and couldn’t get it to work even after installing GDAL, Fiona binaries, etc. I finally managed to get it to work by building Fiona from source.
I installed GDAL using the OSGeo installer (https://live.osgeo.org/en/win_installers.html). Then after cloning the Fiona repository you need to pass the locations of the GDAL include and lib folders, as well as the installed GDAL version. For me this was:
Note that I only tested installing fastai via running python setup.py install. However, I was getting the same error using either installation method yesterday.
I Did everything that was asked in the tutorial except the last step of linking cause my computer is giving error i dont have enough permissions even though i was running that in admin mode. SO i ran jupyter as it is and it loaded as expected but gave error no module named fastai while importing fastai packages.Please anyone help?
I was finally able to get everything installed (after manually installing GDAL) by setting the following environment variables before I ran conda install -c conda-forge fiona:
set INCLUDE=C:\path-to-gdal\include
set LIB=C:\path-to-gdal\lib
Then I ran conda env update.
Also (@divyanshu97) remember to create the symlink to the fastai directory as per the instructions in the first post in this thread (may require elevated/admin command shell?):
cd courses\dl1
del fastai
mklink /d fastai ..\..\fastai
cd ..\..
Edit: Updated this post to reflect that after tying to reproduce, I found that I must have installed fiona separately from updating the environment.
@pverma, I also tried to install Fiona first, which was successful, but running conda env update still returns the same error message related to Fiona.
I too was stuck on a fiona related problem in Windows 10 install of fastai. I tried a lot of things and finally it worked. I’m listing some of the steps here. At first I tried the installation from this post with conda env update, which kept failing on the fiona step. I downloaded GDAL and followed these instructions earlier: https://github.com/Toblerity/Fiona/blob/master/README.rst#windows
including GDAL but it still didn’t work. Then I removed the fastai environment
conda env remove -n fastai
and followed old instructions for Windows 10 on How to set up Windows 10 for fast.ai
Here are the series of commands that seemingly randomly led to it working. (Sorry I wish I had more succinct advice)
conda create -n fastai python=3.6 numpy cython statsmodels opencv
activate fastai
conda install -c peterjc123 pytorch cuda90
pip install fastai (error received fiona related)
python -m pip install --upgrade pip
pip install fastai (error received fiona related)
conda install -c conda-forge geopandas
conda remove geopandas fiona
pip install geopandas fiona (error received fiona related)
pip install Fiona-1.7.13-cp36-cp36m-win_amd64.whl
(downloaded from https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona)
pip install geopandas fiona
pip install fastai
python -m ipykernel install --user --name fastai --display-name “fastAI custom”
jupyter notebook
Have you tried building Fiona from source rather than just installing the binary? Its pretty likely the issue is caused by conda not knowing to point the Fiona install script towards the GDAL include and lib. It looks like toddprater had success just by setting the environment variables before updating the environment.
Hi Josh, should I just type these two “set environment” under the Annoconda command prompt, or set these environment variables using Windows environment setting tool? Thanks.
I just set the environment variables in the shell before I ran the conda env update command. I don’t think you’d want to set those globally. Actually, just this morning I went back to see if I could make it work from scratch and found that I must have installed fiona (from conda-forge) before updating the environment:
conda install -c conda-forge fiona
Or, you could just add the line under dependencies in the environment.yml file:
- conda-forge::fiona>=1.7.13
And then just a single conda env update should work.
How did you installed GDAL?
I tried to install GDAL core, but at the path-to-gdal I don’t have “include” and “lib” library.
I have: “charp”, “gdal-data”, “gdalplugins”, “licence”, “projlib”
@talz: I downloaded from the GIS Internals site. I chose the MSVC 2017/x64 package and then downloaded both the ‘compiled binaries’ ZIP file and the ‘libraries and headers’ ZIP file. Then I just extracted those into a directory (C:\path-to-gdal).
Hi Guys,
I am trying to get started with this course on a Windows 10 machine equipped with the 960M NVIDIA GPU. I was able to follow steps 1 to 4 without much issues. However, I am stuck with an error that the Anaconda prompt throws at Step 5 (conda env update). Can someone please help me get past this error?
hello, I was able to solve this by installing geopandas independently, but then got stuck with waht every body is complaining about … the Fiona thing ! Have been trying to slove it since yesterday but to no avail !
@sameersharmadc thanks a lot … that worked and everything installed correctly and completed all the steps exactly as you mentioned. However after that when I try to launch jupyter I get this: