SaltieRL / carball

📈 A Rocket League replay decompiling and analysis library
https://saltierl.github.io/carball/dev/bench/
Apache License 2.0
147 stars 49 forks source link

Bug: installation ImportError: cannot import name 'game_metadata_pb2' #159

Open MadsJensen opened 5 years ago

MadsJensen commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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

MadsJensen commented 5 years ago

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

Longi94 commented 5 years ago

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 commented 5 years ago

Yeah we use proto2, not proto3.

MadsJensen commented 5 years ago

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.