[newbie] import error after restart (virtualenv)

17 views
Skip to first unread message

David

unread,
Sep 18, 2015, 7:56:10 PM9/18/15
to Django users
Dear Django experts,

I am reading through Harry Percival's "Test-Driven Development with
Python".

As I finished chapter 3 yesterday, I was fully on track, perfectly
aligned with the book.

Today I restarted my computer, activated the virtualenv in question --
and get an error message that was not there beforehand:

(Percival_TDD)david@lubuntu:~/PycharmProjects/Percival_TDD/superlists/lists$
python tests.py
Traceback (most recent call last):
File "tests.py", line 5, in <module>
from lists.views import home_page
ImportError: No module named 'lists'


I neither understand why he doesn't find 'lists' anymore nor do I know
how to solve the problem.

Can you please guide me towards a solution?

Thank you!

David



The project structure looks as follows:

(Percival_TDD)david@lubuntu:~/PycharmProjects/Percival_TDD/superlists$ tree
.
├── db.sqlite3
├── functional_tests.py
├── lists
│ ├── admin.py
│ ├── __init__.py
│ ├── migrations
│ │ └── __init__.py
│ ├── models.py
│ ├── tests.py
│ └── views.py
├── manage.py
└── superlists
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-34.pyc
│ ├── settings.cpython-34.pyc
│ ├── urls.cpython-34.pyc
│ └── wsgi.cpython-34.pyc
├── settings.py
├── urls.py
└── wsgi.py


views.py
tests.py

Vijay Khemlani

unread,
Sep 20, 2015, 10:13:41 PM9/20/15
to django...@googlegroups.com
Aren't tests supposed to run with "python manage.py test lists"?



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/55FCA478.5000609%40gmx.net.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages