#virtual-environment #chatterbot #python-3.9
#виртуальная среда #chatterbot #python-3.9
Вопрос:
Я попытался загрузить пакет chatterbot в Windows 10, но он всегда показывает ошибку. Я использую python 3.9 и пытаюсь установить его в виртуальной среде.
Я недавно загрузил Microsoft Visual C 2019, и я думаю, что ошибка вызвана инструментами сборки для C , как я вижу в одной из строк ниже
Это мои команды:
(virtual_assistant) C:UsersDELLmy_envs>pip install chatterbot
Collecting chatterbot
Using cached ChatterBot-1.0.5-py2.py3-none-any.whl (67 kB)
Collecting python-dateutil<2.8,>=2.7
Using cached python_dateutil-2.7.5-py2.py3-none-any.whl (225 kB)
Collecting pyyaml<5.2,>=5.1
Using cached PyYAML-5.1.2.tar.gz (265 kB)
Requirement already satisfied: pytz in c:usersdellmy_envsvirtual_assistantlibsite-packages (from chatterbot) (2020.4)
Collecting sqlalchemy<1.3,>=1.2
Using cached SQLAlchemy-1.2.19.tar.gz (5.7 MB)
Collecting nltk<4.0,>=3.2
Using cached nltk-3.5.zip (1.4 MB)
Collecting pymongo<4.0,>=3.3
Using cached pymongo-3.11.0.tar.gz (771 kB)
Collecting spacy<2.2,>=2.1
Using cached spacy-2.1.9.tar.gz (30.7 MB)
**Installing build dependencies ... error**
ERROR: Command errored out with exit status 1:
command: 'c:usersdellmy_envsvirtual_assistantscriptspython.exe' 'c:usersdellmy_envsvirtual_assistantlibsite-packagespip' install --ignore-installed --no-user --prefix 'C:UsersDELLAppDataLocalTemppip-build-env-polm76zgoverlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0'
cwd: None
Complete output (79 lines):
Collecting setuptools
Using cached setuptools-50.3.2-py3-none-any.whl (785 kB)
Collecting wheel<0.33.0,>0.32.0
Using cached wheel-0.32.3-py2.py3-none-any.whl (21 kB)
Collecting Cython
Using cached Cython-0.29.21-py2.py3-none-any.whl (974 kB)
Collecting cymem<2.1.0,>=2.0.2
Using cached cymem-2.0.4-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)
Collecting murmurhash<1.1.0,>=0.28.0
Using cached murmurhash-1.0.4-cp39-cp39-win_amd64.whl (21 kB)
Collecting thinc<7.1.0,>=7.0.8
Using cached thinc-7.0.8.tar.gz (1.9 MB)
Collecting blis<0.3.0,>=0.2.1
Using cached blis-0.2.4.tar.gz (1.5 MB)
Collecting wasabi<1.1.0,>=0.0.9
Using cached wasabi-0.8.0-py3-none-any.whl (23 kB)
Collecting srsly<1.1.0,>=0.0.6
Using cached srsly-1.0.4-cp39-cp39-win_amd64.whl (287 kB)
Collecting numpy>=1.7.0
Using cached numpy-1.19.4-cp39-cp39-win_amd64.whl (13.0 MB)
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.51.0-py2.py3-none-any.whl (70 kB)
Using legacy 'setup.py install' for preshed, since package 'wheel' is not installed.
Using legacy 'setup.py install' for thinc, since package 'wheel' is not installed.
Using legacy 'setup.py install' for blis, since package 'wheel' is not installed.
Installing collected packages: setuptools, wheel, Cython, cymem, preshed, murmurhash, numpy, blis, wasabi, srsly, plac, tqdm, thinc
Running setup.py install for preshed: started
Running setup.py install for preshed: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'c:usersdellmy_envsvirtual_assistantscriptspython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\DELL\AppData\Local\Temp\pip-install-380d1mym\preshed\setup.py'"'"'; __file__='"'"'C:\Users\DELL\AppData\Local\Temp\pip-install-380d1mym\preshed\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersDELLAppDataLocalTemppip-record-sl91g3ciinstall-record.txt' --single-version-externally-managed --prefix 'C:UsersDELLAppDataLocalTemppip-build-env-polm76zgoverlay' --compile --install-headers 'C:UsersDELLAppDataLocalTemppip-build-env-polm76zgoverlayincludesitepython3.9preshed'
cwd: C:UsersDELLAppDataLocalTemppip-install-380d1mympreshed
Complete output (41 lines):
WARNING: The wheel package is not available.
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9preshed
copying preshedabout.py -> buildlib.win-amd64-3.9preshed
copying preshed__init__.py -> buildlib.win-amd64-3.9preshed
creating buildlib.win-amd64-3.9preshedtests
copying preshedteststest_counter.py -> buildlib.win-amd64-3.9preshedtests
copying preshedteststest_hashing.py -> buildlib.win-amd64-3.9preshedtests
copying preshedteststest_pop.py -> buildlib.win-amd64-3.9preshedtests
copying preshedtests__init__.py -> buildlib.win-amd64-3.9preshedtests
copying preshedcounter.pyx -> buildlib.win-amd64-3.9preshed
copying preshedmaps.pyx -> buildlib.win-amd64-3.9preshed
copying preshedcounter.pxd -> buildlib.win-amd64-3.9preshed
copying preshedmaps.pxd -> buildlib.win-amd64-3.9preshed
copying preshed__init__.pxd -> buildlib.win-amd64-3.9preshed
running build_ext
building 'preshed.maps' extension
creating buildtemp.win-amd64-3.9
creating buildtemp.win-amd64-3.9Release
creating buildtemp.win-amd64-3.9Releasepreshed
C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:UsersDELLAppDataLocalProgramsPythonPython39include -Ic:usersdellmy_envsvirtual_assistantinclude -IC:UsersDELLAppDataLocalProgramsPythonPython39include -IC:UsersDELLAppDataLocalProgramsPythonPython39include -IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333include -IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0shared -IC:Program Files (x86)Windows Kits10include10.0.18362.0um -IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt /EHsc /Tppreshed/maps.cpp /Fobuildtemp.win-amd64-3.9Releasepreshed/maps.obj /Ox /EHsc
maps.cpp
preshed/maps.cpp(5728): error C2039: 'tp_print': is not a member of '_typeobject'
C:UsersDELLAppDataLocalProgramsPythonPython39includecpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(5740): error C2039: 'tp_print': is not a member of '_typeobject'
C:UsersDELLAppDataLocalProgramsPythonPython39includecpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(5749): error C2039: 'tp_print': is not a member of '_typeobject'
C:UsersDELLAppDataLocalProgramsPythonPython39includecpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(5755): error C2039: 'tp_print': is not a member of '_typeobject'
C:UsersDELLAppDataLocalProgramsPythonPython39includecpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(5761): error C2039: 'tp_print': is not a member of '_typeobject'
C:UsersDELLAppDataLocalProgramsPythonPython39includecpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(5767): error C2039: 'tp_print': is not a member of '_typeobject'
C:UsersDELLAppDataLocalProgramsPythonPython39includecpython/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 (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersdellmy_envsvirtual_assistantscriptspython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\DELL\AppData\Local\Temp\pip-install-380d1mym\preshed\setup.py'"'"'; __file__='"'"'C:\Users\DELL\AppData\Local\Temp\pip-install-380d1mym\preshed\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersDELLAppDataLocalTemppip-record-sl91g3ciinstall-record.txt' --single-version-externally-managed --prefix 'C:UsersDELLAppDataLocalTemppip-build-env-polm76zgoverlay' --compile --install-headers 'C:UsersDELLAppDataLocalTemppip-build-env-polm76zgoverlayincludesitepython3.9preshed' Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersdellmy_envsvirtual_assistantscriptspython.exe' 'c:usersdellmy_envsvirtual_assistantlibsite-packagespip' install --ignore-installed --no-user --prefix 'C:UsersDELLAppDataLocalTemppip-build-env-polm76zgoverlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0' Check the logs for full command output.
Пожалуйста, помогите мне разобраться в проблеме
Ответ №1:
Python 3.9 — это новая версия python на данный момент (ноябрь 2020 года), для нее еще не все диски упакованы.
Попробуйте использовать python 3.7, в котором есть доступные диски. Если вы должны использовать более позднюю версию, вам нужно будет установить из исходного кода.