Code Monkey home page Code Monkey logo

Comments (7)

joukos avatar joukos commented on August 12, 2024

Hmm... do you get similar output from these commands in the virtualenv?

(papertty) pi@rasputin:~/code/PaperTTY $ pip list
Package       Version
------------- -------
click         6.7
Pillow        5.2.0
pip           18.0
pkg-resources 0.0.0
RPi.GPIO      0.6.3
setuptools    40.1.0
spidev        3.2
wheel         0.31.1
(papertty) pi@rasputin:~/code/PaperTTY $ pip --version
pip 18.0 from /home/pi/.virtualenvs/papertty/lib/python3.5/site-packages/pip (python 3.5)
(papertty) pi@rasputin:~/code/PaperTTY $ which python; python --version
/home/pi/.virtualenvs/papertty/bin/python
Python 3.5.3

from papertty.

albill avatar albill commented on August 12, 2024

My version:

~/PaperTTY $ pip list
Package       Version
------------- -------
click         6.7    
Pillow        5.2.0  
pip           18.0   
pkg-resources 0.0.0  
RPi.GPIO      0.6.3  
setuptools    40.2.0 
spidev        3.2    
wheel         0.31.1 

pip --version
pip 18.0 from /home/pi/.virtualenvs/papertty/lib/python3.5/site-packages/pip (python 3.5)

~/PaperTTY $ which python
/home/pi/.virtualenvs/papertty/bin/python
:~/PaperTTY $ python --version
Python 3.5.3

from papertty.

joukos avatar joukos commented on August 12, 2024

I need to take a closer look later on the actual reason when I have time, but it seems that I had the system package python3-pil installed on the system (via apt) and removing that I also get the same error in virtualenv.

So a workaround for now: sudo apt-get install python3-pil.

If you find out what should be added to requirements, or if some pip trickery fixes it, do tell.

from papertty.

albill avatar albill commented on August 12, 2024

Seems that's not the only one. After installing the package at the system level and trying again, I get:

~/PaperTTY $ sudo ./papertty.py list
Traceback (most recent call last):
  File "./papertty.py", line 14, in <module>
    import drivers.drivers_base as drivers_base
  File "/home/pi/PaperTTY/drivers/drivers_base.py", line 19, in <module>
    import spidev
ImportError: No module named 'spidev'

Installing python3-spidev and trying again, I get:

~/PaperTTY $ sudo ./papertty.py list
Traceback (most recent call last):
  File "./papertty.py", line 14, in <module>
    import drivers.drivers_base as drivers_base
  File "/home/pi/PaperTTY/drivers/drivers_base.py", line 20, in <module>
    import RPi.GPIO as GPIO
ImportError: No module named 'RPi'

I suspect that it is pulling multiple packages from the system. I'm going to work down the chain.

from papertty.

joukos avatar joukos commented on August 12, 2024

Hmm, in that case it appears the virtualenv doesn't work as intended...

from papertty.

joukos avatar joukos commented on August 12, 2024

Ah, ok, this is because of sudo, ie. the environment changes.

Two ways to run it:

Activating the virtualenv within the sudo command:

sudo bash -c ". ~pi/.virtualenvs/papertty/bin/activate; ./papertty.py --driver epd2in13 terminal --autofit"

Or, simpler, just running the interpreter directly, ensuring the env gets set:

sudo ~/.virtualenvs/papertty/bin/python3 ./papertty.py --driver epd2in13 terminal --autofit

I'll update the docs. Thanks for submitting the issue.

from papertty.

joukos avatar joukos commented on August 12, 2024

Fixed in cea7132.

from papertty.

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.