arxdust / pihole2telegram Goto Github PK
View Code? Open in Web Editor NEWSimple pihole bot for telegram
Simple pihole bot for telegram
$ python3 pihole2telegram.py
Traceback (most recent call last):
File "pihole2telegram.py", line 2, in <module>
from telegram.ext import CommandHandler
File "/usr/local/lib/python3.7/dist-packages/telegram/ext/__init__.py", line 25, in <module>
from .callbackcontext import CallbackContext
File "/usr/local/lib/python3.7/dist-packages/telegram/ext/callbackcontext.py", line 21, in <module>
from telegram import Update
ImportError: cannot import name 'Update' from 'telegram' (/usr/local/lib/python3.7/dist-packages/telegram/__init__.py)
I have deployed a telegram bot (with Django) on Heroku with python
version 3.6.9
It worked well without any issues.
After months I did some changes and while trying to deploy it again I get issues.
Heroku doesn't support python 3.6.9
anymore. It supports 3.6.10
So I set up venv with python 3.6.10 and I'm still getting the same issue after running the server.
Short issue:
from .callbackcontext import CallbackContext File "/home/usr/bot-name/venv/lib/python3.6/site-packages/telegram/ext/callbackcontext.py", line 21, in <module> from telegram import Update ImportError: cannot import name 'Update' from 'telegram' (/home/usr/bot-name/venv/lib/python3.6/site-packages/telegram/__init__.py)
Also I have tried python 3.7.6
(it's also supported by Heroku) but I get the same issue after running the server:
_python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 77, in raise_last_exception
raise _exception[1]
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/django/core/management/init.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/django/apps/config.py", line 116, in create
mod = import_module(mod_path)
File "/home/usr/bot-name/venv/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in call_with_frames_removed
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/django_telegrambot/apps.py", line 9, in
from telegram.ext import Dispatcher
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/telegram/ext/init.py", line 25, in
from .callbackcontext import CallbackContext
File "/home/usr/bot-name/venv/lib/python3.7/site-packages/telegram/ext/callbackcontext.py", line 21, in
from telegram import Update
ImportError: cannot import name 'Update' from 'telegram' (/home/usr/bot-name/venv/lib/python3.7/site-packages/telegram/init.py)
Here you can find my requirements file:
requirements.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.