0

I'm trying to run a python script that uses easyimap to send and recive mails. The script works fine on windows. I want to run it 24/7, but don't want to leave my pc on all the time. A PI would be a perfect solution for that. On the Pi I installed python with

sudo apt-get install python3

which worked fine and python was installed. I then installed pip3 with

sudo apt-get install pip3

which worked fine as well. I then installed easyimap with

sudo pip3 install easyimap

also ran fine and told me it was installed. When i tried running my code with

python main.py

I got the error

 Traceback (most recent call last):
  File "main.py", line 5, in <module>
    import easyimap
ImportError: No module named easyimap

I also installed easyimap-python which didn't help. Any suggestions I could try?

2 Answers2

0

It worked the way Iron Fist said in his comment.

python3 main.py

worked fine.

0

As pointed out by Furas, most of Linux system still have by default python2 so running in terminal python only calls for python2. If you want to keep working with python3, you will need to set the default python version to python3, see this answer for correct way. To summarize it, you will need to:

$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10

This way you won't have to call for python3 in terminal, only python will be enough.

Iron Fist
  • 10,739
  • 2
  • 18
  • 34