tomer8007 / kik-bot-api-unofficial

Python API for writing unoffical Kik bots that act like humans
MIT License
126 stars 76 forks source link

No module named 'kik_unofficial.protobuf.groups' #217

Closed Nateu closed 10 months ago

Nateu commented 1 year ago

Error while running example echo_bot.py:

I made a fresh checkout of the project and tried to run echo_bot.py. This resulted in an error:

Traceback (most recent call last):
  File "/Users/nateu2/dev/kik-bot-api-unofficial/./examples/echo_bot.py", line 11, in <module>
    from kik_unofficial.client import KikClient
  File "/Users/nateu2/dev/kik-bot-api-unofficial/venv/lib/python3.9/site-packages/kik_unofficial/client.py", line 10, in <module>
    import kik_unofficial.callbacks as callbacks
  File "/Users/nateu2/dev/kik-bot-api-unofficial/venv/lib/python3.9/site-packages/kik_unofficial/callbacks.py", line 7, in <module>
    from kik_unofficial.datatypes.xmpp.roster import FetchRosterResponse, PeersInfoResponse, GroupSearchResponse
  File "/Users/nateu2/dev/kik-bot-api-unofficial/venv/lib/python3.9/site-packages/kik_unofficial/datatypes/xmpp/roster.py", line 7, in <module>
    from kik_unofficial.protobuf.groups.v1 import group_search_service_pb2
ModuleNotFoundError: No module named 'kik_unofficial.protobuf.groups'

System setup:

MacOS: 12.4 Python: 3.9.13 (pyenv)

Requested info: protobuf version

$ pip show protobuf
Name: protobuf
Version: 4.21.2
Summary: 
Home-page: https://developers.google.com/protocol-buffers/
Author: protobuf@googlegroups.com
Author-email: protobuf@googlegroups.com
License: 3-Clause BSD License
Location: /Users/nateu/dev/kik-bot-api-unofficial/venv/lib/python3.9/site-packages
Requires: 
Required-by: kik-unofficial

Discussed in https://github.com/tomer8007/kik-bot-api-unofficial/discussions/216

Originally posted by **Nateu** July 16, 2022 Hello, I'm curious to know what is the recommend python version to used with this module? I've got some code what I want to have make use of this module but it's written in 3.10. Should I downgrade or should it all work just fine? I'm running in a bit of a snag I don't think it's related to my python version tho as I have the same issue wen trying the examples on 3.9. However I'll start a separate thread for that as a comment to the code that has recently changed as I think that's where the problem is.
BaconPeeks commented 1 year ago

Use python 3.8.5

wrglbr commented 1 year ago

Move the bot py file into the main directory, it can't find the module bc its in the wrong dir...

DuzziOmacron commented 1 year ago

Just move the entire kik- unofficial DIR into the kik-bot-api-unofficial DIR. It should not be subdirectory.

PointlessUser commented 1 year ago

It was due to the lack of __init__.py files. This should now be resolved

DuzziOmacron commented 1 year ago

Finally an actual explanation instead of my workaround which is likely the wrong way to go about it...thank you for the comment.

PointlessUser commented 10 months ago

@tomer8007 You can close this issue