-1

Whenever I run:

pip install fastai

I get the error

"Command "python setup.py egg_info" failed with error code 1 in C:\Users\seja9890\AppData\Local\Temp\pip-install-_cw7ve61\torch\". 

Can someone please guide me where I might be going wrong?

Ps.: I have tried updating setuptools and it doesn't help in my case.

MBT
  • 21,733
  • 19
  • 84
  • 102
sejal_chopra
  • 31
  • 1
  • 4
  • do `pip3 install fastai` – Tilak Putta Sep 09 '18 at 14:23
  • You try alternative install with pip that is described in github README file? – Mihai8 Sep 09 '18 at 15:03
  • 1
    Can you show the entire stacktrace? Aditionally, are you sure the module hasn't been removed (even though it gave an error)? Try to `import fastai` in a python script and see if it still works. – Matt Messersmith Sep 09 '18 at 15:49
  • Possible duplicate of [Pytorch installation issue under Anaconda](https://stackoverflow.com/questions/51735017/pytorch-installation-issue-under-anaconda) – Sam H. Sep 15 '18 at 16:14

2 Answers2

2

Fastai doesn't work with Python 2 so make sure you installed pip3 (sudo apt install python3-pip on Ubuntu).

Make sure Python3 is at least 3.6 this may change since Fastai may need 3.7. soon.

and then: pip3 install git+https://github.com/fastai/fastai.git

or use pip3 install fastai, or in some cases you may need: pip3 install --no-deps fastai

Note: At the moment I am writing this: PyTorch v1 and Python 3.6 are the minimal version requirements.

prosti
  • 42,291
  • 14
  • 186
  • 151
  • 1
    I love it when people provide a simple explanation even when the question is kinda vague, thanks buddy! (: **NOTE** python3.6 still enough – Yoel Nisanov Aug 04 '20 at 13:22
0

For official website, you should install it with conda.

To install

# Prerequisites
Anaconda, manages Python environment and dependencies
# Normal installation
Download project: git clone https://github.com/fastai/fastai.git
Move into root folder: cd fastai
Set up Python environment: conda env update
Activate Python environment: conda activate fastai
If this fails, use instead: source activate fastai
# Install as pip package (not recommend)
You can also install this library in the local environment using pip
pip install fastai
However this is not currently the recommended approach, since the library is being updated much more frequently than the pip release, fewer people are using and testing the pip version, and pip needs to compile many libraries from scratch (which can be slow).

An alternative is to use the latest Github version with pip

pip install git+https://github.com/fastai/fastai.git
王佳欣
  • 96
  • 4