Python Using Databases in Python Our Diary App Doing Data Entry

Brienna Herold
Brienna Herold
5,155 Points

No module named peewee

diary.py runs when I type in the terminal

Briennas-MacBook:Programming Brienna$ python diary.py
Briennas-MacBook:Programming Brienna$ 

but not when I type in

Briennas-MacBook:Programming Brienna$ python3 diary.py
Traceback (most recent call last):
  File "diary.py", line 8, in <module>
    from peewee import * 
ImportError: No module named 'peewee'

Does this mean I need to re-install peewee...? Does it not work with python3 or something?

7 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

If you have python3, you probably have pip3, too. Install Peewee with that and try it again.

Anthony Attard
Anthony Attard
43,913 Points

I think you have ran pip install peewee(python2). For python3 use pip3 install peewee.

Shana HT
Shana HT
3,292 Points

I ran into the same issue.

I followed the instructions on the site I link below to install and run with git.

http://docs.peewee-orm.com/en/latest/peewee/installation.html

These are the commands:

git clone https://github.com/coleifer/peewee.git cd peewee python3 setup.py install

Have you installed pewee are you using virtual env?

Brienna Herold
Brienna Herold
5,155 Points

Yes, I installed peewee. It works with python 2 but not python 3. I would like to know why.

Timothy Clarke
Timothy Clarke
11,710 Points

I'm running into this same issue using python 3 and I used pip3 to install peewee. I've been searching for the solution and I think it may have something to do with the directory that pip3 is saving to, but I have no idea how to redirect it.

t19clar ~ $ pip3 install peewee Requirement already satisfied (use --upgrade to upgrade): peewee in /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-package

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Did you try following the instructions pip3 gave you? In other words, did you do pip3 install --upgrade peewee?

dear Kenneth .. i did install peewee using pip3 and this shows :

ARTISANVs-MacBook-Pro:lib artisanv$ pip3 install peeweepip3 install peewee Collecting peeweepip3 Could not find a version that satisfies the requirement peeweepip3 (from versions: ) No matching distribution found for peeweepip3 You are using pip version 8.0.2, however version 8.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command. ARTISANVs-MacBook-Pro:lib artisanv$ pip install --upgrade pip Requirement already up-to-date: pip in ./python2.7/site-packages ARTISANVs-MacBook-Pro:lib artisanv$

i have both python2 and 3 ...my peewee projects wowrk fine with py2 but not 3 .....

any advice ???

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

You'll have better luck withpip3 install peewee. Not sure where you got the extra pip3 from.