Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.2 Required #112

Open
timolson opened this issue Oct 6, 2015 · 6 comments
Open

Python 3.2 Required #112

timolson opened this issue Oct 6, 2015 · 6 comments

Comments

@timolson
Copy link

timolson commented Oct 6, 2015

$ python --version
Python 2.7.9
$ pip --version
pip 7.1.2 from /Users/tim/assembly/lib/python2.7/site-packages (python 2.7)
$ pip install waliki[all]
  […elided…]
  Hovercraft requires Python 3.2 or higher.

  ----------------------------------------
  Failed building wheel for hovercraft

Seems like there is a transitive dependency on Hovercraft, whose latest version requires Python >= 3.2. We are trying to run Waliki on 2.7. Any ideas? Is there a specific version number for Hovercraft which is the upper bound for 2.7 support?

@mgaitan
Copy link
Owner

mgaitan commented Oct 6, 2015

hi tim, yeah, we should considered this a bug, because hovercraft is "python 3 only" and waliki is not.

however, hovercraft is only mandatory for the 'slides' plugin. if you disable it (comment/remove 'waliki.slides' from your INSTALLED_APPS, you can move forward with 2.7 .

if you still need a "slides" plugin that works on 2.7 and 3+, check the current one which is pretty simple to hack on using an alternative tool like rst2html5. And please, share that back as a pull request.

@timolson
Copy link
Author

timolson commented Oct 7, 2015

Removing it from INSTALLED_APPS is easy, but how to get the rest of waliki installed through pip? pip install waliki works but doesn't seem to install necessary modules like rst2pdf and sendfile. pip install waliki[all] obviously doesn't work because of the original error about Python 3.2. The requirements.txt files in the project don't seem to list everything, or the requirements are implicit, transitive dependencies. Right now I've added pip install rst2pdf but Waliki is still breaking with No module named sendfile. There are several options:

pysendfile               - A Python interface to sendfile(2)
django-xsendfile         - A Django application to serve files using xsendfile
xsendfile                - X-Sendfile implementation in Python/WSGI
py-sendfile              - A Python interface to sendfile(2)
xsendfile_middleware     - WSGI middleware to send files using X-Accel-
                           Redirect
django-sendfile          - Abstraction to offload file uploads to web-server
                           (e.g. Apache with mod_xsendfile) once Django has
                           checked permissions etc.

Which of these are you using? What other dependencies are there? Can you make a requirements.txt that works with Python 2.x?

@mgaitan
Copy link
Owner

mgaitan commented Oct 7, 2015

if you check what are the requirement declared when you install waliki[all], (https://github.com/mgaitan/waliki/blob/master/setup.py#L28-L38) you'll note its a set of all the others

so, try install them explicitly:

pip install waliki micawber markdown django-sendfile rst2pdf

@timolson
Copy link
Author

timolson commented Oct 7, 2015

Thanks… It almost works now.

If I have the waliki.pdf app enabled, I still get the following error:

cannot import name rst2pdf
In file waliki/pdf/views.py:
from sh import rst2pdf

I have definitely installed rst2pdf, version rst2pdf-0.93.dev-r0 but what is the sh module?

@timolson
Copy link
Author

timolson commented Oct 7, 2015

Disabling the waliki.pdf app avoids the issue, but I'd like to figure out the module dependency.

@RobertoMaurizzi
Copy link

from the name of it, it's trying to import a shell command called rst2pdf. I'd guess that command isn't available (not on path for the user executing Django) so you get an import error. From the docs: http://waliki.readthedocs.org/en/latest/get_as_pdf.html?highlight=rst2pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants