我正在尝试安装fastai
,但似乎没有任何效果。我已经安装pytorch
并且运行正常。我尝试使用安装 pip3 install fastai
。pip3
因为我有 python2.7 和 python3.6。我升级了安装工具,但问题没有解决。
pip3 安装 fastai
Collecting fastai
Downloading https://files.pythonhosted.org/packages/ff/53/da994550c0dd2962351fd694694e553afe0c9516c02251586790f830430b/fastai-2.1.8-py3-none-any.whl (189kB)
100% |████████████████████████████████| 194kB 735kB/s
Collecting scipy (from fastai)
Downloading https://files.pythonhosted.org/packages/c8/89/63171228d5ced148f5ced50305c89e8576ffc695a90b58fe5bb602b910c2/scipy-1.5.4-cp36-cp36m-manylinux1_x86_64.whl (25.9MB)
100% |████████████████████████████████| 25.9MB 72kB/s
Collecting torchvision>=0.8 (from fastai)
Downloading https://files.pythonhosted.org/packages/e7/43/aaa740c406b1832adc6ff9d5e71c23fd2af2ebd436c42d76d85809ec8be9/torchvision-0.8.1-cp36-cp36m-manylinux1_x86_64.whl (12.8MB)
100% |████████████████████████████████| 12.8MB 142kB/s
Collecting fastcore>=1.3.8 (from fastai)
Downloading https://files.pythonhosted.org/packages/ba/0c/a08940a410b3c55b082578b7142e96afa1c8e3f39972b99366093bb4af59/fastcore-1.3.10-py3-none-any.whl (51kB)
100% |████████████████████████████████| 61kB 1.9MB/s
Collecting requests (from fastai)
Downloading https://files.pythonhosted.org/packages/39/fc/f91eac5a39a65f75a7adb58eac7fa78871ea9872283fb9c44e6545998134/requests-2.25.0-py2.py3-none-any.whl (61kB)
100% |████████████████████████████████| 61kB 2.1MB/s
Collecting fastprogress>=0.2.4 (from fastai)
Downloading https://files.pythonhosted.org/packages/eb/1f/c61b92d806fbd06ad75d08440efe7f2bd1006ba0b15d086debed49d93cdc/fastprogress-1.0.0-py3-none-any.whl
Collecting pillow (from fastai)
Downloading https://files.pythonhosted.org/packages/5f/19/d4c25111d36163698396f93c363114cf1cddbacb24744f6612f25b6aa3d0/Pillow-8.0.1-cp36-cp36m-manylinux1_x86_64.whl (2.2MB)
100% |████████████████████████████████| 2.2MB 580kB/s
Collecting pandas (from fastai)
Downloading https://files.pythonhosted.org/packages/4d/51/bafcff417cd857bc6684336320863b5e5af280530213ef8f534b6042cfe6/pandas-1.1.4-cp36-cp36m-manylinux1_x86_64.whl (9.5MB)
100% |████████████████████████████████| 9.5MB 190kB/s
Collecting pyyaml (from fastai)
Downloading https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz (269kB)
100% |████████████████████████████████| 276kB 1.6MB/s
Collecting scikit-learn (from fastai)
Downloading https://files.pythonhosted.org/packages/5c/a1/273def87037a7fb010512bbc5901c31cfddfca8080bc63b42b26e3cc55b3/scikit_learn-0.23.2-cp36-cp36m-manylinux1_x86_64.whl (6.8MB)
100% |████████████████████████████████| 6.8MB 218kB/s
Collecting spacy (from fastai)
Downloading https://files.pythonhosted.org/packages/73/df/868cb5a40d8649b057594425fe67bffdc732213e6e2fe2ad8ccd2707a918/spacy-2.3.4.tar.gz (5.8MB)
100% |████████████████████████████████| 5.8MB 284kB/s
Complete output from command python setup.py egg_info:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9n84rlby/thinc/
Traceback (most recent call last):
File "/home/wally1002/.local/lib/python3.6/site-packages/setuptools/installer.py", line 126, in fetch_build_egg
subprocess.check_call(cmd)
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpojkbh6zg', '--quiet', 'thinc<7.5.0,>=7.4.1']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-nf_o3qal/spacy/setup.py", line 252, in <module>
setup_package()
File "/tmp/pip-build-nf_o3qal/spacy/setup.py", line 247, in setup_package
cmdclass={"build_ext": build_ext_subclass},
File "/home/wally1002/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 152, in setup
_install_setup_requires(attrs)
File "/home/wally1002/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 147, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/home/wally1002/.local/lib/python3.6/site-packages/setuptools/dist.py", line 676, in fetch_build_eggs
replace_conflicting=True,
File "/home/wally1002/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 766, in resolve
replace_conflicting=replace_conflicting
File "/home/wally1002/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1049, in best_match
return self.obtain(req, installer)
File "/home/wally1002/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1061, in obtain
return installer(requirement)
File "/home/wally1002/.local/lib/python3.6/site-packages/setuptools/dist.py", line 732, in fetch_build_egg
return fetch_build_egg(self, req)
File "/home/wally1002/.local/lib/python3.6/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpojkbh6zg', '--quiet', 'thinc<7.5.0,>=7.4.1']' returned non-zero exit status 1.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-nf_o3qal/spacy/
答案1
我终于安装它了。问题出在 pip 版本上。由于我同时使用 pip 和 pip3,所以我一直在更新 pip。所以我使用 更新了 pip3 $ pip3 install --upgrade pip
。它解决了这个问题。