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: installation ImportError: cannot import name 'game_metadata_pb2' #159

Open
MadsJensen opened this issue Jun 14, 2019 · 8 comments
Open

Comments

@MadsJensen
Copy link

Hi,

I get the following error trying to install carball from source, both pip install -e . and python init.py creates the same error. I can install with pip install carball

I am macos and python 3.6

Traceback (most recent call last):
  File "init.py", line 17, in <module>
    initialize_project()
  File "init.py", line 14, in initialize_project
    initalize_rattletrap()
  File "init.py", line 2, in initalize_rattletrap
    from carball.rattletrap.check_rattletrap_version import update_rattletrap
  File "/xxx/xxx/toolboxes/carball/carball/__init__.py", line 2, in <module>
    from carball.decompile_replays import decompile_replay
  File "/xxx/xxx/toolboxes/carball/carball/decompile_replays.py", line 4, in <module>
    from carball.analysis.analysis_manager import AnalysisManager
  File "/xxx/xxx/toolboxes/carball/carball/analysis/analysis_manager.py", line 14, in <module>
    from ..analysis.cleaner.cleaner import clean_replay
  File "/xxx/xxx/toolboxes/carball/carball/analysis/cleaner/cleaner.py", line 5, in <module>
    from ...analysis.cleaner.frame_cleaner import remove_invalid_players
  File "/xxx/xxx/toolboxes/carball/carball/analysis/cleaner/frame_cleaner.py", line 5, in <module>
    from ...generated.api import game_pb2
  File "/xxx/xxx/toolboxes/carball/carball/generated/api/game_pb2.py", line 16, in <module>
    from api.metadata import game_metadata_pb2 as api_dot_metadata_dot_game__metadata__pb2
ImportError: cannot import name 'game_metadata_pb2'
@Sciguymjm
Copy link
Member

Can you check if game_metadata_pb2.py is located in that folder? (carball/carball/generated/api/metadata) If not, it looks like it's a proto generating issue. Is there any output when you run init.py?

@Longi94
Copy link
Contributor

Longi94 commented Jun 14, 2019

you might be using a different protoc.exe, that as api_dot_metadata_dot_game__metadata__pb2 isn't there for me, do you have the PROTOC_PATH env variable set?

@MadsJensen
Copy link
Author

@Sciguymjm Yes the game_metadata_pb2.py is in the folder. I might have a proto issue though.
@Longi94 No i do not have a PROTOC_PATH set.

@Longi94
Copy link
Contributor

Longi94 commented Jun 14, 2019

What platform are you on? What does protoc --version say?

@MadsJensen
Copy link
Author

I am on macos (Mojave) and protoc --version= libprotoc 3.6.1

@Longi94
Copy link
Contributor

Longi94 commented Jun 14, 2019

the protoc bundled with carball is 2.6.1 (well.. for windows, but travis also uses the 2.6.1 binary on linux), could you try with that?

@Sciguymjm
Copy link
Member

Yeah we use proto2, not proto3.

@MadsJensen
Copy link
Author

It seems that installing protobuf 2.6.1 on macos is not trivial. I will test it on another machine later. Thanks for the help.

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