question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Noob Error: No module named telethon

See original GitHub issue

I used python modules before, and I thought I knew how to install them. But I’m stuck.

I’m trying to create a Python script that uses Telegram and Instagram to do some automated tasks.

So, I’ve installed telethon using pip pip3 install telethon. And also libssl I’ve created a test file named AntidoteBot_Telegram_v1.py in my Projects Folder. My code is:

from telethon import TelegramClient

api_id = xxxxx
api_hash = 'xxxxxxxxxxxxxxxxxxxxxxxx'

client = TelegramClient('antidotebot', api_id, api_hash)
client.start()

for dialog in client.get_dialogs(limit=15):
    print(utils.get_display_name(dialog.entity), dialog.draft.message)

client.disconnect()

But I’m unable to start it. Error:

pi@raspberrypi_alex:~/Projects/InstaPy $ python AntidoteBot_Telegram_v1.py 
Traceback (most recent call last):
  File "AntidoteBot_Telegram_v1.py", line 1, in <module>
    from telethon import TelegramClient
ImportError: No module named telethon

What am I doing wrong?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Lonamicommented, Feb 10, 2018

python might be python2, and you used (the right) pip3 to install it. So run python3 maybe.

0reactions
Subibhucommented, Mar 30, 2020

the command lines i meant

Read more comments on GitHub >

github_iconTop Results From Across the Web

python 3.x - ModuleNotFoundError: No module named 'telethon'
I have installed telethon using the following code:
Read more >
ModuleNotFoundError: No module named 'Telethon'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'Telethon' How to remove the ModuleNot.
Read more >
How to fix "ModuleNotFoundError: No module named 'telethon'"
You must first install the package before you can use it in your code. Run the following command to install the package and...
Read more >
Forums - PythonAnywhere
Numpy import Error when running flask app 5 posts | last activity 2 years, ... No module named django.core.management 8 posts | last...
Read more >
[Example code]-Modules missing when installing python project ...
... and the fun setup.py file is below. I'm sure this is some noob issue; I am new to python packaging and python...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found