我已经使用 python 3.9.2 使用surprise 库制作了一个推荐系统。然后我的雇主问我是否可以制作一个展示推荐系统的网站。所以我用烧瓶做了一个。问题是当我想在 apache 服务器上部署 python 3.9 Flask 应用程序时,它给了我 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 的问题,但也没有找到任何解决方案。
您会惊讶地发现
surprise
仍然不支持 Python 3.12
请将您的 python 版本降级至 3.11 或更低版本,以便惊喜地使用。