mgfcf / E-Paper-Calendar

A software for rpi zero w to display live-weather info and sync events from any online calendar to a beautiful E-Paper Display, or to just show a slideshow of simplified images.
GNU Lesser General Public License v2.1
27 stars 2 forks source link

ImportError: No module named 'PIL' #12

Closed iroQuai closed 4 years ago

iroQuai commented 4 years ago

Submitting Issues

iroQuai commented 4 years ago

I installed Python PIL (by using sudo apt-get install python-pil' but the error stays the same!

mgfcf commented 4 years ago

Hey @iroQuai , thanks for trying out the software!

The Rapsbian image should not be a problem in most cases. I assume that you started the software with the command mentioned in the installer? The command is using Python 3.5 which may not be installed or, as it is, outdated. I am going to generalize the installer after the problem is resolved.

As long as you use python 3 it should work just fine. With python --version you can see your default python version. If this is some version of python 2, try using python3 --version.

The software should than be able to run with python /home/pi/E-Paper-Master/Calendar/E-Paper.py or python3 /home/pi/E-Paper-Master/Calendar/E-Paper.py.

I assume, that the software could not find the PIL package, because the packages are not associated with the python 3.5 version installed afterwards the package were installed with pip3.

So please have a try with the more general python commands and report back.

Max

mgfcf commented 4 years ago

After looking at the installer again, I see that you probably do not have installed another python 3 version. So I assume, that python3 --version just gives you something about python 3.5.

It would probably be enough, if you just rerun the installer, so that all the installed packages will be accessible through your now installed python 3.5.

Max

iroQuai commented 4 years ago

Hi, thanks for the quick response. After submitting the issue and reading some more about the e-paper display, I've found that it is needed to install some libraries. So afterwards I followed instructions as mentioned here. Or maybe this is already part of your installer? I don't know but just tried...

Afterwards I found your suggestions. Today i've tried them:

`Traceback (most recent call last): File "/home/pi/E-Paper-Master/Calendar/E-Paper.py", line 17, in from MonthOvPanel import MonthOvPanel File "/home/pi/E-Paper-Master/Calendar/MonthOvPanel.py", line 6, in from WeatherHeaderDesign import WeatherHeaderDesign File "/home/pi/E-Paper-Master/Calendar/WeatherHeaderDesign.py", line 34 SyntaxError: Non-ASCII character '\xc2' in file /home/pi/E-Paper-Master/Calendar/WeatherHeaderDesign.py on line 34, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Traceback (most recent call last): File "/home/pi/E-Paper-Master/Calendar/E-Paper.py", line 33, in all_locales[language.lower()].split('.')[0], datetime_encoding)) File "/usr/lib/python3.7/locale.py", line 604, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting

iroQuai commented 4 years ago

In raspi-config i've i've set locale (in localisation options) to "en_GB". In settings.py i've changed language from "en" to "en_GB"

This created a whole new error!

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/numpy/core/init.py", line 24, in from . import multiarray File "/usr/local/lib/python3.7/dist-packages/numpy/core/multiarray.py", line 14, in from . import overrides File "/usr/local/lib/python3.7/dist-packages/numpy/core/overrides.py", line 7, in from numpy.core._multiarray_umath import ( ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/pi/E-Paper-Master/Calendar/E-Paper.py", line 45, in import Epd7in5bAdapter File "/home/pi/E-Paper-Master/Calendar/Epd7in5bAdapter.py", line 5, in import numpy as np File "/usr/local/lib/python3.7/dist-packages/numpy/init.py", line 142, in from . import core File "/usr/local/lib/python3.7/dist-packages/numpy/core/init.py", line 54, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.

  • Try uninstalling and reinstalling numpy.

  • If you have already done that, then:

    1. Check that you expected to use Python3.7 from "/usr/bin/python3", and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy version "1.18.0" you're trying to use.
    2. If (1) looks fine, you can open a new issue at https://github.com/numpy/numpy/issues. Please include details on:
      • how you installed Python
      • how you installed numpy
      • your operating system
      • whether or not you have multiple versions of Python installed
      • if you built from source, your compiler versions and ideally a build log
  • If you're working with a numpy git repository, try git clean -xdf (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on an existing issue about this - open a new one instead.

Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory

I'm lost again and will just wait for your instructions ;)

mgfcf commented 4 years ago

Hey! The python3 command seems to be the correct one and you should stick with the locale en_GB, that is probably not causing the new issue.

I did some research and found two possibilities:

Based on https://stackoverflow.com/questions/53784520/numpy-import-error-python3-on-raspberry-pi and many similiar errors on GitHub, it might be helpful to do sudo apt-get install python-dev libatlas-base-dev to install some missing dependencies for numpy.

On the other hand, based on https://www.reddit.com/r/raspberry_pi/comments/86dwpz/cant_install_numpy_through_pip3/?utm_source=share&utm_medium=web2x, there might be some conflicting numpy installations at work. One installed via pip and the other with apt. As described in the reddit, pip may not have the correct architecture build for the raspberry, but apt should have. As the installer script installs numpy with pip, there might be some issues. Removing the pip one with pip3 uninstall numpy or the apt one with sudo apt-get remove python-numpy may solve the issue. You can check if you have numpy installed with apt with apt list --installed | grep 'numpy'. You should see something similiar to python-numpy/stable ... [installed].

I suggest that you start with the first option, installing possibly missing dependencies and restart the calendar with python3. There should be no need to rerun the installer. If that does not work, check with apt list --installed | grep 'numpy' if there is a conflicting numpy instance installed. If that is the case, I suggest, based on the information from the reddit, to uninstall the pip version with pip3 uninstall numpy as the apt version may be more reliable. Than retry the software.

For your information: pip is probably associated with the default python version, which is python2 in your case, so you want to use pip3 to explicitly use the python3 version. You can check the associated python version with pip(3) --version.

Good luck, Let me know how it goes! Max

iroQuai commented 4 years ago

The first option worked!! Great :) Now i can start tweaking.... thanks for the help so far!