django-mockups
django-mockups copied to clipboard
Installation under Python3 results in many syntax errors
I try install this library for Python 3.4 but i have this errors:
pip install django-mockups
Downloading/unpacking django-mockups
Downloading django-mockups-0.4.8.tar.gz
Running setup.py (path:/home/tulipan/Proyectos/IspanyolHaber/build/django-mockups/setup.py) egg_info for package django-mockups
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.*.swo' found anywhere in distribution
warning: no previously-included files matching '.*.swp' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
Installing collected packages: django-mockups
Running setup.py install for django-mockups
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.*.swo' found anywhere in distribution
warning: no previously-included files matching '.*.swp' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
File "/home/tulipan/Proyectos/IspanyolHaber/lib/python3.4/site-packages/mockups/management/commands/mockups.py", line 89
print '%s(pk=%s): %s' % (
^
SyntaxError: invalid syntax
File "/home/tulipan/Proyectos/IspanyolHaber/lib/python3.4/site-packages/mockups/base.py", line 279
except constraints.InvalidConstraint, e:
^
SyntaxError: invalid syntax
Successfully installed django-mockups
Cleaning up...
When I install the django-mockups package in a virtual environment with python-3.4 I get this output
(test)➜ sfotipy pip install django-mockups
Collecting django-mockups
Installing collected packages: django-mockups
Successfully installed django-mockups-0.4.8
(test)➜ myproject easy_install django-mockups
Searching for django-mockups
Best match: django-mockups 0.4.8
Adding django-mockups 0.4.8 to easy-install.pth file
Using /home/bgarcial/.virtualenvs/test/lib/python3.4/site-packages
Processing dependencies for django-mockups
Finished processing dependencies for django-mockups
(test)➜ myproject
I have the ubuntu14.0.4.2 and my virtual environment was created with virtualenvwrapper I do not had some errors, but my django-mockups installation does not work with my Django Project suchs as I denote in this question http://stackoverflow.com/questions/31238500/django-settings-module-how-to-configure/31238679#31238679
Is possible that django-mockups does not support in python-3.x? Thanks a lot :)
For this issue:
\venv\lib\site-packages\mockups\generators.py", line 101, in StringGenerator
coerce_type = unicode
NameError: name 'unicode' is not defined
Solution: Only replace all "unicode" words to "str" on generators.
For this issue:
\venv\lib\site-packages\mockups\generators.py", line 102, in StringGenerator
singleline_chars = string.letters + u' '
AttributeError: 'module' object has no attribute 'letters'
Solution: Only replace "string.letters" to "string.ascii_letters"
For this issue:
\venv\lib\site-packages\mockups\base.py", line 279
except constraints.InvalidConstraint, e:
^
SyntaxError: invalid syntax
Solution: Only replace "constraints.InvalidConstraint, e:" to "constraints.InvalidConstraint as e:"
Incompatibility between 2.7 and 3.4 python cause these errors.