linuxmint / warpinator

Share files across the LAN
GNU General Public License v3.0
1.22k stars 82 forks source link

Unable to run without protobuf #4

Closed laurelmay closed 4 years ago

laurelmay commented 4 years ago

Hey, it looks like 915c2c4ae1bfbeaaa78d4802be3c22e61be566dd may have caused an issue. It seems like the generated warp_pb2.py file imports google.protobuf. Since python3-protobuf is only a build dependency, not a regular dependency, that causes an error when running the tool, which can be seen below:

Traceback (most recent call last):
  File "/usr/lib/warp/warp.py", line 19, in <module>
    import machines
  File "/usr/lib/warp/machines.py", line 12, in <module>
    import warp_pb2
  File "/usr/lib/warp/warp_pb2.py", line 5, in <module>
    from google.protobuf import descriptor as _descriptor
ModuleNotFoundError: No module named 'google'

Beginning of warp_pb2:

# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: warp.proto

from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
mtwebster commented 4 years ago

Weird - if that was the case it would still run, since it is installed on the system.

What versions of python3-protobuf, python3-grpcio, and python3-grpc-tools do you have?

laurelmay commented 4 years ago

I removed the build dependencies after build was completed. Is it expected that they remain installed?

mtwebster commented 4 years ago

You only need python3-grpcio at runtime - the other two are for bulding (and the -tools package depends on python3-protobuf) - what versions are you using of these?

SwampRabbit commented 4 years ago

I may be running into the same issue on Debian Buster, was built with pbuilder

But python3-protobuf is not in the debian/control file for runtime depends anymore

Traceback (most recent call last): File "/usr/libexec/warp/warp.py", line 17, in <module> import machines File "/usr/libexec/warp/machines.py", line 12, in <module> import warp_pb2 File "/usr/libexec/warp/warp_pb2.py", line 6, in <module> from google.protobuf import descriptor as _descriptor ModuleNotFoundError: No module named 'google'

Have: python3-protobuf (3.6.1.3-2) python3-grpcio (1.16.1-1) python3-grpc-tools (1.14.1-1)

mtwebster commented 4 years ago

Reinstall python3-protobuf.

According to apt, only the build tools need it but clearly they're wrong, I'll re-add it to runtime deps. It should run if you reinstall it. I just did a build/install on a clean lmde4 (buster) and it worked fine.

SwampRabbit commented 4 years ago

Thank you for the quick response, that corrected the errors and it launches with no issues.

mtwebster commented 4 years ago

The dependencies should be ok now, closing