当前位置:   article > 正文

paddlehub的简单应用

paddlehub的简单应用

1、下载安装

pip install paddlehub -i https://pypi.tuna.tsinghua.edu.cn/simple

报错:

  1. Collecting onnx<=1.9.0 (from paddle2onnx>=0.5.1->paddlehub)
  2. Using cached https://pypi.tuna.tsinghua.edu.cn/packages/73/e9/5b953497c0e36df589fc60cc6c6b35a65eb67d9ad1e45a9163663e43426e/onnx-1.9.0.tar.gz (9.8 MB)
  3. Installing build dependencies ... done
  4. Getting requirements to build wheel ... error
  5. error: subprocess-exited-with-error
  6. × Getting requirements to build wheel did not run successfully.
  7. exit code: 1
  8. ╰─> [21 lines of output]
  9. fatal: not a git repository (or any of the parent directories): .git
  10. Traceback (most recent call last):
  11. File "E:\software\python_env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
  12. main()
  13. File "E:\software\python_env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
  14. json_out['return_val'] = hook(**hook_input['kwargs'])
  15. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  16. File "E:\software\python_env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
  17. return hook(config_settings)
  18. ^^^^^^^^^^^^^^^^^^^^^
  19. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-8xaz33be\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
  20. return self._get_build_requires(config_settings, requirements=['wheel'])
  21. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  22. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-8xaz33be\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
  23. self.run_setup()
  24. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-8xaz33be\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
  25. super().run_setup(setup_script=setup_script)
  26. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-8xaz33be\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
  27. exec(code, locals())
  28. File "<string>", line 86, in <module>
  29. note: This error originates from a subprocess, and is likely not a problem with pip.

看样子像是缺少Cmake

下载安装cmake尝试解决一下:

下载地址:

Index of /files/v3.29

安装 按需修改并下一步即可

安装完成后重新尝试下载又报错

  1. Building wheels for collected packages: onnx, ffmpy, jieba, seqeval
  2. Building wheel for onnx (pyproject.toml) ... error
  3. error: subprocess-exited-with-error
  4. × Building wheel for onnx (pyproject.toml) did not run successfully.
  5. exit code: 1
  6. ╰─> [128 lines of output]
  7. fatal: not a git repository (or any of the parent directories): .git
  8. C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\dist.py:476: SetuptoolsDeprecationWarning: Invalid dash-separated options
  9. !!
  10. ********************************************************************************
  11. Usage of dash-separated 'license-file' will not be supported in future
  12. versions. Please use the underscore name 'license_file' instead.
  13. By 2024-Sep-26, you need to update your project and remove deprecated calls
  14. or your builds will no longer be supported.
  15. See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
  16. ********************************************************************************
  17. !!
  18. opt = self.warn_dash_deprecation(opt, section)
  19. running bdist_wheel
  20. running build
  21. running build_py
  22. running create_version
  23. running cmake_build
  24. Using cmake args: ['E:\\Cmake\\bin\\cmake.exe', '-DPYTHON_INCLUDE_DIR=E:\\python3.12\\include', '-DPYTHON_EXECUTABLE=E:\\python3.12\\python.exe', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cp312-win_amd64.pyd', '-DCMAKE_BUILD_TYPE=Release', '-DPY_VERSION=3.12', '-DONNX_USE_MSVC_STATIC_RUNTIME=ON', '-A', 'x64', '-T', 'host=x64', '-DONNX_ML=1', 'C:\\Users\\GW00227659\\AppData\\Local\\Temp\\pip-install-p8lc4nvf\\onnx_839c8e8f20ee47c98bd84c37098fe5f3']
  25. -- Building for: Visual Studio 17 2022
  26. CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
  27. Compatibility with CMake < 3.5 will be removed from a future version of
  28. CMake.
  29. Update the VERSION argument <min> value or use a ...<max> suffix to tell
  30. CMake that the project does not need compatibility with older versions.
  31. -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19044.
  32. -- The C compiler identification is MSVC 19.39.33523.0
  33. -- The CXX compiler identification is MSVC 19.39.33523.0
  34. -- Detecting C compiler ABI info
  35. -- Detecting C compiler ABI info - done
  36. -- Check for working C compiler: D:/C++BuildTools/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
  37. -- Detecting C compile features
  38. -- Detecting C compile features - done
  39. -- Detecting CXX compiler ABI info
  40. -- Detecting CXX compiler ABI info - done
  41. -- Check for working CXX compiler: D:/C++BuildTools/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
  42. -- Detecting CXX compile features
  43. -- Detecting CXX compile features - done
  44. CMake Warning (dev) at CMakeLists.txt:114 (find_package):
  45. Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  46. are removed. Run "cmake --help-policy CMP0148" for policy details. Use
  47. the cmake_policy command to set the policy and suppress this warning.
  48. This warning is for project developers. Use -Wno-dev to suppress it.
  49. -- Found PythonInterp: E:/python3.12/python.exe (found suitable version "3.12.2", minimum required is "3.12")
  50. CMake Warning (dev) at CMakeLists.txt:115 (find_package):
  51. Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  52. are removed. Run "cmake --help-policy CMP0148" for policy details. Use
  53. the cmake_policy command to set the policy and suppress this warning.
  54. This warning is for project developers. Use -Wno-dev to suppress it.
  55. -- Found PythonLibs: E:/python3.12/libs/python312.lib (found suitable version "3.12.2", minimum required is "3.12")
  56. Generated: C:/Users/GW00227659/AppData/Local/Temp/pip-install-p8lc4nvf/onnx_839c8e8f20ee47c98bd84c37098fe5f3/.setuptools-cmake-build/onnx/onnx-ml.proto
  57. CMake Error at CMakeLists.txt:292 (message):
  58. Protobuf compiler not found
  59. Call Stack (most recent call first):
  60. CMakeLists.txt:323 (relative_protobuf_generate_cpp)
  61. -- Configuring incomplete, errors occurred!
  62. Traceback (most recent call last):
  63. File "E:\python3.12\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
  64. main()
  65. File "E:\python3.12\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
  66. json_out['return_val'] = hook(**hook_input['kwargs'])
  67. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  68. File "E:\python3.12\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
  69. return _build_backend().build_wheel(wheel_directory, config_settings,
  70. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  71. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\build_meta.py", line 410, in build_wheel
  72. return self._build_with_temp_dir(
  73. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  74. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\build_meta.py", line 395, in _build_with_temp_dir
  75. self.run_setup()
  76. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
  77. super().run_setup(setup_script=setup_script)
  78. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
  79. exec(code, locals())
  80. File "<string>", line 337, in <module>
  81. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\__init__.py", line 104, in setup
  82. return distutils.core.setup(**attrs)
  83. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  84. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup
  85. return run_commands(dist)
  86. ^^^^^^^^^^^^^^^^^^
  87. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
  88. dist.run_commands()
  89. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
  90. self.run_command(cmd)
  91. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
  92. super().run_command(command)
  93. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
  94. cmd_obj.run()
  95. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 368, in run
  96. self.run_command("build")
  97. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
  98. self.distribution.run_command(command)
  99. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
  100. super().run_command(command)
  101. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
  102. cmd_obj.run()
  103. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
  104. self.run_command(cmd_name)
  105. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
  106. self.distribution.run_command(command)
  107. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
  108. super().run_command(command)
  109. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
  110. cmd_obj.run()
  111. File "<string>", line 233, in run
  112. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
  113. self.distribution.run_command(command)
  114. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
  115. super().run_command(command)
  116. File "C:\Users\GW00227659\AppData\Local\Temp\pip-build-env-xzlgyxam\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
  117. cmd_obj.run()
  118. File "<string>", line 219, in run
  119. File "E:\python3.12\Lib\subprocess.py", line 413, in check_call
  120. raise CalledProcessError(retcode, cmd)
  121. subprocess.CalledProcessError: Command '['E:\\Cmake\\bin\\cmake.exe', '-DPYTHON_INCLUDE_DIR=E:\\python3.12\\include', '-DPYTHON_EXECUTABLE=E:\\python3.12\\python.exe', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cp312-win_amd64.pyd', '-DCMAKE_BUILD_TYPE=Release', '-DPY_VERSION=3.12', '-DONNX_USE_MSVC_STATIC_RUNTIME=ON', '-A', 'x64', '-T', 'host=x64', '-DONNX_ML=1', 'C:\\Users\\GW00227659\\AppData\\Local\\Temp\\pip-install-p8lc4nvf\\onnx_839c8e8f20ee47c98bd84c37098fe5f3']' returned non-zero exit status 1.
  122. [end of output]
  123. note: This error originates from a subprocess, and is likely not a problem with pip.
  124. ERROR: Failed building wheel for onnx
  125. Building wheel for ffmpy (pyproject.toml) ... done
  126. Created wheel for ffmpy: filename=ffmpy-0.3.2-py3-none-any.whl size=5607 sha256=7f5100e5417f0e937537a8a31a1ec96fed2b914e5ccaee15044851db5c0adf07
  127. Stored in directory: c:\users\gw00227659\appdata\local\pip\cache\wheels\08\c5\8a\310ab3add33cd0284165ab43f11f77104184473544fdf4efd3
  128. Building wheel for jieba (pyproject.toml) ... done
  129. Created wheel for jieba: filename=jieba-0.42.1-py3-none-any.whl size=19314474 sha256=982d656865bf5e3af1e16e3f028da8f818e1c455a4ccfd61f72639ea2cd15c83
  130. Stored in directory: c:\users\gw00227659\appdata\local\pip\cache\wheels\7b\3a\3e\1bf625b8dd63d53265aad527b244647c679dff9b60588a324f
  131. Building wheel for seqeval (pyproject.toml) ... done
  132. Created wheel for seqeval: filename=seqeval-1.2.2-py3-none-any.whl size=16186 sha256=a01810a8d4efcbb8769e6237e10ed26851e8c14452c253a1cc6add951db7f304
  133. Stored in directory: c:\users\gw00227659\appdata\local\pip\cache\wheels\87\ae\4e\f12172105b270473557d0ff3889c45972a4c0f25d5905e1d4e
  134. Successfully built ffmpy jieba seqeval
  135. Failed to build onnx
  136. ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects

尝试解决:

  1. Poetry:Poetry 是一个用于管理基于 pyproject.toml 的 Python 项目的工具。可以使用 pip 安装 Poetry:

  2. pip install poetry
    

重新下载依然是相同的报错 

尝试解决:

手动安装onnx :pip install onnx

 依然失败 ~~~~ 不知道报错的原因 盲目解决不掉啊

然后我重启了pycharm,在pycharm环境中下载成功了(为啥会重启呢,是因为我尝试在pycharm再次下载时,依然报错没有cmake,我猜测环境变量没有重新加载,因为此时我已经安装过cmake)

成功下载:

  1. pip install paddlehub -i https://pypi.tuna.tsinghua.edu.cn/simple
  2. Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
  3. Requirement already satisfied: paddlehub in e:\software\python_env\lib\site-packages (2.0.0)
  4. Requirement already satisfied: colorama in e:\software\python_env\lib\site-packages (from paddlehub) (0.4.6)
  5. Requirement already satisfied: colorlog in e:\software\python_env\lib\site-packages (from paddlehub) (6.8.2)
  6. Requirement already satisfied: easydict in e:\software\python_env\lib\site-packages (from paddlehub) (1.13)
  7. Requirement already satisfied: filelock in e:\software\python_env\lib\site-packages (from paddlehub) (3.13.1)
  8. Requirement already satisfied: flask>=1.1.0 in e:\software\python_env\lib\site-packages (from paddlehub) (3.0.2)
  9. Requirement already satisfied: gitpython in e:\software\python_env\lib\site-packages (from paddlehub) (3.1.37)
  10. Requirement already satisfied: numpy in e:\python3.12\lib\site-packages (from paddlehub) (1.26.4)
  11. Requirement already satisfied: matplotlib in e:\software\python_env\lib\site-packages (from paddlehub) (3.8.3)
  12. Requirement already satisfied: opencv-python in e:\software\python_env\lib\site-packages (from paddlehub) (4.9.0.80)
  13. Requirement already satisfied: packaging in e:\software\python_env\lib\site-packages (from paddlehub) (23.2)
  14. Requirement already satisfied: Pillow in e:\python3.12\lib\site-packages (from paddlehub) (10.2.0)
  15. Requirement already satisfied: pyyaml in e:\software\python_env\lib\site-packages (from paddlehub) (6.0.1)
  16. Requirement already satisfied: pyzmq in e:\software\python_env\lib\site-packages (from paddlehub) (25.1.2)
  17. Requirement already satisfied: rarfile in e:\software\python_env\lib\site-packages (from paddlehub) (4.2)
  18. Requirement already satisfied: tqdm in e:\software\python_env\lib\site-packages (from paddlehub) (4.66.2)
  19. Requirement already satisfied: visualdl>=2.0.0 in e:\software\python_env\lib\site-packages (from paddlehub) (2.5.3)
  20. Requirement already satisfied: paddlenlp>=2.0.0b2 in e:\software\python_env\lib\site-packages (from paddlehub) (2.6.1)
  21. Requirement already satisfied: Werkzeug>=3.0.0 in e:\software\python_env\lib\site-packages (from flask>=1.1.0->paddlehub) (3.0.1)
  22. Requirement already satisfied: Jinja2>=3.1.2 in e:\software\python_env\lib\site-packages (from flask>=1.1.0->paddlehub) (3.1.3)
  23. Requirement already satisfied: itsdangerous>=2.1.2 in e:\software\python_env\lib\site-packages (from flask>=1.1.0->paddlehub) (2.1.2)
  24. Requirement already satisfied: click>=8.1.3 in e:\python3.12\lib\site-packages (from flask>=1.1.0->paddlehub) (8.1.7)
  25. Requirement already satisfied: blinker>=1.6.2 in e:\software\python_env\lib\site-packages (from flask>=1.1.0->paddlehub) (1.7.0)
  26. Requirement already satisfied: jieba in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (0.42.1)
  27. Requirement already satisfied: seqeval in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (1.2.2)
  28. Requirement already satisfied: dill<0.3.5 in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (0.3.4)
  29. Requirement already satisfied: multiprocess<=0.70.12.2 in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (0.70.12.2)
  30. Requirement already satisfied: datasets>=2.0.0 in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (2.17.1)
  31. Requirement already satisfied: paddlefsl in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (1.1.0)
  32. Requirement already satisfied: sentencepiece in e:\python3.12\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (0.2.0)
  33. Requirement already satisfied: huggingface-hub>=0.11.1 in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (0.20.3)
  34. Requirement already satisfied: onnx>=1.10.0 in e:\python3.12\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (1.16.0)
  35. Requirement already satisfied: protobuf==3.20.2 in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (3.20.2)
  36. Requirement already satisfied: paddle2onnx in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (0.8.1)
  37. Requirement already satisfied: Flask-Babel in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (4.0.0)
  38. Requirement already satisfied: fastapi in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (0.103.2)
  39. Requirement already satisfied: uvicorn in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (0.29.0)
  40. Requirement already satisfied: typer in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (0.12.3)
  41. Requirement already satisfied: rich in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (13.7.1)
  42. Requirement already satisfied: safetensors in e:\software\python_env\lib\site-packages (from paddlenlp>=2.0.0b2->paddlehub) (0.4.2)
  43. Requirement already satisfied: bce-python-sdk in e:\software\python_env\lib\site-packages (from visualdl>=2.0.0->paddlehub) (0.9.7)
  44. Requirement already satisfied: requests in e:\python3.12\lib\site-packages (from visualdl>=2.0.0->paddlehub) (2.31.0)
  45. Requirement already satisfied: six>=1.14.0 in e:\python3.12\lib\site-packages (from visualdl>=2.0.0->paddlehub) (1.16.0)
  46. Requirement already satisfied: pandas in e:\python3.12\lib\site-packages (from visualdl>=2.0.0->paddlehub) (2.2.1)
  47. Requirement already satisfied: psutil in e:\software\python_env\lib\site-packages (from visualdl>=2.0.0->paddlehub) (5.9.8)
  48. Requirement already satisfied: gitdb<5,>=4.0.1 in e:\software\python_env\lib\site-packages (from gitpython->paddlehub) (4.0.10)
  49. Requirement already satisfied: contourpy>=1.0.1 in e:\software\python_env\lib\site-packages (from matplotlib->paddlehub) (1.2.0)
  50. Requirement already satisfied: cycler>=0.10 in e:\software\python_env\lib\site-packages (from matplotlib->paddlehub) (0.11.0)
  51. Requirement already satisfied: fonttools>=4.22.0 in e:\software\python_env\lib\site-packages (from matplotlib->paddlehub) (4.42.1)
  52. Requirement already satisfied: kiwisolver>=1.3.1 in e:\software\python_env\lib\site-packages (from matplotlib->paddlehub) (1.4.5)
  53. Requirement already satisfied: pyparsing>=2.3.1 in e:\software\python_env\lib\site-packages (from matplotlib->paddlehub) (3.1.2)
  54. Requirement already satisfied: python-dateutil>=2.7 in e:\software\python_env\lib\site-packages (from matplotlib->paddlehub) (2.8.2)
  55. Requirement already satisfied: pyarrow>=12.0.0 in e:\software\python_env\lib\site-packages (from datasets>=2.0.0->paddlenlp>=2.0.0b2->paddlehub) (15.0.0)
  56. Requirement already satisfied: pyarrow-hotfix in e:\software\python_env\lib\site-packages (from datasets>=2.0.0->paddlenlp>=2.0.0b2->paddlehub) (0.6)
  57. Requirement already satisfied: xxhash in e:\software\python_env\lib\site-packages (from datasets>=2.0.0->paddlenlp>=2.0.0b2->paddlehub) (3.4.1)
  58. Requirement already satisfied: fsspec<=2023.10.0,>=2023.1.0 in e:\software\python_env\lib\site-packages (from fsspec[http]<=2023.10.0,>=2023.1.0->datasets>=2.0.0->paddlenlp>=2.0.0b2->
  59. paddlehub) (2023.10.0)
  60. Requirement already satisfied: aiohttp in e:\software\python_env\lib\site-packages (from datasets>=2.0.0->paddlenlp>=2.0.0b2->paddlehub) (3.9.3)
  61. Requirement already satisfied: Babel>=2.12 in e:\software\python_env\lib\site-packages (from Flask-Babel->paddlenlp>=2.0.0b2->paddlehub) (2.12.1)
  62. Requirement already satisfied: pytz>=2022.7 in e:\python3.12\lib\site-packages (from Flask-Babel->paddlenlp>=2.0.0b2->paddlehub) (2024.1)
  63. Requirement already satisfied: smmap<6,>=3.0.1 in e:\software\python_env\lib\site-packages (from gitdb<5,>=4.0.1->gitpython->paddlehub) (5.0.1)
  64. Requirement already satisfied: typing-extensions>=3.7.4.3 in e:\python3.12\lib\site-packages (from huggingface-hub>=0.11.1->paddlenlp>=2.0.0b2->paddlehub) (4.10.0)
  65. Requirement already satisfied: MarkupSafe>=2.0 in e:\software\python_env\lib\site-packages (from Jinja2>=3.1.2->flask>=1.1.0->paddlehub) (2.1.5)
  66. Requirement already satisfied: charset-normalizer<4,>=2 in e:\software\python_env\lib\site-packages (from requests->visualdl>=2.0.0->paddlehub) (3.3.2)
  67. Requirement already satisfied: idna<4,>=2.5 in e:\software\python_env\lib\site-packages (from requests->visualdl>=2.0.0->paddlehub) (3.6)
  68. Requirement already satisfied: urllib3<3,>=1.21.1 in e:\software\python_env\lib\site-packages (from requests->visualdl>=2.0.0->paddlehub) (2.2.1)
  69. Requirement already satisfied: certifi>=2017.4.17 in e:\software\python_env\lib\site-packages (from requests->visualdl>=2.0.0->paddlehub) (2024.2.2)
  70. Requirement already satisfied: pycryptodome>=3.8.0 in e:\python3.12\lib\site-packages (from bce-python-sdk->visualdl>=2.0.0->paddlehub) (3.20.0)
  71. Requirement already satisfied: future>=0.6.0 in e:\software\python_env\lib\site-packages (from bce-python-sdk->visualdl>=2.0.0->paddlehub) (1.0.0)
  72. Requirement already satisfied: anyio<4.0.0,>=3.7.1 in e:\software\python_env\lib\site-packages (from fastapi->paddlenlp>=2.0.0b2->paddlehub) (3.7.1)
  73. Requirement already satisfied: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4 in e:\software\python_env\lib\site-packages (from fastapi->paddlenlp>=2.0.0b2->paddlehub) (
  74. 2.6.2)
  75. Requirement already satisfied: starlette<0.28.0,>=0.27.0 in e:\software\python_env\lib\site-packages (from fastapi->paddlenlp>=2.0.0b2->paddlehub) (0.27.0)
  76. Requirement already satisfied: tzdata>=2022.7 in e:\python3.12\lib\site-packages (from pandas->visualdl>=2.0.0->paddlehub) (2024.1)
  77. Requirement already satisfied: markdown-it-py>=2.2.0 in e:\software\python_env\lib\site-packages (from rich->paddlenlp>=2.0.0b2->paddlehub) (3.0.0)
  78. Requirement already satisfied: pygments<3.0.0,>=2.13.0 in e:\software\python_env\lib\site-packages (from rich->paddlenlp>=2.0.0b2->paddlehub) (2.17.2)
  79. Requirement already satisfied: scikit-learn>=0.21.3 in e:\software\python_env\lib\site-packages (from seqeval->paddlenlp>=2.0.0b2->paddlehub) (1.4.1.post1)
  80. Requirement already satisfied: shellingham>=1.3.0 in e:\python3.12\lib\site-packages (from typer->paddlenlp>=2.0.0b2->paddlehub) (1.5.4)
  81. Requirement already satisfied: h11>=0.8 in e:\python3.12\lib\site-packages (from uvicorn->paddlenlp>=2.0.0b2->paddlehub) (0.14.0)
  82. Requirement already satisfied: sniffio>=1.1 in e:\software\python_env\lib\site-packages (from anyio<4.0.0,>=3.7.1->fastapi->paddlenlp>=2.0.0b2->paddlehub) (1.3.1)
  83. Requirement already satisfied: aiosignal>=1.1.2 in e:\software\python_env\lib\site-packages (from aiohttp->datasets>=2.0.0->paddlenlp>=2.0.0b2->paddlehub) (1.3.1)
  84. Requirement already satisfied: attrs>=17.3.0 in e:\software\python_env\lib\site-packages (from aiohttp->datasets>=2.0.0->paddlenlp>=2.0.0b2->paddlehub) (23.2.0)
  85. Requirement already satisfied: frozenlist>=1.1.1 in e:\software\python_env\lib\site-packages (from aiohttp->datasets>=2.0.0->paddlenlp>=2.0.0b2->paddlehub) (1.4.1)
  86. Requirement already satisfied: multidict<7.0,>=4.5 in e:\software\python_env\lib\site-packages (from aiohttp->datasets>=2.0.0->paddlenlp>=2.0.0b2->paddlehub) (6.0.5)
  87. Requirement already satisfied: yarl<2.0,>=1.0 in e:\software\python_env\lib\site-packages (from aiohttp->datasets>=2.0.0->paddlenlp>=2.0.0b2->paddlehub) (1.9.4)
  88. Requirement already satisfied: mdurl~=0.1 in e:\software\python_env\lib\site-packages (from markdown-it-py>=2.2.0->rich->paddlenlp>=2.0.0b2->paddlehub) (0.1.2)
  89. Requirement already satisfied: annotated-types>=0.4.0 in e:\software\python_env\lib\site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi->paddlenl
  90. p>=2.0.0b2->paddlehub) (0.6.0)
  91. Requirement already satisfied: pydantic-core==2.16.3 in e:\software\python_env\lib\site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi->paddlenlp
  92. >=2.0.0b2->paddlehub) (2.16.3)
  93. Requirement already satisfied: scipy>=1.6.0 in e:\software\python_env\lib\site-packages (from scikit-learn>=0.21.3->seqeval->paddlenlp>=2.0.0b2->paddlehub) (1.12.0)
  94. Requirement already satisfied: joblib>=1.2.0 in e:\software\python_env\lib\site-packages (from scikit-learn>=0.21.3->seqeval->paddlenlp>=2.0.0b2->paddlehub) (1.3.2)
  95. Requirement already satisfied: threadpoolctl>=2.0.0 in e:\software\python_env\lib\site-packages (from scikit-learn>=0.21.3->seqeval->paddlenlp>=2.0.0b2->paddlehub) (3.3.0)

可以愉快的玩耍了

2、、小样例

  • $ hub install chinese_ocr_db_crnn_mobile
  1. hub install chinese_ocr_db_crnn_mobile
  2. Traceback (most recent call last):
  3. File "<frozen runpy>", line 198, in _run_module_as_main
  4. File "<frozen runpy>", line 88, in _run_code
  5. File "E:\software\python_env\Scripts\hub.exe\__main__.py", line 4, in <module>
  6. File "E:\software\python_env\Lib\site-packages\paddlehub\__init__.py", line 28, in <module>
  7. from paddlehub.utils.paddlex import download, ResourceNotFoundError
  8. File "E:\software\python_env\Lib\site-packages\paddlehub\utils\paddlex.py", line 19, in <module>
  9. from paddlehub.server.server import module_server
  10. File "E:\software\python_env\Lib\site-packages\paddlehub\server\__init__.py", line 17, in <module>
  11. from paddlehub.server.git_source import GitSource
  12. File "E:\software\python_env\Lib\site-packages\paddlehub\server\git_source.py", line 30, in <module>
  13. from paddlehub.module.module import RunModule
  14. File "E:\software\python_env\Lib\site-packages\paddlehub\module\__init__.py", line 16, in <module>
  15. from .module import Module
  16. File "E:\software\python_env\Lib\site-packages\paddlehub\module\module.py", line 29, in <module>
  17. from paddlehub.compat import paddle_utils
  18. File "E:\software\python_env\Lib\site-packages\paddlehub\compat\paddle_utils.py", line 25, in <module>
  19. paddle.fluid.core.VarDesc.VarType.FP32: "float32",
  20. ^^^^^^^^^^^^
  21. AttributeError: module 'paddle' has no attribute 'fluid'. Did you mean: 'flip'?

 又报错 不是吧~~~

AttributeError: module 'paddle' has no attribute 'fluid'. Did you mean: 'flip'?

  1. PS E:\software\pythonProject1> pip install paddle.fluid
  2. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  3. ERROR: Could not find a version that satisfies the requirement paddle.fluid (from versions: none)
  4. ERROR: No matching distribution found for paddle.fluid
  5. PS E:\software\pythonProject1> pip install paddle
  6. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  7. Collecting paddle
  8. Downloading https://mirrors.aliyun.com/pypi/packages/55/cf/e4b6b9a54d2f072e4491e34317bf5f5fea260da8a3072e641832dc9ce770/paddle-1.0.2.tar.gz (579 kB)
  9. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 579.0/579.0 kB 4.0 MB/s eta 0:00:00
  10. Preparing metadata (setup.py) ... error
  11. error: subprocess-exited-with-error
  12. × python setup.py egg_info did not run successfully.
  13. exit code: 1
  14. ╰─> [8 lines of output]
  15. Traceback (most recent call last):
  16. File "<string>", line 2, in <module>
  17. File "<pip-setuptools-caller>", line 34, in <module>
  18. File "C:\Users\GW00227659\AppData\Local\Temp\pip-install-9lp003hl\paddle_de3deb8a5f1449c3930cfd98c6ade434\setup.py", line 3, in <module>
  19. import paddle
  20. File "C:\Users\GW00227659\AppData\Local\Temp\pip-install-9lp003hl\paddle_de3deb8a5f1449c3930cfd98c6ade434\paddle\__init__.py", line 5, in <module>
  21. import common, dual, tight, data, prox
  22. ModuleNotFoundError: No module named 'common'
  23. [end of output]
  24. note: This error originates from a subprocess, and is likely not a problem with pip.
  25. error: metadata-generation-failed
  26. × Encountered error while generating package metadata.
  27. ╰─> See above for output.
  28. note: This is an issue with the package mentioned above, not pip.
  29. hint: See above for details.
  30. PS E:\software\pythonProject1> pip install common
  31. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  32. Collecting common
  33. Downloading https://mirrors.aliyun.com/pypi/packages/eb/b2/c900168d36abd28b1b08a81387835eff8b574bc6c2e9fefb5c4a38135d94/common-0.1.2.tar.gz (3.5 kB)
  34. Preparing metadata (setup.py) ... done
  35. Building wheels for collected packages: common
  36. Building wheel for common (setup.py) ... done
  37. Created wheel for common: filename=common-0.1.2-py3-none-any.whl size=3714 sha256=dd74b4ae5527e4351bc829dac46bf165d9db59a1a3481f906ff0891305ab8070
  38. Stored in directory: c:\users\gw00227659\appdata\local\pip\cache\wheels\d5\ee\37\75318ea32c2e94b47bfcb6f985fd80ce7cc5751c382bf79bf0
  39. Successfully built common
  40. Installing collected packages: common
  41. Successfully installed common-0.1.2
  42. PS E:\software\pythonProject1> pip install paddle
  43. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  44. Collecting paddle
  45. Using cached https://mirrors.aliyun.com/pypi/packages/55/cf/e4b6b9a54d2f072e4491e34317bf5f5fea260da8a3072e641832dc9ce770/paddle-1.0.2.tar.gz (579 kB)
  46. Preparing metadata (setup.py) ... error
  47. error: subprocess-exited-with-error
  48. × python setup.py egg_info did not run successfully.
  49. exit code: 1
  50. ╰─> [8 lines of output]
  51. Traceback (most recent call last):
  52. File "<string>", line 2, in <module>
  53. File "<pip-setuptools-caller>", line 34, in <module>
  54. File "C:\Users\GW00227659\AppData\Local\Temp\pip-install-hlfu69fx\paddle_e60afdbbddd74dbfa512d73bf28ca3e9\setup.py", line 3, in <module>
  55. import paddle
  56. File "C:\Users\GW00227659\AppData\Local\Temp\pip-install-hlfu69fx\paddle_e60afdbbddd74dbfa512d73bf28ca3e9\paddle\__init__.py", line 5, in <module>
  57. import common, dual, tight, data, prox
  58. ModuleNotFoundError: No module named 'dual'
  59. [end of output]
  60. note: This error originates from a subprocess, and is likely not a problem with pip.
  61. error: metadata-generation-failed
  62. × Encountered error while generating package metadata.
  63. ╰─> See above for output.
  64. note: This is an issue with the package mentioned above, not pip.
  65. hint: See above for details.
  66. PS E:\software\pythonProject1> pip install dual
  67. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  68. Collecting dual
  69. Downloading https://mirrors.aliyun.com/pypi/packages/b3/76/f0d25b1b461dc0f044eda154e18266c0d676f077fc3ecf7d4c08f88c8952/dual-0.1.0-py3-none-any.whl (6.9 kB)
  70. Installing collected packages: dual
  71. Successfully installed dual-0.1.0
  72. PS E:\software\pythonProject1> pip install paddle
  73. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  74. Collecting paddle
  75. Using cached https://mirrors.aliyun.com/pypi/packages/55/cf/e4b6b9a54d2f072e4491e34317bf5f5fea260da8a3072e641832dc9ce770/paddle-1.0.2.tar.gz (579 kB)
  76. Preparing metadata (setup.py) ... error
  77. error: subprocess-exited-with-error
  78. × python setup.py egg_info did not run successfully.
  79. exit code: 1
  80. ╰─> [8 lines of output]
  81. Traceback (most recent call last):
  82. File "<string>", line 2, in <module>
  83. File "<pip-setuptools-caller>", line 34, in <module>
  84. File "C:\Users\GW00227659\AppData\Local\Temp\pip-install-a9v2bbg0\paddle_94564764cba3428695bf91932ebfe5c6\setup.py", line 3, in <module>
  85. import paddle
  86. File "C:\Users\GW00227659\AppData\Local\Temp\pip-install-a9v2bbg0\paddle_94564764cba3428695bf91932ebfe5c6\paddle\__init__.py", line 5, in <module>
  87. import common, dual, tight, data, prox
  88. ModuleNotFoundError: No module named 'tight'
  89. [end of output]
  90. note: This error originates from a subprocess, and is likely not a problem with pip.
  91. error: metadata-generation-failed
  92. × Encountered error while generating package metadata.
  93. ╰─> See above for output.
  94. note: This is an issue with the package mentioned above, not pip.
  95. hint: See above for details.
  96. PS E:\software\pythonProject1> pip install tight
  97. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  98. Collecting tight
  99. Downloading https://mirrors.aliyun.com/pypi/packages/7d/2b/a03125502d8d5cbccd26c6e88ec056f23e6aa3012b2823cc950476f48722/tight-0.1.0-py2.py3-none-any.whl (15 kB)
  100. Requirement already satisfied: PyYAML in e:\software\python_env\lib\site-packages (from tight) (6.0.1)
  101. Collecting boto3 (from tight)
  102. Downloading https://mirrors.aliyun.com/pypi/packages/8f/73/a697d4cae44f5358c457b5de3ba1cf1374778a87bbd49a43e39be79b7249/boto3-1.34.93-py3-none-any.whl (139 kB)
  103. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.3/139.3 kB 4.2 MB/s eta 0:00:00
  104. Collecting flywheel>=0.5.1 (from tight)
  105. Downloading https://mirrors.aliyun.com/pypi/packages/77/fb/fd1252e62cc812da35d9a513b9a620acfac587c8571d0067f2f1d4aad783/flywheel-0.5.4-py2.py3-none-any.whl (33 kB)
  106. Collecting dynamo3<1.0,>=0.4.9 (from flywheel>=0.5.1->tight)
  107. Downloading https://mirrors.aliyun.com/pypi/packages/c9/e5/cb76413fcf0205767eb9751fd111406c4d444a348a4504b52556489d3ebe/dynamo3-0.4.10-py2.py3-none-any.whl (34 kB)
  108. Requirement already satisfied: six in e:\python3.12\lib\site-packages (from flywheel>=0.5.1->tight) (1.16.0)
  109. Collecting botocore<1.35.0,>=1.34.93 (from boto3->tight)
  110. Downloading https://mirrors.aliyun.com/pypi/packages/eb/c3/c47c39c4c85691fc10ae16e1647c1d853d54f8fcd95f28362dc0d7472029/botocore-1.34.93-py3-none-any.whl (12.2 MB)
  111. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.2/12.2 MB 3.7 MB/s eta 0:00:00
  112. Collecting jmespath<2.0.0,>=0.7.1 (from boto3->tight)
  113. Downloading https://mirrors.aliyun.com/pypi/packages/31/b4/b9b800c45527aadd64d5b442f9b932b00648617eb5d63d2c7a6587b7cafc/jmespath-1.0.1-py3-none-any.whl (20 kB)
  114. Collecting s3transfer<0.11.0,>=0.10.0 (from boto3->tight)
  115. Downloading https://mirrors.aliyun.com/pypi/packages/83/37/395cdb6ee92925fa211e55d8f07b9f93cf93f60d7d4ce5e66fd73f1ea986/s3transfer-0.10.1-py3-none-any.whl (82 kB)
  116. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.2/82.2 kB 4.5 MB/s eta 0:00:00
  117. Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in e:\software\python_env\lib\site-packages (from botocore<1.35.0,>=1.34.93->boto3->tight) (2.8.2)
  118. Requirement already satisfied: urllib3!=2.2.0,<3,>=1.25.4 in e:\software\python_env\lib\site-packages (from botocore<1.35.0,>=1.34.93->boto3->tight) (2.2.1)
  119. Installing collected packages: jmespath, botocore, s3transfer, dynamo3, flywheel, boto3, tight
  120. Successfully installed boto3-1.34.93 botocore-1.34.93 dynamo3-0.4.10 flywheel-0.5.4 jmespath-1.0.1 s3transfer-0.10.1 tight-0.1.0
  121. PS E:\software\pythonProject1> pip install paddle
  122. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  123. Collecting paddle
  124. Using cached https://mirrors.aliyun.com/pypi/packages/55/cf/e4b6b9a54d2f072e4491e34317bf5f5fea260da8a3072e641832dc9ce770/paddle-1.0.2.tar.gz (579 kB)
  125. Preparing metadata (setup.py) ... error
  126. error: subprocess-exited-with-error
  127. × python setup.py egg_info did not run successfully.
  128. exit code: 1
  129. ╰─> [8 lines of output]
  130. Traceback (most recent call last):
  131. File "<string>", line 2, in <module>
  132. File "<pip-setuptools-caller>", line 34, in <module>
  133. File "C:\Users\GW00227659\AppData\Local\Temp\pip-install-7777j2t6\paddle_877e0a763428465894621df32f89c743\setup.py", line 3, in <module>
  134. import paddle
  135. File "C:\Users\GW00227659\AppData\Local\Temp\pip-install-7777j2t6\paddle_877e0a763428465894621df32f89c743\paddle\__init__.py", line 5, in <module>
  136. import common, dual, tight, data, prox
  137. ModuleNotFoundError: No module named 'data'
  138. [end of output]
  139. note: This error originates from a subprocess, and is likely not a problem with pip.
  140. error: metadata-generation-failed
  141. × Encountered error while generating package metadata.
  142. ╰─> See above for output.
  143. note: This is an issue with the package mentioned above, not pip.
  144. hint: See above for details.
  145. PS E:\software\pythonProject1> pip install data
  146. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  147. Collecting data
  148. Downloading https://mirrors.aliyun.com/pypi/packages/ed/e9/623be82fac4250fc614741f5b1ead83d339794f94b19ac8665b6ea12ee05/data-0.4.tar.gz (7.0 kB)
  149. Preparing metadata (setup.py) ... done
  150. Requirement already satisfied: six in e:\python3.12\lib\site-packages (from data) (1.16.0)
  151. Requirement already satisfied: decorator in e:\software\python_env\lib\site-packages (from data) (5.1.1)
  152. Collecting funcsigs (from data)
  153. Downloading https://mirrors.aliyun.com/pypi/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl (17 kB)
  154. Building wheels for collected packages: data
  155. Building wheel for data (setup.py) ... done
  156. Created wheel for data: filename=data-0.4-py3-none-any.whl size=7259 sha256=e650488bac182751859430ce951632691b9a962baa57d8056d1f05f6ebaa3f41
  157. Stored in directory: c:\users\gw00227659\appdata\local\pip\cache\wheels\7d\70\ad\433041a98052b81068916cfec9730d7b88309576a8a7173f3c
  158. Successfully built data
  159. Installing collected packages: funcsigs, data
  160. Successfully installed data-0.4 funcsigs-1.0.2
  161. PS E:\software\pythonProject1> pip install paddle
  162. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  163. Collecting paddle
  164. Using cached https://mirrors.aliyun.com/pypi/packages/55/cf/e4b6b9a54d2f072e4491e34317bf5f5fea260da8a3072e641832dc9ce770/paddle-1.0.2.tar.gz (579 kB)
  165. Preparing metadata (setup.py) ... error
  166. error: subprocess-exited-with-error
  167. × python setup.py egg_info did not run successfully.
  168. exit code: 1
  169. ╰─> [8 lines of output]
  170. Traceback (most recent call last):
  171. File "<string>", line 2, in <module>
  172. File "<pip-setuptools-caller>", line 34, in <module>
  173. File "C:\Users\GW00227659\AppData\Local\Temp\pip-install-5_3613l4\paddle_b859e50cc0d643559d72ed0625bf949b\setup.py", line 3, in <module>
  174. import paddle
  175. File "C:\Users\GW00227659\AppData\Local\Temp\pip-install-5_3613l4\paddle_b859e50cc0d643559d72ed0625bf949b\paddle\__init__.py", line 5, in <module>
  176. import common, dual, tight, data, prox
  177. ModuleNotFoundError: No module named 'prox'
  178. [end of output]
  179. note: This error originates from a subprocess, and is likely not a problem with pip.
  180. error: metadata-generation-failed
  181. × Encountered error while generating package metadata.
  182. ╰─> See above for output.
  183. note: This is an issue with the package mentioned above, not pip.
  184. hint: See above for details.
  185. PS E:\software\pythonProject1> pip install prox
  186. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  187. Collecting prox
  188. Downloading https://mirrors.aliyun.com/pypi/packages/54/2e/9a755b5b16df7ad7ab5b801b034fcba10be8045beeef1d2c745859a5d9f2/prox-0.0.17.tar.gz (1.3 MB)
  189. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 6.2 MB/s eta 0:00:00
  190. Preparing metadata (setup.py) ... done
  191. Requirement already satisfied: urllib3>=1.18.1 in e:\software\python_env\lib\site-packages (from prox) (2.2.1)
  192. Requirement already satisfied: pysocks in e:\software\python_env\lib\site-packages (from prox) (1.7.1)
  193. Requirement already satisfied: peewee in e:\software\python_env\lib\site-packages (from prox) (3.17.1)
  194. Collecting bottle (from prox)
  195. Downloading https://mirrors.aliyun.com/pypi/packages/bb/1f/5977ea88c6a3df6199db97d320e5da816d415d1eb75a987a1f6823d5cc9d/bottle-0.12.25-py3-none-any.whl (90 kB)
  196. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.2/90.2 kB 5.0 MB/s eta 0:00:00
  197. Requirement already satisfied: pyyaml in e:\software\python_env\lib\site-packages (from prox) (6.0.1)
  198. Collecting python-geoip-python3 (from prox)
  199. Downloading https://mirrors.aliyun.com/pypi/packages/26/a3/026e23d8545d0f41571cd1d64d77ab9ff5056ded5bd597c562689183c75d/python_geoip_python3-1.3-py2.py3-none-any.whl (7.4 kB)
  200. Requirement already satisfied: six in e:\python3.12\lib\site-packages (from prox) (1.16.0)
  201. Building wheels for collected packages: prox
  202. Building wheel for prox (setup.py) ... done
  203. Created wheel for prox: filename=prox-0.0.17-py3-none-any.whl size=1280822 sha256=01b00305943e1a1773d44585b6f9b827bbe9d60ba5d12e51604fc003ffe5e17a
  204. Stored in directory: c:\users\gw00227659\appdata\local\pip\cache\wheels\f2\a2\09\acd75743fabe191890b2401a46df04b4b2601b922d8b1b2d16
  205. Successfully built prox
  206. Installing collected packages: python-geoip-python3, bottle, prox
  207. Successfully installed bottle-0.12.25 prox-0.0.17 python-geoip-python3-1.3
  208. PS E:\software\pythonProject1> pip install paddle
  209. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  210. Collecting paddle
  211. Using cached https://mirrors.aliyun.com/pypi/packages/55/cf/e4b6b9a54d2f072e4491e34317bf5f5fea260da8a3072e641832dc9ce770/paddle-1.0.2.tar.gz (579 kB)
  212. Preparing metadata (setup.py) ... done
  213. Building wheels for collected packages: paddle
  214. Building wheel for paddle (setup.py) ... done
  215. Created wheel for paddle: filename=paddle-1.0.2-py3-none-any.whl size=33377 sha256=9d651f544ae0d2b3811fbba68e4b4238a0f0585bd7f6e94b30fe2570ecfa0ab3
  216. Stored in directory: c:\users\gw00227659\appdata\local\pip\cache\wheels\60\d1\b1\90953641182b2a91c2bd2a60c5138f6eba56ee1038e2263eaf
  217. Successfully built paddle
  218. Installing collected packages: paddle
  219. Successfully installed paddle-1.0.2

补充下载依赖

pip install common 
pip install dual  

pip install tight 

pip install data   

pip install prox 

pip install paddle
 

再次执行:

  1. import paddlehub as hub
  2. # 加载移动端预训练模型
  3. ocr = hub.Module(name="chinese_ocr_db_crnn_mobile")
  4. # 服务端可以加载大模型,效果更好
  5. # ocr = hub.Module(name="chinese_ocr_db_crnn_server")
  6. # cls = ocr.load("D:\\工作内容\\AAA-重要资料\\2024年\\项目-大模型语言\\data")
  7. cls = ocr.init_with_directory("D:\\工作内容\\AAA-重要资料\\2024年\\项目-大模型语言\\data")
  8. print(cls)

Traceback (most recent call last):
  File "E:\software\pythonProject1\paddle\paddlehub_demo.py", line 1, in <module>
    import paddlehub as hub
  File "E:\software\python_env\Lib\site-packages\paddlehub\__init__.py", line 22, in <module>
    raise RuntimeError(
RuntimeError: Version mismatch in PaddleHub and PaddlePaddle, you need to upgrade PaddlePaddle to version 2.0.0 or above.

 PaddleHub and PaddlePaddle 版本不匹配

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/526425
推荐阅读
相关标签
  

闽ICP备14008679号