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

Error #1

Closed
V1lu0 opened this issue Aug 19, 2021 · 7 comments
Closed

Error #1

V1lu0 opened this issue Aug 19, 2021 · 7 comments

Comments

@V1lu0
Copy link

V1lu0 commented Aug 19, 2021

windwos10,Python 3.9.6,use the example code

I used to use python3 in other versions,All the errors are herefrom pytglib.client import Telegram

from pytglib.client import Telegram

# Change the values below
api_id = ******
api_hash = '******'
phone_number = '+******'
dbenc = '******'

# Initiate the client
client = Telegram(api_id=api_id, api_hash=api_hash, phone=phone_number, database_encryption_key=dbenc)

# Login to the client
client.login() 

# Define the handler function
def my_message_handler(update):
    print(update)

# Register it
client.add_message_handler(my_message_handler)

tg.idle()

# And you're ready to go!
C:\Users\******\python3>python 1.py
Traceback (most recent call last):
  File "C:\Users\******\python3\1.py", line 1, in <module>
    from pytglib.client import Telegram
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "D:\******\Python39\lib\site-packages\pytglib-0.4-py3.9.egg\pytglib\client.py", line 18, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "D:\******\Python39\lib\site-packages\pytglib-0.4-py3.9.egg\pytglib\functions.py", line 9, in <module>
  File "D:\******\Python39\lib\site-packages\pytglib-0.4-py3.9.egg\pytglib\functions.py", line 214, in Function
TypeError: __init__() missing 1 required positional argument: 'horizontal_accuracy'
@WebShark025
Copy link
Contributor

WebShark025 commented Aug 19, 2021 via email

@V1lu0
Copy link
Author

V1lu0 commented Aug 19, 2021

python3 ?

@V1lu0
Copy link
Author

V1lu0 commented Aug 19, 2021

My python version is 3

@WebShark025
Copy link
Contributor

WebShark025 commented Aug 19, 2021 via email

@V1lu0
Copy link
Author

V1lu0 commented Aug 19, 2021

didn't work in Python 3.6.8

@jackchevalley
Copy link

jackchevalley commented Jun 7, 2022

same error on Python 3.8.10 (Linux - ubuntu 20 - nginx )

@WebShark025
Copy link
Contributor

Fixed in latest commit, should work now.

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