pythonmultithreadingpipdebianuwsgi

Unable to install uwsgi Python package: can't start new thread


I am maintaining a Server and want to install and run a nginx + uwsgi Django Application. Unfortunately, I am stuck with installing the requirements, particularly installing uwsgi:

pip3 install uwsgi

results in:

RuntimeError: can't start new thread

I would love to get a hint on how to solve the issue.

My specification are:

Here is the complete console log:

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

Solution

  • As phd pointed out, it was indeed caused by the `max user processes (ulimit -u) 90: being to low and me being restricted to increase it. So the only solution for me, was to switch the hardware.