Coder Social home page Coder Social logo

Comments (5)

Gadgetoid avatar Gadgetoid commented on July 17, 2024 1

But if I try to import the package, I still receive an error relating to python-numpy

By default virtual environments will ignore system installed packages.

You need to use the --system-site-packages switch.

Eg:

 python3 -m venv --system-site-packages ~/.virtualenvs/AAAAARRRGGHHHHHH

That said, I believe you can now re-install numpy into the virtual env and it will find the system libraries, since python3-numpy pulls them in as dependencies.

from inky.

helgibbons avatar helgibbons commented on July 17, 2024

Have you tried the other suggestion - removing the pip version of numpy and installing the system version from apt?

pip3 uninstall numpy  # remove previously installed version
apt install python3-numpy

from inky.

theptrk avatar theptrk commented on July 17, 2024

Oh interesting, i tried apt install python-numpy but got this error

(env) patricktran@myraspberrypi:~ $ sudo apt install python-numpy
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-numpy is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-numpy' has no installation candidate

Then I noticed you mentioned python3-numpy. It installed that ok.

But if I try to import the package, I still receive an error relating to python-numpy

(env) patricktran@myraspberrypi:~ $ python
^[[APython 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from inky.auto import auto
Traceback (most recent call last):
  File "/home/patricktran/env/lib/python3.11/site-packages/inky/inky.py", line 8, in <module>
    import numpy
ModuleNotFoundError: No module named 'numpy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/patricktran/env/lib/python3.11/site-packages/inky/__init__.py", line 3, in <module>
    from . import inky                            # noqa: F401
    ^^^^^^^^^^^^^^^^^^
  File "/home/patricktran/env/lib/python3.11/site-packages/inky/inky.py", line 10, in <module>
    raise ImportError('This library requires the numpy module\nInstall with: sudo apt install python-numpy')
ImportError: This library requires the numpy module
Install with: sudo apt install python-numpy

from inky.

RetroZelda avatar RetroZelda commented on July 17, 2024

i had this same problem and i had to apt install libopenblas-dev

from inky.

theptrk avatar theptrk commented on July 17, 2024

But if I try to import the package, I still receive an error relating to python-numpy

By default virtual environments will ignore system installed packages.

You need to use the --system-site-packages switch.

Eg:

 python3 -m venv --system-site-packages ~/.virtualenvs/AAAAARRRGGHHHHHH

That said, I believe you can now re-install numpy into the virtual env and it will find the system libraries, since python3-numpy pulls them in as dependencies.

It worked!

Now I get a different issue but I'll look into that separately. Thanks!

(env) patricktran@myraspberrypi:~ $ python
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from inky.auto import auto
>>> display = auto()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/patricktran/env/lib/python3.11/site-packages/inky/auto.py", line 83, in auto
    raise RuntimeError("No EEPROM detected! You must manually initialise your Inky board.")
RuntimeError: No EEPROM detected! You must manually initialise your Inky board.

Update: solved
I guess my device (Inky Impression 4" (7 colour ePaper/eInk HAT)) cannot use auto

from PIL import Image, ImageDraw, ImageFont
from inky.inky_uc8159 import Inky

# Initialize the Inky display
inky_display = Inky()

from inky.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.