A
A
Andrew2020-01-21 23:15:01
Telegram
Andrew, 2020-01-21 23:15:01

Error import telebot on pythonanywhere, what could be wrong?

Wrote a bot in python. I run it on pythonanywhere, I get an error related to the telebot library: ModuleNotFoundError: No module named 'telebot'. In a virtual environment, the telebot sees the library. Pre-installed the pytelegrambotapi library. Are there any possible reasons why?

from flask import Flask,request
from flask_sslify import SSLify
import telebot

app = Flask(__name__)
sslify = SSLify(app)
bot = telebot.TeleBot("token")

@app.route(f'/', methods=['POST', 'GET'])
@bot.message_handler(commands=['start', 'help'])

def send_welcome(message):
  bot.send_message(message.from_user.id, "Привет")

if __name__ == '__main__':
    app.run()

Traceback (most recent call last):
  File "/home/.../bot/main.py", line 6, in <module>
    import telebot
ModuleNotFoundError: No module named 'telebot'

(venv) 19:31 ~ $ pip freeze
-f /usr/share/pip-wheels
aiogram==2.5.3
aiohttp==3.6.2
async-timeout==3.0.1
attrs==19.3.0
Babel==2.8.0
certifi==2019.11.28
chardet==3.0.4
Click==7.0
Flask==1.1.1
Flask-SSLify==0.1.5
idna==2.8
itsdangerous==1.1.0
Jinja2==2.10.3
MarkupSafe==1.1.1
multidict==4.7.4
pyTelegramBotAPI==3.6.7
pytz==2019.3
requests==2.7.0
six==1.14.0
telebot==0.0.3
urllib3==1.25.7
Werkzeug==0.16.0
yarl==1.4.2

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey, 2020-01-21
@anerev

They seem to need to install modules separately https://help.pythonanywhere.com/pages/InstallingNe...

A
Andrew, 2020-01-22
@boooootan

I did it with the telepot library according to this instruction https://blog.pythonanywhere.com/148/ without creating a virtual environment. Maybe someone will need it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question