pip - 无法安装Fastai

问题描述 投票:-1回答:2

每当我跑:

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\". 

有人可以指导我可能出错的地方吗?

Ps。:我已经尝试更新setuptools,它对我的​​情况没有帮助。

python pip pytorch
2个回答
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是最低版本要求。


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
© www.soinside.com 2019 - 2024. All rights reserved.