对于需要dlib
的应用程序,我需要在 App Engine Standard 上安装cmake
软件包。以下是安装时遇到的错误。
我尝试在Requirements.txt中添加cmake
和cmake-setup
,但是没有用。
ERROR: Failed to build one or more wheels
ERROR: Failed building wheel for dlib
----------------------------------------
*******************************************************************
CMake must be installed to build the following extensions: _dlib_pybind11
*******************************************************************
RuntimeError:
"\n*******************************************************************\n")
File "/tmp/pip-wheel-hz_z90ap/dlib/setup.py", line 125, in get_cmake_version
cmake_version = self.get_cmake_version()
File "/tmp/pip-wheel-hz_z90ap/dlib/setup.py", line 129, in run
cmd_obj.run()
File "/opt/python3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
self.distribution.run_command(command)
File "/opt/python3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.run_command(cmd_name)
File "/opt/python3.7/lib/python3.7/distutils/command/build.py", line 135, in run
cmd_obj.run()
File "/opt/python3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
self.distribution.run_command(command)
File "/opt/python3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.run_command('build')
File "/env/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 290, in run
cmd_obj.run()
File "/opt/python3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
self.run_command(cmd)
File "/opt/python3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
dist.run_commands()
File "/opt/python3.7/lib/python3.7/distutils/core.py", line 148, in setup
return distutils.core.setup(**attrs)
File "/env/lib/python3.7/site-packages/setuptools/__init__.py", line 144, in setup
'Topic :: Software Development',
File "/tmp/pip-wheel-hz_z90ap/dlib/setup.py", line 262, in <module>
File "<string>", line 1, in <module>
Traceback (most recent call last):
...
请提出修复建议。
答案 0 :(得分:0)
您可以通过自定义运行时在Flexible环境中使用非Python依赖项。来自About Custom Runtimes:
自定义运行时允许您定义新的运行时环境, 可能包括其他组件,例如语言解释器或 应用服务器。
答案 1 :(得分:0)
如果要自定义环境,可以使用容器。按照Dustin的建议将其部署在App Engine flexible上,但是请注意,App Engine Flex不会扩展为0,因此即使不使用服务也要付费。
因为您有一个容器,所以建议您看看Cloud Run。它与App Engine类似,但是缩放到0且功能非常强大。