vbabiy / djangorestframework-camel-case

Camel case JSON support for Django REST framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't install 1.3.0: "Failed building wheel for djangorestframework-camel-case"

kevinrenskers opened this issue · comments

I'm trying to update to 1.3.0 so that I can also upgrade to Django 4, but I am getting the following error:

Building wheels for collected packages: djangorestframework-camel-case
  Building wheel for djangorestframework-camel-case (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/api/env/bin/python3 /tmp/tmp1gora1dx_in_process.py build_wheel /tmp/tmpugazcsuu
       cwd: /tmp/pip-install-ldyeywqv/djangorestframework-camel-case_da79f7ea21604616bb54ad51777e98e5
  Complete output (63 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/djangorestframework_camel_case
  copying djangorestframework_camel_case/util.py -> build/lib/djangorestframework_camel_case
  copying djangorestframework_camel_case/settings.py -> build/lib/djangorestframework_camel_case
  copying djangorestframework_camel_case/__init__.py -> build/lib/djangorestframework_camel_case
  copying djangorestframework_camel_case/render.py -> build/lib/djangorestframework_camel_case
  copying djangorestframework_camel_case/parser.py -> build/lib/djangorestframework_camel_case
  running egg_info
  writing manifest file 'djangorestframework_camel_case.egg-info/SOURCES.txt'
  running install
  running install_lib
  Traceback (most recent call last):
    File "/tmp/tmp1gora1dx_in_process.py", line 280, in <module>
      main()
    File "/tmp/tmp1gora1dx_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/tmp/tmp1gora1dx_in_process.py", line 204, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 216, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 202, in _build_with_temp_dir
      self.run_setup()
    File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 253, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 145, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 21, in <module>
      setup(
    File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-nwzeoo6h/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 335, in run
      self.run_command('install')
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 61, in run
      return orig.install.run(self)
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 578, in run
      self.run_command(cmd_name)
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
      cmd_obj.ensure_finalized()
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
      self.finalize_options()
    File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in finalize_options
      self.set_undefined_options('install',('install_layout','install_layout'))
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 290, in set_undefined_options
      setattr(self, dst_option, getattr(src_cmd_obj, src_option))
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in __getattr__
      raise AttributeError(attr)
  AttributeError: install_layout
  ----------------------------------------
  ERROR: Failed building wheel for djangorestframework-camel-case
Failed to build djangorestframework-camel-case
ERROR: Could not build wheels for djangorestframework-camel-case which use PEP 517 and cannot be installed directly

Any idea how to fix this?

It works fine locally on my computer (macOS, Python 3.9.10), but not on my server (Debian, Python 3.9.2). Both use virtualenv.

After updating both pip and setuptools the error looks slightly different:

Building wheels for collected packages: djangorestframework-camel-case
  Building wheel for djangorestframework-camel-case (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for djangorestframework-camel-case (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [63 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/djangorestframework_camel_case
      copying djangorestframework_camel_case/util.py -> build/lib/djangorestframework_camel_case
      copying djangorestframework_camel_case/settings.py -> build/lib/djangorestframework_camel_case
      copying djangorestframework_camel_case/__init__.py -> build/lib/djangorestframework_camel_case
      copying djangorestframework_camel_case/render.py -> build/lib/djangorestframework_camel_case
      copying djangorestframework_camel_case/parser.py -> build/lib/djangorestframework_camel_case
      running egg_info
      writing manifest file 'djangorestframework_camel_case.egg-info/SOURCES.txt'
      running install
      running install_lib
      Traceback (most recent call last):
        File "/opt/api/env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/opt/api/env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/api/env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 216, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 202, in _build_with_temp_dir
          self.run_setup()
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 253, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 145, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 21, in <module>
          setup(
        File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j0tsgj3_/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 335, in run
          self.run_command('install')
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 61, in run
          return orig.install.run(self)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 578, in run
          self.run_command(cmd_name)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
          cmd_obj.ensure_finalized()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
          self.finalize_options()
        File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in finalize_options
          self.set_undefined_options('install',('install_layout','install_layout'))
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 290, in set_undefined_options
          setattr(self, dst_option, getattr(src_cmd_obj, src_option))
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in __getattr__
          raise AttributeError(attr)
      AttributeError: install_layout
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for djangorestframework-camel-case
Failed to build djangorestframework-camel-case
ERROR: Could not build wheels for djangorestframework-camel-case, which is required to install pyproject.toml-based projects

pip install djangorestframework-camel-case --no-use-pep517 worked in the end. No idea what's causing the error though!

Same for me, it only fails on my server with Python 3.9.7, Ubuntu 21.10. --no-use-pep517 fixed it for me too, thanks 🎉

@maxbellec and @kevinrenskers try the latest version.