Error was: No module named io

939 views
Skip to first unread message

CrabbyPete

unread,
Aug 27, 2011, 8:59:32 PM8/27/11
to Django users
I developed my code with python 2.6 and django 1.3. Now that I am
deploying it on a dreamhost server the python is version 2.5 and I get
the error above. Is there a work around. Do I need to upgrade python?

sreekanth

unread,
Aug 27, 2011, 10:06:18 PM8/27/11
to django...@googlegroups.com
Hi,

Please check the path , as you changed to a new server and also check the
permissions.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


CrabbyPete

unread,
Aug 28, 2011, 9:59:17 AM8/28/11
to Django users
Thanks, but that's not the problem. Here is the traceback

Traceback:
File "/home/brightmap/lib/python2.5/site-packages/Django-1.3-py2.5.egg/
django/core/handlers/base.py" in get_response
101. request.path_info)
File "/home/brightmap/lib/python2.5/site-packages/Django-1.3-py2.5.egg/
django/core/urlresolvers.py" in resolve
252. sub_match = pattern.resolve(new_path)
File "/home//brightmap/lib/python2.5/site-packages/Django-1.3-
py2.5.egg/django/core/urlresolvers.py" in resolve
158. return ResolverMatch(self.callback, args, kwargs,
self.name)
File "/home/brightmap/lib/python2.5/site-packages/Django-1.3-py2.5.egg/
django/core/urlresolvers.py" in _get_callback
167. raise ViewDoesNotExist("Could not import %s. Error
was: %s" % (mod_name, str(e)))

Exception Type: ViewDoesNotExist at /
Exception Value: Could not import base.views. Error was: No module
named io

Goran

unread,
Aug 28, 2011, 3:29:10 PM8/28/11
to Django users
maybe it is path problem,
try to use:
from projectname.base.view import io
not base.view import io

in INSTALLED_APPS use:
'projectname.base',
not just 'base',

hope it helps,
Goran

Łukasz Rekucki

unread,
Aug 29, 2011, 3:53:35 AM8/29/11
to django...@googlegroups.com
It's not a path problem. It's a python version problem:

http://docs.python.org/library/io.html

"New in version 2.6."

It's not a problem with Django as 1.3 runs fine on 2.5.X. It's a
problem in your code, so either upgrade to 2.6 or rewrite your code in
terms of the older API that io module replaces.

--
Łukasz Rekucki

CrabbyPete

unread,
Aug 29, 2011, 9:26:06 AM8/29/11
to Django users
This is what I suspected. Even though Django 1.3 is supposed to
support python 2.5

Łukasz Rekucki

unread,
Aug 29, 2011, 10:44:08 AM8/29/11
to django...@googlegroups.com
On 29 August 2011 15:26, CrabbyPete <pete....@gmail.com> wrote:
> This is what I suspected. Even though Django 1.3 is supposed to
> support python 2.5
>

Don't want to be rude, but let me repeat: "It's not a problem with
Django as 1.3 runs fine on 2.5.X. It's a problem in **your code**". If
you're trying to use a non-existant module, there's not much Django
can do about it.

--
Łukasz Rekucki

tiemonster

unread,
Aug 30, 2011, 8:30:33 AM8/30/11
to Django users
Let me make a couple of suggestions stemming from my experience:

1. Develop on the same exact version of python that you have installed
on your production server. These kinds of backwards incompatible
changes have bitten me more than once. This should be true for any
language you develop in. You want to mirror the production environment
as closely as possible. Your web host may even be willing to provide a
virtual machine image that exactly replicates the environment they
install on their servers.

2. Working with io streams was not new functionality in 2.6. The io
documentation itself (http://docs.python.org/library/io.html) says
that it is a replacement for the built-in file object (http://
docs.python.org/library/functions.html#file), which you most certainly
can use in Python 2.5.

Hope that helps! :-)

-Mark
Reply all
Reply to author
Forward
0 new messages