【问题标题】:pip install textacy failspip install textacy 失败
【发布时间】:2020-01-16 21:06:59
【问题描述】:

我正在尝试安装 textacy 来执行 NLP 任务,但尝试执行时出错:

python -m pip install textacy --user

代码开始运行,但一段时间后失败并显示以下输出:

ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files (x86)\Python37-32\python.exe' 'C:\Users\3ORM3OV\AppData\Roaming\Python\Python37\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\USER~1\AppData\Local\Temp\pip-build-env-owdv11_a\normal' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- wheel 'preshed<3.1.0,>=3.0.2' 'thinc<7.4.0,>=7.3.0' 'murmurhash<1.1.0,>=0.28.0' 'cython>=0.25' 'cymem<2.1.0,>=2.0.2'
       cwd: None
  Complete output (57 lines):
  Collecting wheell
-LINKS TO PACKAGES DELETED SO AS TO BE ABLE TO POST-
  Installing collected packages: wheel, cymem, murmurhash, preshed, numpy, blis, wasabi, srsly, plac, tqdm, thinc, cython
      Running setup.py install for cymem: started
      Running setup.py install for cymem: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: 'C:\Program Files (x86)\Python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\USER~1\\AppData\\Local\\Temp\\pip-install-fx2lzonc\\cymem\\setup.py'"'"'; __file__='"'"'C:\\Users\\USER~1\\AppData\\Local\\Temp\\pip-install-fx2lzonc\\cymem\\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\USER~1\AppData\Local\Temp\pip-record-v5xmg2ww\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\USER~1\AppData\Local\Temp\pip-build-env-owdv11_a\normal' --compile
           cwd: C:\Users\USER~1\AppData\Local\Temp\pip-install-fx2lzonc\cymem\
      Complete output (24 lines):
      WARNING: The wheel package is not available.
      running install
      running build
      running build_py
      creating build
      creating build\lib.win32-3.7
      creating build\lib.win32-3.7\cymem
      copying cymem\about.py -> build\lib.win32-3.7\cymem
      copying cymem\__init__.py -> build\lib.win32-3.7\cymem
      package init file 'cymem\tests\__init__.py' not found (or not a regular file)
      creating build\lib.win32-3.7\cymem\tests
      copying cymem\tests\test_import.py -> build\lib.win32-3.7\cymem\tests
      copying cymem\cymem.pyx -> build\lib.win32-3.7\cymem
      copying cymem\cymem.pxd -> build\lib.win32-3.7\cymem
      copying cymem\__init__.pxd -> build\lib.win32-3.7\cymem
      running build_ext
      building 'cymem.cymem' extension
      creating build\temp.win32-3.7
      creating build\temp.win32-3.7\Release
      creating build\temp.win32-3.7\Release\cymem
      C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Program Files (x86)\Python37-32\include" "-IC:\Program Files (x86)\Python37-32\include" "-IC:\Program Files (x86)\Python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /EHsc /Tpcymem/cymem.cpp /Fobuild\temp.win32-3.7\Release\cymem/cymem.obj /Ox /EHsc
      cymem.cpp
      c:\program files (x86)\python37-32\include\pyconfig.h(203): fatal error C1083: No se puede abrir el archivo incluir: 'basetsd.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
      ----------------------------------------
  ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\Python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\USER~1\\AppData\\Local\\Temp\\pip-install-fx2lzonc\\cymem\\setup.py'"'"'; __file__='"'"'C:\\Users\\USER~1\\AppData\\Local\\Temp\\pip-install-fx2lzonc\\cymem\\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\USER~1\AppData\Local\Temp\pip-record-v5xmg2ww\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\USER~1\AppData\Local\Temp\pip-build-env-owdv11_a\normal' --compile Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\Python37-32\python.exe' 'C:\Users\3ORM3OV\AppData\Roaming\Python\Python37\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\USER~1\AppData\Local\Temp\pip-build-env-owdv11_a\normal' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- wheel 'preshed<3.1.0,>=3.0.2' 'thinc<7.4.0,>=7.3.0' 'murmurhash<1.1.0,>=0.28.0' 'cython>=0.25' 'cymem<2.1.0,>=2.0.2' Check the logs for full command output.>

【问题讨论】:

  • 你试过pip3 install textacy --user吗?我刚刚做了,对我来说效果很好。
  • python 2 和 python 3 都安装了吗?
  • @Linny 运行该代码会输出此错误:Traceback (most recent call last): File "c:\program files (x86)\python37-32\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\program files (x86)\python37-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Program Files (x86)\Python37-32\Scripts\pip3.exe\__main__.py", line 9, in &lt;module&gt; TypeError: 'module' object is not callable
  • @Stephopolis 我想我只有 v3,我应该两个都有吗?

标签: python python-3.x pip textacy


【解决方案1】:

您是否考虑过尝试不带--user 标志运行?我运行python -m pip install textacy 并成功安装。您可能对用户前缀有一些问题。

【讨论】:

  • 也试过了,还是报错:“Installing backend dependencies ... error” :(
【解决方案2】:

您是否安装了 Microsoft Visual C++ 14.0?

使用Visual C++ 2015 Build Tools 的链接。这将在不安装 Visual Studio 的情况下安装 Visual C++ 14.0。

安装后,该命令对我有用。

pip install textacy

重要的是,我从这里找到了答案:Pip error: Microsoft Visual C++ 14.0 is required

【讨论】:

    【解决方案3】:

    要使用 conda 安装 textacy 包,请运行以下操作之一:

    conda install -c conda-forge textacy
    conda install -c conda-forge/label/cf201901 textacy
    conda install -c conda-forge/label/cf202003 textacy
    

    我从以上三个中尝试了以下代码。对我来说效果很好

    conda install -c conda-forge textacy
    

    供参考 - https://anaconda.org/conda-forge/textacy

    注意-在anaconda prompt/cmd中运行代码

    【讨论】:

      猜你喜欢
      • 2015-12-22
      • 2012-09-24
      • 2018-10-11
      • 2015-05-05
      • 2021-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多