首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何修复在Anaconda中安装NLPre时的错误?

如何修复在Anaconda中安装NLPre时的错误?
EN

Stack Overflow用户
提问于 2022-08-17 15:48:58
回答 2查看 111关注 0票数 0

我是Python的新手,我使用Anaconda并尝试使用Anaconda命令提示符中的以下命令安装NLPre:

代码语言:javascript
运行
复制
pip install nlpre

安装spacy 2.1.0的构建依赖项时,安装挂起,我得到以下长输出:

代码语言:javascript
运行
复制
Collecting spacy==2.1.0
  Using cached spacy-2.1.0.tar.gz (27.7 MB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
      Collecting setuptools
        Using cached setuptools-65.0.2-py3-none-any.whl (1.2 MB)
      Collecting wheel>0.32.0.<0.33.0
        Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
      Collecting Cython
        Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)
      Collecting cymem<2.1.0,>=2.0.2
        Using cached cymem-2.0.6-cp39-cp39-win_amd64.whl (36 kB)
      Collecting preshed<2.1.0,>=2.0.1
        Using cached preshed-2.0.1.tar.gz (113 kB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting murmurhash<1.1.0,>=0.28.0
        Using cached murmurhash-1.0.8-cp39-cp39-win_amd64.whl (18 kB)
      Collecting thinc==7.0.0.dev6
        Using cached thinc-7.0.0.dev6.tar.gz (1.9 MB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting blis<0.3.0,>=0.2.1
        Using cached blis-0.2.4.tar.gz (1.5 MB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting thinc_gpu_ops<0.1.0,>=0.0.1
        Using cached thinc_gpu_ops-0.0.4-py3-none-any.whl
      Collecting numpy>=1.7.0
        Using cached numpy-1.23.2-cp39-cp39-win_amd64.whl (14.7 MB)
      Collecting wrapt<1.11.0,>=1.10.0
        Using cached wrapt-1.10.11-py3-none-any.whl
      Collecting plac<1.0.0,>=0.9.6
        Using cached plac-0.9.6-py2.py3-none-any.whl (20 kB)
      Collecting tqdm<5.0.0,>=4.10.0
        Using cached tqdm-4.64.0-py2.py3-none-any.whl (78 kB)
      Collecting six<2.0.0,>=1.10.0
        Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
      Collecting wasabi<1.1.0,>=0.0.9
        Using cached wasabi-0.10.1-py3-none-any.whl (26 kB)
      Collecting srsly<1.1.0,>=0.0.5
        Using cached srsly-1.0.5-cp39-cp39-win_amd64.whl (177 kB)
      Collecting colorama
        Using cached colorama-0.4.5-py2.py3-none-any.whl (16 kB)
      Building wheels for collected packages: thinc, preshed, blis
        Building wheel for thinc (setup.py): started
        Building wheel for thinc (setup.py): finished with status 'error'
        error: subprocess-exited-with-error

        python setup.py bdist_wheel did not run successfully.
        exit code: 1

        [176 lines of output]
        running bdist_wheel
        running build
        running build_py
        creating build
        creating build\lib.win-amd64-3.9
        creating build\lib.win-amd64-3.9\thinc
       #I deleted some repetitive copy steps to save characters
        copying thinc\extra\search.cpp -> build\lib.win-amd64-3.9\thinc\extra
        running build_ext
        building 'thinc.linalg' extension
        creating build\temp.win-amd64-3.9
        creating build\temp.win-amd64-3.9\Release
        creating build\temp.win-amd64-3.9\Release\thinc
        "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\hudsonad\Anaconda3\include -IC:\Users\hudsonad\AppData\Local\Temp\1\pip-install-xwlhseua\thinc_528ca1a5c727434bb1c9be6a9cf85be1\include -IC:\Users\hudsonad\Anaconda3\include -IC:\Users\hudsonad\Anaconda3\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpthinc/linalg.cpp /Fobuild\temp.win-amd64-3.9\Release\thinc/linalg.obj /Ox /EHsc
        linalg.cpp
        thinc/linalg.cpp(201): warning C4804: '/': unsafe use of type 'bool' in operation
        thinc/linalg.cpp(1910): warning C4244: '=': conversion from 'double' to '__pyx_t_5thinc_8typedefs_weight_t', possible loss of data
        thinc/linalg.cpp(2350): warning C4244: '=': conversion from 'double' to '__pyx_t_5thinc_8typedefs_weight_t', possible loss of data
        thinc/linalg.cpp(2397): warning C4244: '=': conversion from 'double' to '__pyx_t_5thinc_8typedefs_weight_t', possible loss of data
        thinc/linalg.cpp(2564): warning C4244: '=': conversion from 'double' to '__pyx_t_5thinc_8typedefs_weight_t', possible loss of data
        thinc/linalg.cpp(3232): warning C4244: 'argument': conversion from 'double' to '__pyx_t_5thinc_8typedefs_weight_t', possible loss of data
        thinc/linalg.cpp(3872): error C2039: 'tp_print': is not a member of '_typeobject'
        C:\Users\hudsonad\Anaconda3\include\cpython/object.h(193): note: see declaration of '_typeobject'
        thinc/linalg.cpp(3897): error C2039: 'tp_print': is not a member of '_typeobject'
        C:\Users\hudsonad\Anaconda3\include\cpython/object.h(193): note: see declaration of '_typeobject'
        thinc/linalg.cpp(3916): error C2039: 'tp_print': is not a member of '_typeobject'
        C:\Users\hudsonad\Anaconda3\include\cpython/object.h(193): note: see declaration of '_typeobject'
        thinc/linalg.cpp(3927): error C2039: 'tp_print': is not a member of '_typeobject'
        C:\Users\hudsonad\Anaconda3\include\cpython/object.h(193): note: see declaration of '_typeobject'
        error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
        [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for thinc
        Running setup.py clean for thinc
        Building wheel for preshed (setup.py): started
        Building wheel for preshed (setup.py): finished with status 'error'
        error: subprocess-exited-with-error

        python setup.py bdist_wheel did not run successfully.
        exit code: 1

        [42 lines of output]
        C:\Users\hudsonad\Anaconda3\lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
          warnings.warn(
        running bdist_wheel
        running build
        running build_py
        creating build
        creating build\lib.win-amd64-3.9
        creating build\lib.win-amd64-3.9\preshed
        copying preshed\about.py -> build\lib.win-amd64-3.9\preshed
        copying preshed\__init__.py -> build\lib.win-amd64-3.9\preshed
        creating build\lib.win-amd64-3.9\preshed\tests
        copying preshed\tests\test_counter.py -> build\lib.win-amd64-3.9\preshed\tests
        copying preshed\tests\test_hashing.py -> build\lib.win-amd64-3.9\preshed\tests
        copying preshed\tests\test_pop.py -> build\lib.win-amd64-3.9\preshed\tests
        copying preshed\tests\__init__.py -> build\lib.win-amd64-3.9\preshed\tests
        copying preshed\counter.pyx -> build\lib.win-amd64-3.9\preshed
        copying preshed\maps.pyx -> build\lib.win-amd64-3.9\preshed
        copying preshed\counter.pxd -> build\lib.win-amd64-3.9\preshed
        copying preshed\maps.pxd -> build\lib.win-amd64-3.9\preshed
        copying preshed\__init__.pxd -> build\lib.win-amd64-3.9\preshed
        running build_ext
        building 'preshed.maps' extension
        creating build\temp.win-amd64-3.9
        creating build\temp.win-amd64-3.9\Release
        creating build\temp.win-amd64-3.9\Release\preshed
        "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\hudsonad\Anaconda3\include -IC:\Users\hudsonad\Anaconda3\include -IC:\Users\hudsonad\Anaconda3\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tppreshed/maps.cpp /Fobuild\temp.win-amd64-3.9\Release\preshed/maps.obj /Ox /EHsc
        maps.cpp
        preshed/maps.cpp(5728): error C2039: 'tp_print': is not a member of '_typeobject'
        C:\Users\hudsonad\Anaconda3\include\cpython/object.h(193): note: see declaration of '_typeobject'
        preshed/maps.cpp(5740): error C2039: 'tp_print': is not a member of '_typeobject'
        C:\Users\hudsonad\Anaconda3\include\cpython/object.h(193): note: see declaration of '_typeobject'
        preshed/maps.cpp(5749): error C2039: 'tp_print': is not a member of '_typeobject'
        C:\Users\hudsonad\Anaconda3\include\cpython/object.h(193): note: see declaration of '_typeobject'
        preshed/maps.cpp(5755): error C2039: 'tp_print': is not a member of '_typeobject'
        C:\Users\hudsonad\Anaconda3\include\cpython/object.h(193): note: see declaration of '_typeobject'
        preshed/maps.cpp(5761): error C2039: 'tp_print': is not a member of '_typeobject'
        C:\Users\hudsonad\Anaconda3\include\cpython/object.h(193): note: see declaration of '_typeobject'
        preshed/maps.cpp(5767): error C2039: 'tp_print': is not a member of '_typeobject'
        C:\Users\hudsonad\Anaconda3\include\cpython/object.h(193): note: see declaration of '_typeobject'
        preshed/maps.cpp(6129): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
        preshed/maps.cpp(6145): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
        error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
        [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for preshed
        Running setup.py clean for preshed
        Building wheel for blis (setup.py): started
        Building wheel for blis (setup.py): finished with status 'error'
        error: subprocess-exited-with-error

        python setup.py bdist_wheel did not run successfully.
        exit code: 1

        [33 lines of output]
        BLIS_COMPILER? None
        running bdist_wheel
        running build
        running build_py
        creating build
        creating build\lib.win-amd64-3.9
        creating build\lib.win-amd64-3.9\blis
        copying blis\about.py -> build\lib.win-amd64-3.9\blis
        copying blis\benchmark.py -> build\lib.win-amd64-3.9\blis
        copying blis\__init__.py -> build\lib.win-amd64-3.9\blis
        creating build\lib.win-amd64-3.9\blis\tests
        copying blis\tests\common.py -> build\lib.win-amd64-3.9\blis\tests
        copying blis\tests\test_dotv.py -> build\lib.win-amd64-3.9\blis\tests
        copying blis\tests\test_gemm.py -> build\lib.win-amd64-3.9\blis\tests
        copying blis\tests\__init__.py -> build\lib.win-amd64-3.9\blis\tests
        copying blis\cy.pyx -> build\lib.win-amd64-3.9\blis
        copying blis\py.pyx -> build\lib.win-amd64-3.9\blis
        copying blis\cy.pxd -> build\lib.win-amd64-3.9\blis
        copying blis\__init__.pxd -> build\lib.win-amd64-3.9\blis
        running build_ext
        C:\Users\hudsonad\AppData\Local\Temp\1\pip-install-xwlhseua\blis_f6044dd4d07f48548964902c86472263\bin\cythonize.py:58: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
          if LooseVersion(cython_version) < LooseVersion('0.19'):
        C:\Users\hudsonad\Anaconda3\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\hudsonad\AppData\Local\Temp\1\pip-install-xwlhseua\blis_f6044dd4d07f48548964902c86472263\blis\cy.pxd
          tree = Parsing.p_module(s, pxd, full_module_name)
        C:\Users\hudsonad\Anaconda3\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\hudsonad\AppData\Local\Temp\1\pip-install-xwlhseua\blis_f6044dd4d07f48548964902c86472263\blis\py.pyx
          tree = Parsing.p_module(s, pxd, full_module_name)
        Processing blis\cy.pyx
        Processing blis\py.pyx
        error: [WinError 2] The system cannot find the file specified
        msvc
        py_compiler msvc
        {'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'HOSTTYPE': 'x86_64', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LANG': 'C.UTF-8', 'OLDPWD': '/home/matt/repos/flame-blis', 'VIRTUAL_ENV': '/home/matt/repos/cython-blis/env3.6', 'USER': 'matt', 'PWD': '/home/matt/repos/cython-blis', 'HOME': '/home/matt', 'NAME': 'LAPTOP-OMKOB3VM', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'SHELL': '/bin/bash', 'TERM': 'xterm-256color', 'SHLVL': '1', 'LOGNAME': 'matt', 'PATH': '/home/matt/repos/cython-blis/env3.6/bin:/tmp/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Users/matt/Documents/cmder/vendor/conemu-maximus5/ConEmu/Scripts:/mnt/c/Users/matt/Documents/cmder/vendor/conemu-maximus5:/mnt/c/Users/matt/Documents/cmder/vendor/conemu-maximus5/ConEmu:/mnt/c/Python37/Scripts:/mnt/c/Python37:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/iCLS:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/iCLS:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/WiFi/bin:/mnt/c/Program Files/Common Files/Intel/WirelessCommon:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/LLVM/bin:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files/nodejs:/mnt/c/Users/matt/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/matt/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/matt/AppData/Roaming/npm:/snap/bin:/mnt/c/Program Files/Oracle/VirtualBox', 'PS1': '(env3.6) \\[\\e]0;\\u@\\h: \\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ', 'VAGRANT_HOME': '/home/matt/.vagrant.d/', 'LESSOPEN': '| /usr/bin/lesspipe %s', '_': '/home/matt/repos/cython-blis/env3.6/bin/python'}
        clang -c C:\Users\hudsonad\AppData\Local\Temp\1\pip-install-xwlhseua\blis_f6044dd4d07f48548964902c86472263\blis\_src\config\bulldozer\bli_cntx_init_bulldozer.c -o C:\Users\hudsonad\AppData\Local\Temp\1\tmp_u4panl6\bli_cntx_init_bulldozer.o -O2 -funroll-all-loops -std=c99 -D_POSIX_C_SOURCE=200112L -DBLIS_VERSION_STRING="0.5.0-6" -DBLIS_IS_BUILDING_LIBRARY -Iinclude\windows-x86_64 -I.\frame\3\ -I.\frame\ind\ukernels\ -I.\frame\1m\ -I.\frame\1f\ -I.\frame\1\ -I.\frame\include -IC:\Users\hudsonad\AppData\Local\Temp\1\pip-install-xwlhseua\blis_f6044dd4d07f48548964902c86472263\blis\_src\include\windows-x86_64
        [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for blis
        Running setup.py clean for blis
      Failed to build thinc preshed blis
      Installing collected packages: wrapt, wasabi, srsly, plac, cymem, wheel, six, setuptools, preshed, numpy, murmurhash, Cython, colorama, tqdm, thinc_gpu_ops, blis, thinc
        Running setup.py install for preshed: started
        Running setup.py install for preshed: finished with status 'error'
        error: subprocess-exited-with-error

        Running setup.py install for preshed did not run successfully.
        exit code: 1

        [13 lines of output]
        C:\Users\hudsonad\Anaconda3\lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
          warnings.warn(
        running install
        C:\Users\hudsonad\Anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
          warnings.warn(
        running build
        running build_py
        running build_ext
        building 'preshed.maps' extension
        "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\hudsonad\Anaconda3\include -IC:\Users\hudsonad\Anaconda3\include -IC:\Users\hudsonad\Anaconda3\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tppreshed/maps.cpp /Fobuild\temp.win-amd64-3.9\Release\preshed/maps.obj /Ox /EHsc
        maps.cpp
        c1xx: fatal error C1083: Cannot open source file: 'preshed/maps.cpp': No such file or directory
        error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
        [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: legacy-install-failure

      Encountered error while trying to install package.

      preshed

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for output from the failure.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

我已经安装了MS Visual C++构建工具,但仍然会出现此错误。我没能找到任何关于如何解决它的方法。任何帮助都将不胜感激!

EN

回答 2

Stack Overflow用户

发布于 2022-08-17 18:43:31

这是一个问题,因为包.cpp发行版中提供的.tar.gz文件与某些版本的python不兼容,这些版本比包更新。当这个包发布时,最新版本的python是3.7。

最简单的解决方案是使用较旧版本的python,特别是可以使用pip从编译的车轮安装所有东西,而不必编译任何东西,比如python3.7。

如果您真的想使用python 3.9,那么您可以尝试直接从github存档中安装每个repo / version标记,它将使用一个更新版本的cython生成与python 3.9兼容的文件:

代码语言:javascript
运行
复制
pip install -r cython "cymem>=2.0.2,<2.1.0"
pip install https://github.com/explosion/preshed/archive/v2.0.1.zip

对于所有有相同错误的其他需求,您可能不得不重复这样做: 1)安装此版本的要求(在此标记处的repo中查找requirements.txt ),2)从该标记的pip install中安装,或者从本地克隆或从这种归档URL中安装。

票数 0
EN

Stack Overflow用户

发布于 2022-08-17 21:44:27

一个很好的起点是检查兼容的python版本。如果您检查pypi页,您将看到python3.6被列出为唯一的一个,所以只需使用conda的功能来创建一个环境并在那里安装:

代码语言:javascript
运行
复制
conda create -n newEnv python=3.6
conda activate newEnv
pip install nlpre
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73391414

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档