Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Failed to build installable wheels for some pyproject.toml based projects (geventhttpclient) #244

Closed
HamxAnwar opened this issue Oct 21, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@HamxAnwar
Copy link

HamxAnwar commented Oct 21, 2024

Bug description

Downloading the github examples, and running the bash run.sh, it gives the error as below:

Building wheels for collected packages: geventhttpclient
  Building wheel for geventhttpclient (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [65 lines of output]
      warning: no previously-included files matching '__pycache__' found anywhere in distribution
      warning: no previously-included files matching '*.py[co]' found anywhere in distribution
      warning: no files found matching 'LICENSE-MIT'
      warning: no files found matching 'CHANGELOG'
      /home/robotics/Github/max/examples/inference/bert-python-torchscript/.magic/envs/default/lib/python3.12/site-packages/setuptools/command/build_py.py:218: _Warning: Package 'geventhttpclient.tests' is absent from the `packages` configuration.
      !!

              ********************************************************************************
              ############################
              # Package would be ignored #
              ############################
              Python recognizes 'geventhttpclient.tests' as an importable package[^1],
              but it is absent from setuptools' `packages` configuration.

              This leads to an ambiguous overall configuration. If you want to distribute this
              package, please make sure that 'geventhttpclient.tests' is explicitly added
              to the `packages` configuration field.

              Alternatively, you can also rely on setuptools' discovery methods
              (for example by using `find_namespace_packages(...)`/`find_namespace:`
              instead of `find_packages(...)`/`find:`).

              You can read more about "package discovery" on setuptools documentation page:

              - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

              If you don't want 'geventhttpclient.tests' to be distributed and are
              already explicitly excluding 'geventhttpclient.tests' via
              `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
              you can try to use `exclude_package_data`, or `include-package-data=False` in
              combination with a more fine grained `package-data` configuration.

              You can read more about "package data files" on setuptools documentation page:

              - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


              [^1]: For Python, any directory (with suitable naming) can be imported,
                    even if it does not contain any `.py` files.
                    On the other hand, currently there is no concept of package data
                    directory, all directories are treated like packages.
              ********************************************************************************

      !!
        check.warn(importable)
      ext/_parser.c: In function ‘on_message_complete’:
      ext/_parser.c:48:32: error: passing argument 1 of ‘PyObject_HasAttrString’ from incompatible pointer type [-Wincompatible-pointer-types]
         48 |     if (PyObject_HasAttrString(self, "_on_message_complete")) {
            |                                ^~~~
            |                                |
            |                                PyHTTPResponseParser *
      In file included from /home/robotics/Github/max/examples/inference/bert-python-torchscript/.magic/envs/default/include/python3.12/Python.h:44,
                       from ext/_parser.c:2:
      /home/robotics/Github/max/examples/inference/bert-python-torchscript/.magic/envs/default/include/python3.12/object.h:409:40: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘PyHTTPResponseParser *’
        409 | PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *);
            |                                        ^~~~~~~~~~
      ext/_parser.c:49:53: error: passing argument 1 of ‘PyObject_GetAttrString’ from incompatible pointer type [-Wincompatible-pointer-types]
         49 |         PyObject* callable = PyObject_GetAttrString(self, "_on_message_complete");
            |                                                     ^~~~
            |                                                     |
            |                                                     PyHTTPResponseParser *
      /home/robotics/Github/max/examples/inference/bert-python-torchscript/.magic/envs/default/include/python3.12/object.h:407:47: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘PyHTTPResponseParser *’
        407 | PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *);
            |                                               ^~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for geventhttpclient
  Running setup.py clean for geventhttpclient
Failed to build geventhttpclient
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (geventhttpclient)

Steps to reproduce

Following is the example that I ran:

  1. git clone https://github.com/modularml/max.git
  2. cd max/examples/inference/bert-python-torchscript
  3. magic shell
  4. bash run.sh

System information

Cachy OS
max 24.5.0
mojo 24.5.0 
I am using magic and not modular CLI.
@HamxAnwar HamxAnwar added the bug Something isn't working label Oct 21, 2024
@ehsanmok
Copy link
Contributor

Thanks for reporting! For Linux, we official support Ubuntu and all other distros are untested. Similar issue #231

@HamxAnwar
Copy link
Author

It works if in step two, we choose cd max/examples/inference/bert-mojo-torchscript instead of cd max/examples/inference/bert-python-torchscript in step two. The issue lies in python environment and not mojo. Closing this issue as I wanted to analyze using mojo.
Note: I have not checked language environments other than python and mojo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants