I had fastai working before on the following system.
OS: Windows 10
Python 3.6.5 Distribution: Anaconda
After reformatting the C: drive, trying to reinstall fastai is giving the following error:
Collecting torch<0.4 (from fastai==0.7.0)
Using cached https://files.pythonhosted.org/packages/5f/e9/bac4204fe9cb1a002ec6140b47f51affda1655379fe302a1caef421f9846/torch-0.1.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-931to5e5\torch\setup.py", line 11, in <module>
raise RuntimeError(README)
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.
I have tried the solution that worked for some (shapely and fiona) but it did not work for me. Any tips?
If you use conda package manager to download pytorch it will just download , upgrade or downgrade some packages and just put the entire files of pytorch on the exact folder that anaconda/miniconda environment needs.
pip (python package manager) is possible but the packages installed by it may not find the dependencies that conda manages like cuda and others. In my understanding there is a big difference between a pytorch build for a conda environment and a pytorch build for a pure python environement.
You may find difficult to find pytorch with conda because normally conda search uses only the defaults channel you can include the pytorch channel too on the search.
try this to install:
conda install pytoch -c pytoch
you can also seach for pytorch on channel pytorch:
conda search pytorch -c pytorch
the pre-built Pytorch 0.4 on the defaults channel are not prepared for cuda and yet the ones that are (v0.3) are for cuda8.0.
If you have desire to use 0.4 for cuda 9.0 follow the instruction I described
Thank you for sharing more information… and another question:
Could you tell me where you tried to import (not install) fastai?
I guess that was neither courses/dl1 nor courses/dl2.
I guess the solution is to run the command: pip install git+https://github.com/fastai/fastai.git after fastai environment is activated.
I drop an explanation below, but if you do not have the time, feel free to ignore.
Actually, conda installation of fastai repository does not install fastai as a python package.
What the conda installation instruction does is installing all the packages that fastai uses, e.g. pytorch, numpy, pandas, and so on.
I mean, the conda method does not add fastai to site_packages or python path of your environment.
This is why courses/dl1 and courses/dl2 directories have symbolic link to fastai and the below snippet did not raise any error.
Is that in a notebook? Have you created windows symbolic links instead of the “fastai” file in the folder your script is in?
Need to do that on windows. Open CMD as admin then mklink /d fastai ../where/ever/fastai
Edit: just saw this problem was pointed out right above anyways I’ll leave the command here
I keep seen this over and over again. This kind of confusion happens when you saw the package installing but not sure in what environment it was installed. Meaning standalone python or conda environment.
I suggest you start over. Remove Python if you have, remove Anaconda, restart the Windows machine
Activate Python environment: conda activate fastai or source activate fastai
Install whatever package you need after have enabled the environment
Also notice that in fastai/courses/ (ml1 or dl1 or dl2) there is a shortcut that need to me made inside each of thie folders (in case of windows) to point the root folder of fastai/fastai so when you try to import it in any notebook will be like importing a module folder. Without the need to install the fastai package.
Answer me the following questions so I can help you how to proceed better.
1-Do you have python3 or python2 standalone on the machine ?
2-If yes, look the environment variable for windows (User and General environments) and remove it from the path. Or Any python related path remove it. If you don’t want to loose that information I suggest you take notes and remove it from the system this can cause conflict with conda.
Also Note that windows has a different kind of smybolic link than what’s contained in the repo. Just to be sure, what you want to see is a folder shortcut to the proper fastai folder in your Windows Explorer. If you only see this fastai file containing …/…/fastai or so then it’s the wrong kind! Delete it and use the command mentioned above.