Closed eshellman closed 9 years ago
How did you install pymarc? You might need to install six separately if setup.py didn't do it for you.
what is the error?
2014-10-09 15:58:56,016 ERROR django.request[handle_uncaught_exception]: Internal Server Error: /
Traceback (most recent call last):
File "/Users/eric/.virtualenvs/regluit/lib/python2.7/site-packages/django/core/handlers/base.py", line 101, in get_response
request.path_info)
File "/Users/eric/.virtualenvs/regluit/lib/python2.7/site-packages/django/core/urlresolvers.py", line 298, in resolve
for pattern in self.url_patterns:
File "/Users/eric/.virtualenvs/regluit/lib/python2.7/site-packages/django/core/urlresolvers.py", line 328, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Users/eric/.virtualenvs/regluit/lib/python2.7/site-packages/django/core/urlresolvers.py", line 323, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
File "/Users/eric/.virtualenvs/regluit/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
import(name)
File "/Users/eric/regluit/urls.py", line 5, in
Name: six Version: 1.8.0 Location: /Users/eric/.virtualenvs/regluit/lib/python2.7/site-packages Requires:
went back to pymarc 2.9.2 for now. In the 5 minutes I spent on Stack exchange, I got the impression that as a consequence of import magic, the precise syntax for import of six is fragile
1.4.5
Sorry, I deleted my question after I saw you already reported it :-) I just created a very simple django v1.4.5 application with a single view, that imports pymarc and it works fine.
But I notice this as well https://groups.google.com/forum/#!topic/pymarc/cMWKNYiyDbU
What do you see if you bring up the django shell and try to import like this?
$ ./manage.py shell
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from six.moves import zip_longest
(regluit)gewurztraminer:~ eric$ django-admin.py shell Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54) Type "copyright", "credits" or "license" for more information.
IPython 0.13.2 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details.
ImportError Traceback (most recent call last)
/Users/eric/.virtualenvs/regluit/lib/python2.7/site-packages/django/core/management/commands/shell.pyc in
ImportError: cannot import name zip_longest
how about just:
import six
this works: In [1]: import six In [2]: six.moves.zip_longest Out[2]: itertools.izip_longest
(in other words, in my environment, zip_longest isn't a name)
so I think that
from six.moves import zip_longest as izip_longest
should be replaced with
izip_longest = six.moves.zip_longest
If you do that does it fix your problem? I am unable to replicate the problem you are describing.
ok, let me fiddle a bit. I was hoping the problem would be obvious.
for whatever reason, the following statement fails inside a django 1.4.5 project (python 2.7.5)
from six.moves import zip_longest as izip_longest
(in record.py)