点-无法安装Fastai

时间:2018-09-09 12:50:36

标签: python pip pytorch

每当我跑步:

pip install fastai

我收到错误

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

有人可以指导我哪里可能出问题了吗?

附言:我已尝试更新setuptools,但对我而言无济于事。

2 个答案:

答案 0 :(得分:1)

Fastai不适用于Python 2,因此请确保您安装了pip3(在Ubuntu上为sudo apt install python3-pip)。

请确保Python3至少为3.6,因为Fastai可能需要3.7,所以这可能会更改。很快。

,然后: pip3 install git+https://github.com/fastai/fastai.git

或使用pip3 install fastai,或者在某些情况下,您可能需要: pip3 install --no-deps fastai

注意:目前,我正在写这篇文章:PyTorch v1和Python 3.6是最低版本要求。

答案 1 :(得分:0)

对于官方网站,您应该使用conda进行安装。

要安装

# 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