google-deepmind / code_contests

Apache License 2.0
2.1k stars 208 forks source link

Problem with getting data from riegeli files when not using bazel and trying to run print_names_and_sources.py directly #27

Closed ShuyinOuyang closed 1 year ago

ShuyinOuyang commented 1 year ago

I try to run the code with bazel, but there are some ERROR with the WORKSPACE; so I try to run the file 'print_names_and_sources.py' independently, but I fail to import contest_problem_pb2. I don't know how to solve this problem, is there another way to import this package?

ShuyinOuyang commented 1 year ago

The error is : INFO: Repository com_github_grpc_grpc instantiated at: E:/pythonproject/code_contest/code_contests/WORKSPACE:4:15: in Repository rule git_repository defined at: C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git.bzl:176:33: in ERROR: An error occurred during the fetch of repository 'com_github_grpc_grpc': Traceback (most recent call last): File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git.bzl", line 170, column 35, in _git_repository_implementation update = _clone_or_update_repo(ctx) File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, column 20, in _clone_or_updaterepo git = git_repo(ctx, directory) File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 91, column 12, in git_repo _update(ctx, git_repo) File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 101, column 9, in _update init(ctx, git_repo) File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 118, column 15, in init _error(ctx.name, cl, st.stderr) File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 190, column 9, in _error fail("error running '%s' while working with @%s:\n%s" % (command_text, name, stderr)) Error in fail: error running 'git init C:/users/m1327/_bazel_m1327/xrzwcqr7/external/com_github_grpc_grpc' while working with @com_github_grpc_grpc: java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("git" init C:/users/m1327/_bazel_m1327/xrzwcqr7/external/com_github_grpc_grpc): The system cannot find the file specified. (error: 2) ERROR: E:/pythonproject/code_contest/code_contests/WORKSPACE:4:15: fetching git_repository rule //external:com_github_grpc_grpc: Traceback (most recent call last): File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git.bzl", line 170, column 35, in _git_repository_implementation update = _clone_or_update_repo(ctx) File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, column 20, in _clone_or_updaterepo git = git_repo(ctx, directory) File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 91, column 12, in git_repo _update(ctx, git_repo) File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 101, column 9, in _update init(ctx, git_repo) File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 118, column 15, in init _error(ctx.name, cl, st.stderr) File "C:/users/m1327/_bazel_m1327/xrzwcqr7/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 190, column 9, in _error fail("error running '%s' while working with @%s:\n%s" % (command_text, name, stderr)) Error in fail: error running 'git init C:/users/m1327/_bazel_m1327/xrzwcqr7/external/com_github_grpc_grpc' while working with @com_github_grpc_grpc: java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("git" init C:/users/m1327/_bazel_m1327/xrzwcqr7/external/com_github_grpc_grpc): The system cannot find the file specified. (error: 2) ERROR: Error computing the main repository mapping: no such package '@com_github_grpc_grpc//bazel': error running 'git init C:/users/m1327/_bazel_m1327/xrzwcqr7/external/com_github_grpc_grpc' while working with @com_github_grpc_grpc: java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("git" init C:/users/m1327/_bazel_m1327/xrzwcqr7/external/com_github_grpc_grpc): The system cannot find the file specified. (error: 2)

felixgimeno commented 1 year ago

contest_problem_pb2 corresponds to the Python generated code for the ContestProblem protocol buffer, which is needed to read the raw data from the dataset. contest_problem_pb2 is generated on the fly when using bazel for building, thus we don't support reading the data without using bazel.