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

Fails on some google shit #6

Closed
Flashwalker opened this issue Jul 3, 2022 · 2 comments · May be fixed by #30
Closed

Fails on some google shit #6

Flashwalker opened this issue Jul 3, 2022 · 2 comments · May be fixed by #30

Comments

@Flashwalker
Copy link

Flashwalker commented Jul 3, 2022

virtualenv packj
. packj/bin/activate
pip install -r requirements.txt

(packj) uzer@smarttop ~/packj $
python3 /home/uzer/packj.git/main.py pypi yt-dlp
Traceback (most recent call last):
  File "/home/uzer/packj.git/main.py", line 23, in <module>
    from static_util import get_static_proxy_for_language
  File "/home/uzer/packj.git/static_util.py", line 4, in <module>
    from static_proxy.py_analyzer import PyAnalyzer
  File "/home/uzer/packj.git/static_proxy/py_analyzer.py", line 13, in <module>
    import proto.python.ast_pb2 as ast_pb2
  File "/home/uzer/packj.git/proto/python/ast_pb2.py", line 32, in <module>
    _descriptor.EnumValueDescriptor(
  File "/home/uzer/packj/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 755, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
@ashishbijlani
Copy link
Collaborator

Added a Dockerfile that uses Ubuntu 20.04 and relevant dependencies to fix these build issues. Updated the README instructions to use Docker image.

@Almenon
Copy link

Almenon commented Feb 18, 2023

This issue is because the protobuf version is not pinned. See

packj/setup.py

Line 23 in e6576d6

REQUIREMENTS = [i.strip().split('==')[0] for i in open(os.path.join(here, "requirements.txt")).readlines()]
, the version is being stripped from the requirements. Because the protobuf version is not pinned the latest protobuf version is installed, which is incompatible with this package.

It took me a long time to find this out, I didn't notice the split() logic so I thought setup.py was installing the pinned version in the requirements file. I was baffled as to why the wrong version was being installed. I was in python dependency hell looking over various debug logs and metadata until I realized the answer was right in front of me... 😅

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

Successfully merging a pull request may close this issue.

3 participants