_DeprecatedInstaller:setuptools.installer 和 fetch_build_eggs 已弃用

问题描述 投票:0回答:1

我使用 python 3.9.2 使用 Surprise 库制作了一个推荐系统,然后我的雇主问我是否可以制作一个网站来演示推荐系统,所以我使用 Flask 制作了一个推荐系统,问题是当我想在上面部署 python 3.9 Flask 应用程序时apache 服务器给了我 7024 错误 功能不正确。但是当我按照相同的步骤但使用 python 3.12 时,它工作得很好并且应用程序运行,但推荐功能给出错误,因为当我尝试安装它时未安装惊喜库给我这个错误


Collecting surprise
  Using cached surprise-0.1-py2.py3-none-any.whl.metadata (327 bytes)
Collecting scikit-surprise (from surprise)
  Using cached scikit-surprise-1.1.3.tar.gz (771 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [60 lines of output]
      <string>:65: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!
      
              ********************************************************************************    
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************    
      
      !!
      WARNING: The wheel package is not available.
      D:\flaskApp\env\Scripts\python.exe: No module named pip
      Traceback (most recent call last):
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\installer.py", line 101, in _fetch_build_egg_no_warn
          subprocess.check_call(cmd)
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['D:\\flaskApp\\env\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\user\\AppData\\Local\\Temp\\tmpx2euatq3', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.
     
      The above exception was the direct cause of the following exception:
     
      Traceback (most recent call last):
        File "D:\flaskApp\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "D:\flaskApp\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "D:\flaskApp\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup 
          super().run_setup(setup_script=setup_script)
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup 
          exec(code, locals())
        File "<string>", line 65, in <module>
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\dist.py", line 640, in fetch_build_eggs          return _fetch_build_eggs(self, requires)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\installer.py", line 38, in _fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\pkg_resources\__init__.py", line 798, in resolve  
          dist = self._resolve_dist(
                 ^^^^^^^^^^^^^^^^^^^
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\pkg_resources\__init__.py", line 834, in _resolve_dist
          dist = best[req.key] = env.best_match(
                                 ^^^^^^^^^^^^^^^
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\pkg_resources\__init__.py", line 1104, in best_match
          return self.obtain(req, installer)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\pkg_resources\__init__.py", line 1115, in obtain  
          return installer(requirement) if installer else None
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\installer.py", line 103, in _fetch_build_egg_no_warn
          raise DistutilsError(str(e)) from e
      distutils.errors.DistutilsError: Command '['D:\\flaskApp\\env\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\user\\AppData\\Local\\Temp\\tmpx2euatq3', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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





我尝试重新安装python3.12并更新pip。我还尝试搜索什么是建筑轮子,但不明白似乎是什么问题,并且使用 python 3.9,我一直在寻找本地计算机上的 apache 的问题出在哪里,也没有找到任何解决方案

python python-3.x apache pip
1个回答
0
投票

您会惊讶地发现

surprise
仍然不支持
Python 3.12

请将您的 python 版本降级至 3.11 或更低版本,以便惊喜地使用。

https://github.com/NicolasHug/Surprise/issues/473

© www.soinside.com 2019 - 2024. All rights reserved.