hankcs/HanLP

pip install hanlp[full]时,会安装Collecting tensorflow>=2.8.0 Using cached tensorflow-2.17.0-cp39-cp39-win_amd64.whl (2.0 kB)

qingting04 opened this issue · 1 comments

Describe the bug
A clear and concise description of what the bug is.

Code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate the problem.

# 在Windows 11 23H2系统上运行以下命令
pip install hanlp[full]

Describe the current behavior
在Windows 11 23H2系统上使用Python 3.9.13安装HanLP[full]时,会自动安装tensorflow==2.17.0,这与项目中setup.py所要求的版本不一致,导致程序无法正常运行。此外,尝试降级tensorflow版本时,会遇到多个依赖项之间的冲突。
Expected behavior
期望安装HanLP[full]时,能够自动匹配适合的tensorflow版本,或者提供解决依赖冲突的建议。

System information
-OS Platform and Distribution: Windows 11 23H2
-Python version: 3.9.13
-HanLP version: 2.1.0b59

Other info / logs
D:>cd d:\Code-Compile\Language\Python39\Scripts

d:\Code-Compile\Language\Python39\Scripts>pip -V
pip 22.0.4 from D:\Code-Compile\Language\Python39\lib\site-packages\pip (python 3.9)

d:\Code-Compile\Language\Python39\Scripts>pip install hanlp[full]
Collecting hanlp[full]
Downloading hanlp-2.1.0b59-py3-none-any.whl (651 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 651.6/651.6 KB 42.8 MB/s eta 0:00:00
Collecting pynvml
Using cached pynvml-11.5.3-py3-none-any.whl (53 kB)
Collecting sentencepiece>=0.1.91
Using cached sentencepiece-0.2.0-cp39-cp39-win_amd64.whl (991 kB)
Collecting torch>=1.6.0
Using cached torch-2.4.0-cp39-cp39-win_amd64.whl (198.0 MB)
Collecting hanlp-downloader
Using cached hanlp_downloader-0.0.25-py3-none-any.whl
Collecting hanlp-trie>=0.0.4
Using cached hanlp_trie-0.0.5-py3-none-any.whl
Collecting termcolor
Using cached termcolor-2.4.0-py3-none-any.whl (7.7 kB)
Collecting hanlp-common>=0.0.20
Using cached hanlp_common-0.0.20-py3-none-any.whl
Collecting toposort==1.5
Using cached toposort-1.5-py2.py3-none-any.whl (7.6 kB)
Collecting transformers>=4.1.1
Downloading transformers-4.44.1-py3-none-any.whl (9.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.5/9.5 MB 28.7 MB/s eta 0:00:00
Collecting tensorflow>=2.8.0
Using cached tensorflow-2.17.0-cp39-cp39-win_amd64.whl (2.0 kB)
Collecting perin-parser>=0.0.12
Using cached perin_parser-0.0.14-py3-none-any.whl
Collecting penman==1.2.1
Using cached Penman-1.2.1-py3-none-any.whl (43 kB)
Collecting fasttext-wheel==0.9.2
Using cached fasttext_wheel-0.9.2-cp39-cp39-win_amd64.whl (225 kB)
Collecting networkx>=2.5.1
Using cached networkx-3.2.1-py3-none-any.whl (1.6 MB)
Collecting pybind11>=2.2
Using cached pybind11-2.13.4-py3-none-any.whl (240 kB)
Requirement already satisfied: setuptools>=0.7.0 in d:\code-compile\language\python39\lib\site-packages (from fasttext-wheel==0.9.2->hanlp[full]) (58.1.0)
Collecting numpy
Using cached numpy-2.0.1-cp39-cp39-win_amd64.whl (16.6 MB)
Collecting phrasetree>=0.0.9
Using cached phrasetree-0.0.9-py3-none-any.whl
Collecting scipy
Using cached scipy-1.13.1-cp39-cp39-win_amd64.whl (46.2 MB)
Collecting tensorflow-intel==2.17.0
Using cached tensorflow_intel-2.17.0-cp39-cp39-win_amd64.whl (385.0 MB)
Collecting libclang>=13.0.0
Using cached libclang-18.1.1-py2.py3-none-win_amd64.whl (26.4 MB)
Collecting google-pasta>=0.1.1
Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB)
Collecting grpcio<2.0,>=1.24.3
Downloading grpcio-1.65.5-cp39-cp39-win_amd64.whl (4.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.1/4.1 MB 53.0 MB/s eta 0:00:00
Collecting astunparse>=1.6.0
Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Collecting absl-py>=1.0.0
Using cached absl_py-2.1.0-py3-none-any.whl (133 kB)
Collecting protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3
Using cached protobuf-4.25.4-cp39-cp39-win_amd64.whl (413 kB)
Collecting wrapt>=1.11.0
Using cached wrapt-1.16.0-cp39-cp39-win_amd64.whl (37 kB)
Collecting h5py>=3.10.0
Using cached h5py-3.11.0-cp39-cp39-win_amd64.whl (3.0 MB)
Collecting ml-dtypes<0.5.0,>=0.3.1
Using cached ml_dtypes-0.4.0-cp39-cp39-win_amd64.whl (126 kB)
Collecting numpy
Using cached numpy-1.26.4-cp39-cp39-win_amd64.whl (15.8 MB)
Collecting keras>=3.2.0
Using cached keras-3.5.0-py3-none-any.whl (1.1 MB)
Collecting tensorboard<2.18,>=2.17
Using cached tensorboard-2.17.1-py3-none-any.whl (5.5 MB)
Collecting gast!=0.5.0,!=0.5.1,!=0.5.2,>=0.2.1
Using cached gast-0.6.0-py3-none-any.whl (21 kB)
Collecting opt-einsum>=2.3.2
Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB)
Collecting typing-extensions>=3.6.6
Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Collecting flatbuffers>=24.3.25
Using cached flatbuffers-24.3.25-py2.py3-none-any.whl (26 kB)
Collecting requests<3,>=2.21.0
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Collecting packaging
Using cached packaging-24.1-py3-none-any.whl (53 kB)
Collecting tensorflow-io-gcs-filesystem>=0.23.1
Using cached tensorflow_io_gcs_filesystem-0.31.0-cp39-cp39-win_amd64.whl (1.5 MB)
Collecting six>=1.12.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting fsspec
Using cached fsspec-2024.6.1-py3-none-any.whl (177 kB)
Collecting sympy
Using cached sympy-1.13.2-py3-none-any.whl (6.2 MB)
Collecting filelock
Using cached filelock-3.15.4-py3-none-any.whl (16 kB)
Collecting jinja2
Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Collecting pyyaml>=5.1
Using cached PyYAML-6.0.2-cp39-cp39-win_amd64.whl (162 kB)
Collecting safetensors>=0.4.1
Using cached safetensors-0.4.4-cp39-none-win_amd64.whl (286 kB)
Collecting tqdm>=4.27
Using cached tqdm-4.66.5-py3-none-any.whl (78 kB)
Collecting regex!=2019.12.17
Using cached regex-2024.7.24-cp39-cp39-win_amd64.whl (269 kB)
Collecting huggingface-hub<1.0,>=0.23.2
Downloading huggingface_hub-0.24.6-py3-none-any.whl (417 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 417.5/417.5 KB 25.5 MB/s eta 0:00:00
Collecting tokenizers<0.20,>=0.19
Using cached tokenizers-0.19.1-cp39-none-win_amd64.whl (2.2 MB)
Collecting idna<4,>=2.5
Using cached idna-3.7-py3-none-any.whl (66 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2024.7.4-py3-none-any.whl (162 kB)
Collecting urllib3<3,>=1.21.1
Using cached urllib3-2.2.2-py3-none-any.whl (121 kB)
Collecting charset-normalizer<4,>=2
Using cached charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl (100 kB)
Collecting colorama
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting MarkupSafe>=2.0
Using cached MarkupSafe-2.1.5-cp39-cp39-win_amd64.whl (17 kB)
Collecting mpmath<1.4,>=1.1.0
Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Collecting wheel<1.0,>=0.23.0
Using cached wheel-0.44.0-py3-none-any.whl (67 kB)
Collecting rich
Using cached rich-13.7.1-py3-none-any.whl (240 kB)
Collecting namex
Using cached namex-0.0.8-py3-none-any.whl (5.8 kB)
Collecting optree
Using cached optree-0.12.1-cp39-cp39-win_amd64.whl (263 kB)
Collecting tensorboard-data-server<0.8.0,>=0.7.0
Using cached tensorboard_data_server-0.7.2-py3-none-any.whl (2.4 kB)
Collecting markdown>=2.6.8
Downloading Markdown-3.7-py3-none-any.whl (106 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.3/106.3 KB 6.0 MB/s eta 0:00:00
Collecting werkzeug>=1.0.1
Using cached werkzeug-3.0.3-py3-none-any.whl (227 kB)
Collecting importlib-metadata>=4.4
Downloading importlib_metadata-8.4.0-py3-none-any.whl (26 kB)
Collecting pygments<3.0.0,>=2.13.0
Using cached pygments-2.18.0-py3-none-any.whl (1.2 MB)
Collecting markdown-it-py>=2.2.0
Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Collecting zipp>=0.5
Using cached zipp-3.20.0-py3-none-any.whl (9.4 kB)
Collecting mdurl~=0.1
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Installing collected packages: toposort, sentencepiece, phrasetree, penman, namex, mpmath, libclang, flatbuffers, zipp, wrapt, wheel, urllib3, typing-extensions, termcolor, tensorflow-io-gcs-filesystem, tensorboard-data-server, sympy, six, safetensors, regex, pyyaml, pynvml, pygments, pybind11, protobuf, packaging, numpy, networkx, mdurl, MarkupSafe, idna, hanlp-common, grpcio, gast, fsspec, filelock, colorama, charset-normalizer, certifi, absl-py, werkzeug, tqdm, scipy, requests, optree, opt-einsum, ml-dtypes, markdown-it-py, jinja2, importlib-metadata, hanlp-trie, h5py, google-pasta, fasttext-wheel, astunparse, torch, rich, perin-parser, markdown, huggingface-hub, hanlp-downloader, tokenizers, tensorboard, keras, transformers, tensorflow-intel, tensorflow, hanlp
WARNING: The script penman.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script wheel.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script isympy.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script pygmentize.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script pybind11-config.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script f2py.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script normalizer.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script tqdm.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script markdown-it.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts convert-caffe2-to-onnx.exe, convert-onnx-to-caffe2.exe and torchrun.exe are installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script markdown_py.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script huggingface-cli.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script tensorboard.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script transformers-cli.exe is installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts import_pb_to_tensorboard.exe, saved_model_cli.exe, tensorboard.exe, tf_upgrade_v2.exe, tflite_convert.exe, toco.exe and toco_from_protos.exe are installed in 'D:\Code-Compile\Language\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed MarkupSafe-2.1.5 absl-py-2.1.0 astunparse-1.6.3 certifi-2024.7.4 charset-normalizer-3.3.2 colorama-0.4.6 fasttext-wheel-0.9.2 filelock-3.15.4 flatbuffers-24.3.25 fsspec-2024.6.1 gast-0.6.0 google-pasta-0.2.0 grpcio-1.65.5 h5py-3.11.0 hanlp-2.1.0b59 hanlp-common-0.0.20 hanlp-downloader-0.0.25 hanlp-trie-0.0.5 huggingface-hub-0.24.6 idna-3.7 importlib-metadata-8.4.0 jinja2-3.1.4 keras-3.5.0 libclang-18.1.1 markdown-3.7 markdown-it-py-3.0.0 mdurl-0.1.2 ml-dtypes-0.4.0 mpmath-1.3.0 namex-0.0.8 networkx-3.2.1 numpy-1.26.4 opt-einsum-3.3.0 optree-0.12.1 packaging-24.1 penman-1.2.1 perin-parser-0.0.14 phrasetree-0.0.9 protobuf-4.25.4 pybind11-2.13.4 pygments-2.18.0 pynvml-11.5.3 pyyaml-6.0.2 regex-2024.7.24 requests-2.32.3 rich-13.7.1 safetensors-0.4.4 scipy-1.13.1 sentencepiece-0.2.0 six-1.16.0 sympy-1.13.2 tensorboard-2.17.1 tensorboard-data-server-0.7.2 tensorflow-2.17.0 tensorflow-intel-2.17.0 tensorflow-io-gcs-filesystem-0.31.0 termcolor-2.4.0 tokenizers-0.19.1 toposort-1.5 torch-2.4.0 tqdm-4.66.5 transformers-4.44.1 typing-extensions-4.12.2 urllib3-2.2.2 werkzeug-3.0.3 wheel-0.44.0 wrapt-1.16.0 zipp-3.20.0
WARNING: You are using pip version 22.0.4; however, version 24.2 is available.
You should consider upgrading via the 'D:\Code-Compile\Language\Python39\python.exe -m pip install --upgrade pip' command.

  • I've completed this form and searched the web for solutions.

感谢反馈,已经修复,请检查上面的commit是否解决了这个问题。
如果还有问题,欢迎重开issue。