Yousuf Azad
Yousuf Azad

Reputation: 33

Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/?

trying to install fastai using pip but the following error is shown i have installed visual studio build tools 2019 but still cant install fastai using pip.

Installing collected packages: bottleneck, nvidia-ml-py3, fastai Running setup.py install for bottleneck ... error ERROR: Command errored out with exit status 1: command: 'c:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\icarus\\AppData\\Local\\Temp\\pip-install-9snii33_\\bottleneck\\setup.py'"'"'; __file__='"'"'C:\\Users\\icarus\\AppData\\Local\\Temp\\pip-install-9snii33_\\bottleneck\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\icarus\AppData\Local\Temp\pip-record-bpmup82o\install-record.txt' --single-version-externally-managed --compile cwd: C:\Users\icarus\AppData\Local\Temp\pip-install-9snii33_\bottleneck\ Complete output (36 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.7 creating build\lib.win-amd64-3.7\bottleneck copying bottleneck\version.py -> build\lib.win-amd64-3.7\bottleneck copying bottleneck\__init__.py -> build\lib.win-amd64-3.7\bottleneck creating build\lib.win-amd64-3.7\bottleneck\benchmark copying bottleneck\benchmark\autotimeit.py -> build\lib.win-amd64-3.7\bottleneck\benchmark copying bottleneck\benchmark\bench.py -> build\lib.win-amd64-3.7\bottleneck\benchmark copying bottleneck\benchmark\bench_detailed.py -> build\lib.win-amd64-3.7\bottleneck\benchmark copying bottleneck\benchmark\__init__.py -> build\lib.win-amd64-3.7\bottleneck\benchmark creating build\lib.win-amd64-3.7\bottleneck\slow copying bottleneck\slow\move.py -> build\lib.win-amd64-3.7\bottleneck\slow copying bottleneck\slow\nonreduce.py -> build\lib.win-amd64-3.7\bottleneck\slow copying bottleneck\slow\nonreduce_axis.py -> build\lib.win-amd64-3.7\bottleneck\slow copying bottleneck\slow\reduce.py -> build\lib.win-amd64-3.7\bottleneck\slow copying bottleneck\slow\__init__.py -> build\lib.win-amd64-3.7\bottleneck\slow creating build\lib.win-amd64-3.7\bottleneck\src copying bottleneck\src\template.py -> build\lib.win-amd64-3.7\bottleneck\src copying bottleneck\src\__init__.py -> build\lib.win-amd64-3.7\bottleneck\src creating build\lib.win-amd64-3.7\bottleneck\tests copying bottleneck\tests\input_modifcation_test.py -> build\lib.win-amd64-3.7\bottleneck\tests copying bottleneck\tests\list_input_test.py -> build\lib.win-amd64-3.7\bottleneck\tests copying bottleneck\tests\move_test.py -> build\lib.win-amd64-3.7\bottleneck\tests copying bottleneck\tests\nonreduce_axis_test.py -> build\lib.win-amd64-3.7\bottleneck\tests copying bottleneck\tests\nonreduce_test.py -> build\lib.win-amd64-3.7\bottleneck\tests copying bottleneck\tests\reduce_test.py -> build\lib.win-amd64-3.7\bottleneck\tests copying bottleneck\tests\scalar_input_test.py -> build\lib.win-amd64-3.7\bottleneck\tests copying bottleneck\tests\util.py -> build\lib.win-amd64-3.7\bottleneck\tests copying bottleneck\tests\__init__.py -> build\lib.win-amd64-3.7\bottleneck\tests copying bottleneck\LICENSE -> build\lib.win-amd64-3.7\bottleneck running build_ext building 'bottleneck.reduce' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/ ---------------------------------------- ERROR: Command errored out with exit status 1: 'c:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\icarus\\AppData\\Local\\Temp\\pip-install-9snii33_\\bottleneck\\setup.py'"'"'; __file__='"'"'C:\\Users\\icarus\\AppData\\Local\\Temp\\pip-install-9snii33_\\bottleneck\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\icarus\AppData\Local\Temp\pip-record-bpmup82o\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

any kind of help will be appreciated

Upvotes: 0

Views: 1204

Answers (1)

Olivier Boudry
Olivier Boudry

Reputation: 805

You may not have the right path variable setup. Visual Studio build tools install scripts that you need to run in order to get the right variables in your shell.

This said, on Windows, unless you really want to compile your own version, I would recommend to install it with conda.

First install pytorch using the conda command listed here: https://pytorch.org/get-started/locally/

If you have a GPU:

conda install pytorch torchvision cudatoolkit=10.0 -c pytorch

If you use CPU:

conda install pytorch torchvision cpuonly -c pytorch

Then install fastai:

conda install -c fastai fastai

This method works fine on Windows and won't require a compiler.

Upvotes: 1

Related Questions