I've made a python program that goes online and look for news on some site and if something is found it send me a message on Telegram. I've run my program on my Debian machine and it works, now I want put it on my Raspberry Pi and let it run... So I copieted all the file on my raspberry installed all the necessary library (included https://github.com/eternnoir/pyTelegramBotAPI) but when I run my program with :
python2 ./main.py
I get:
ImportError: No module named telebot
What I can do? and why I get this error? EDIT:
Probably the error is what Bruno9779 said. Those are my output:
python2 --version ----> python 2.7.11
python --version ----> python 3.5.1
env python --version -> python 3.5.1
pip --version --------> pip 2.7.1.2 from /usr/lib/python3.5/site_packages (python 3.5)
So I changed my shebang to #!/usr/bin/python2 -tt (I've also tried with #!/usr/bin/env python2 -tt but I still get the same error)
From what surfaced in the comments of my other answer, it looks like there could be a versión mismatch of sorts.
Try:
python2 --version
python --version
env python --version
pip --version
To see if there are mismatches.
Since you are calling the script with the command python2
I guess you are running some sort of virtualenv, where python
or python3
point to another version of python.
The versión of pip you use to install packages must be the same as the version you use to run the script