V
V
Victor2019-11-03 14:52:56
Python
Victor, 2019-11-03 14:52:56

Why doesn't the import of the installed module work?

According to the textbook , I'm trying to make a telegram bot.

  1. Installed a clean server Ubuntu 18.04.3
  2. Installed pip
  3. Installed the pytelegrambotapi and telebot modules via pip (they are displayed with the pip list command)
  4. connected to the server via ssh.
  5. moved to the folder where the whole project will be located
  6. I execute the python3 command - I get into the interpreter
  7. I execute the command import telebot

As a result, I get an error:
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'telebot'
What should I do to make the import work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-11-03
@Victor_M

I suspect that you have installed a library for the second Python,
command pip install pytelegrambotapi
A follows
It is good practice to use a virtual environment, separate for each project.
Accordingly, put packages in it, and not globally.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question