0

Due a new requirement on my Django app, I started using zeep. I installed it as usual throught an existing virtualenv. The problem is that, when i tried to deploy my app, using Apache and mod_wsgi, it doesn't work, returning the following error:

ImportError at /prwn/
cannot import name python_2_unicode_compatible

/home/prwn/env/lib/python2.7/site-packages/zeep/wsdl/definitions.py in <module>
from six import python_2_unicode_compatible 

The weirdest thing is that when my app is ran using runserver and the same virtualenv, it runs fine. I tried creating a new virtualenv, a new Apache's virtualhost, even changing the permisions to 777 to the whole virtualenv, and still not working.

I use the versions 0.23.0 of zeep, 1.10.0 of six and python 2.7

2 Answers 2

2

Well, at the end i figured it out. Oddly, when my app was running with Apache, it used the old version of the six library, wich was installed globally on my system. I solved it upgrading the global six library to the new version, and it worked.

3
  • 1
    You aren't configuring mod_wsgi correctly so it knows about the virtual environment then. Read: modwsgi.readthedocs.io/en/develop/user-guides/… Apr 21, 2017 at 22:07
  • In the Django 500 error page, it shows on the Python paths list an entry to site-packages folders of my virtualenv. I think i'm configuring the virtualenv correctly , or i'm wrong? Apr 23, 2017 at 16:39
  • 1
    The problem is how you specify where the virtual environment is. Whatever way you are using it must have been putting the virtual environment directories at the end of sys.path. If correct methods are used, it should be at the start and so take priority. So check that document I linked and ensure you are using one of the recommended ways of doing it. Apr 27, 2017 at 0:49
1

solved it using 'pip install --upgrade six'

this is because of the older version of six < 1.9.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.