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

Cannot pip install thriftpy2 on Colab #223

Closed
zhilu1 opened this issue Sep 14, 2023 · 9 comments
Closed

Cannot pip install thriftpy2 on Colab #223

zhilu1 opened this issue Sep 14, 2023 · 9 comments

Comments

@zhilu1
Copy link

zhilu1 commented Sep 14, 2023

pip install thriftpy2 on Google colab failed.

Error Info:

Collecting thriftpy2
  Using cached thriftpy2-0.4.16.tar.gz (643 kB)
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
@aisk
Copy link
Member

aisk commented Sep 14, 2023

Unless you provide the actual error log, we cannot provide any help.

@zhilu1
Copy link
Author

zhilu1 commented Sep 14, 2023

Unless you provide the actual error log, we cannot provide any help.

That's the error message I got in Google Colab, I don't know where else I can get a log.

For reproduction, enter pip install thriftpy2 on Google colab notebook cell.

图片

@aisk
Copy link
Member

aisk commented Sep 14, 2023

Sorry, I can't reproduce the issue.

@PDXDJN
Copy link

PDXDJN commented Sep 21, 2023

I get the same error.
IMG_1310

so, I tried installing all recent thriftpy2 versions directly, and none of them work:
IMG_1309
It was working without issue until about a week ago.

@aisk
Copy link
Member

aisk commented Sep 22, 2023

What's the pip / setuptools / python version?

@PDXDJN
Copy link

PDXDJN commented Sep 22, 2023

python 3.10.12
pip 23.1.2
setuptools 67.7.2

@aisk
Copy link
Member

aisk commented Sep 22, 2023

Tried the pip / setuptools with provides versions combination, still can't reproduce the issue. I don't have a access for the colab, if some one knows the different between it and a linux environment, please point out.

@aisk
Copy link
Member

aisk commented Sep 22, 2023

Some one provided me a Google colab access, and after running pip install thriftpy2 -v, the error log is:



Using pip 23.1.2 from /usr/local/lib/python3.10/dist-packages/pip (python 3.10)
Collecting thriftpy2
  Using cached thriftpy2-0.4.16.tar.gz (643 kB)
  Running command python setup.py egg_info
  /usr/local/lib/python3.10/dist-packages/Cython/Compiler/Main.py:384: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-install-smk5791j/thriftpy2_5bfb8ae99c874dad96e90a45ca1df5fa/thriftpy2/transport/cybase.pxd
    tree = Parsing.p_module(s, pxd, full_module_name)

  Error compiling Cython file:
  ------------------------------------------------------------
  ...

      cdef int grow(self, int min_size):
          if min_size <= self.buf_size:
              return 0

          cdef int multiples = min_size / self.buf_size
                                        ^
  ------------------------------------------------------------

  thriftpy2/transport/cybase.pyx:90:38: Cannot assign type 'double' to 'int'
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-smk5791j/thriftpy2_5bfb8ae99c874dad96e90a45ca1df5fa/setup.py", line 61, in <module>
      cythonize("thriftpy2/transport/cybase.pyx")
    File "/usr/local/lib/python3.10/dist-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
      cythonize_one(*args)
    File "/usr/local/lib/python3.10/dist-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: thriftpy2/transport/cybase.pyx
  Compiling thriftpy2/transport/cybase.pyx because it changed.
  [1/1] Cythonizing thriftpy2/transport/cybase.pyx
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python3 -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize
  
  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)
  
  __file__ = %r
  sys.argv[0] = __file__
  
  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"
  
  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-smk5791j/thriftpy2_5bfb8ae99c874dad96e90a45ca1df5fa/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base /tmp/pip-pip-egg-info-vgz1vbgz
  cwd: /tmp/pip-install-smk5791j/thriftpy2_5bfb8ae99c874dad96e90a45ca1df5fa/
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

So I think this is related to #218, which is already fixed in master branch. I think we should make a release cc @ethe

@aisk
Copy link
Member

aisk commented Oct 18, 2023

This should be resolved since v0.14.7 was published.

@aisk aisk closed this as completed Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants