oracle / graalpython

GraalPy – A high-performance embeddable Python 3 runtime for Java
https://www.graalvm.org/python/
Other
1.24k stars 108 forks source link

TypeError: 'bytes' object cannot be interpreted as an int #238

Closed oroppas closed 2 years ago

oroppas commented 3 years ago

I encountered error on venv when using pip:

(graalpython) 
ryuta@oroppas ~/packages/graalvm/python/numpy
graalpython -m pip list
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/ryuta/packages/graalvm/graal/graal/sdk/mxbuild/linux-amd64/GRAALVM_8052F32AFF_JAVA11/graalvm-8052f32aff-java11-21.3.0-dev/languages/python/lib-python/3/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/ryuta/packages/graalvm/graal/graal/sdk/mxbuild/linux-amd64/GRAALVM_8052F32AFF_JAVA11/graalvm-8052f32aff-java11-21.3.0-dev/languages/python/lib-python/3/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/ryuta/local/graalpython/lib/python3.8/site-packages/pip/__main__.py", line 29, in <module '__main__.py'>
    from pip._internal.cli.main import main as _main
  File "/home/ryuta/local/graalpython/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 9, in <module 'main.py'>
    from pip._internal.cli.autocompletion import autocomplete
  File "/home/ryuta/local/graalpython/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module 'autocompletion.py'>
    from pip._internal.cli.main_parser import create_main_parser
  File "/home/ryuta/local/graalpython/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module 'main_parser.py'>
    from pip._internal.cli import cmdoptions
  File "/home/ryuta/local/graalpython/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module 'cmdoptions.py'>
    from pip._internal.cli.parser import ConfigOptionParser
  File "/home/ryuta/local/graalpython/lib/python3.8/site-packages/pip/_internal/cli/parser.py", line 12, in <module 'parser.py'>
    from pip._internal.configuration import Configuration, ConfigurationError
  File "/home/ryuta/local/graalpython/lib/python3.8/site-packages/pip/_internal/configuration.py", line 21, in <module 'configuration.py'>
    from pip._internal.exceptions import (
  File "/home/ryuta/local/graalpython/lib/python3.8/site-packages/pip/_internal/exceptions.py", line 7, in <module 'exceptions.py'>
    from pip._vendor.pkg_resources import Distribution
  File "/home/ryuta/local/graalpython/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 26, in <module '__init__.py'>
    import zipfile
  File "/home/ryuta/packages/graalvm/graal/graal/sdk/mxbuild/linux-amd64/GRAALVM_8052F32AFF_JAVA11/graalvm-8052f32aff-java11-21.3.0-dev/languages/python/lib-python/3/zipfile.py", line 84, in <module 'zipfile.py'>
    sizeEndCentDir = struct.calcsize(structEndArchive)
  File "__init__", line -1, in __init__
TypeError: 'bytes' object cannot be interpreted as an int
msimacek commented 2 years ago

Could you please provide more data on how to reproduce? I tried running the command on master and it completed without error. What version did you use? Did you install anything into the virtualenv? Is there something in your current directory that it might be picking up?

oroppas commented 2 years ago

Deleting and reinstating venv fixed the issue.