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

Benjy Malca
  • 597
  • 1
  • 9
  • 21

2 Answers2

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.

Benjy Malca
  • 597
  • 1
  • 9
  • 21
  • 1
    You aren't configuring mod_wsgi correctly so it knows about the virtual environment then. Read: http://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html – Graham Dumpleton Apr 21 '17 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? – Benjy Malca Apr 23 '17 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. – Graham Dumpleton Apr 27 '17 at 00:49
1

solved it using 'pip install --upgrade six'

this is because of the older version of six < 1.9.0

Ahmad A.A
  • 749
  • 7
  • 15