无法安装uwsgi Python包:无法启动新线程

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

我正在维护一个服务器,想要安装并运行一个 nginx + uwsgi Django 应用程序。不幸的是,我一直在安装需求,特别是安装 uwsgi:

pip3 install uwsgi

结果:

RuntimeError: can't start new thread

我很想获得有关如何解决该问题的提示。

我的规格是:

  • Debian 10
  • Python 3.7
  • 34GB 内存
  • 英特尔® 至强® 金牌 6130 处理器
  • 最大用户进程数 (ulimit -u) 90

这是完整的控制台日志:

Collecting uwsgi
  Using cached uwsgi-2.0.22.tar.gz (809 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: uwsgi
  Building wheel for uwsgi (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for uwsgi (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [55 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib
      copying uwsgidecorators.py -> build/lib
      installing to build/bdist.linux-x86_64/wheel
      running install
      /tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'descriptions'
        warnings.warn(msg)
      using profile: buildconf/default.ini
      detected include path: ['/usr/lib/gcc/x86_64-linux-gnu/8/include', '/usr/local/include', '/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed', '/usr/include/x86_64-linux-gnu', '/usr/include']
      Patching "bin_name" to properly install_scripts dir
      Traceback (most recent call last):
        File "/homepages/10/d521380034/htdocs/open-ls/TS_annotation_tool_venv/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/homepages/10/d521380034/htdocs/open-ls/TS_annotation_tool_venv/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/homepages/10/d521380034/htdocs/open-ls/TS_annotation_tool_venv/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 252, in build_wheel
          metadata_directory)
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 417, in build_wheel
          wheel_directory, config_settings)
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 488, in run_setup
          self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 143, in <module>
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 381, in run
          self.run_command("install")
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-atb4nphi/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 79, in run
        File "/tmp/pip-install-ue34lw_1/uwsgi_e9a9e132f35048d08a753e0d4e62b95d/uwsgiconfig.py", line 284, in build_uwsgi
          t.start()
        File "/usr/lib/python3.7/threading.py", line 847, in start
          _start_new_thread(self._bootstrap, ())
      RuntimeError: can't start new thread
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for uwsgi
Failed to build uwsgi
ERROR: Could not build wheels for uwsgi, which is required to install pyproject.toml-based projects
python multithreading pip debian uwsgi
1个回答
0
投票

正如phd所指出的,这确实是由于“最大用户进程(ulimit -u)90:太低而我被限制增加它”造成的。所以对我来说唯一的解决方案是切换硬件。

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