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

Make it work locally with Windows #56

Open
arnfinn opened this issue Jun 5, 2018 · 11 comments
Open

Make it work locally with Windows #56

arnfinn opened this issue Jun 5, 2018 · 11 comments

Comments

@arnfinn
Copy link

arnfinn commented Jun 5, 2018

I do not think it is possible at the moment.

How to test it (if you are on a Windows machine with Python 3.6 using Git Bash)

virtualenv venv
source venv/Scripts/activate # Scripts instead of bin on Windows...
pip install git+https://github.com/bast/cicero.git@master#egg=cicero
git clone git@github.com:arnfinn/presentasjoner.git
cicero --file presentasjoner/utf8.md --debug

Then go to http://127.0.0.1:5000/

@arnfinn
Copy link
Author

arnfinn commented Jun 5, 2018

Error in this line in templates\render.html (see the whole traceback below):

{% include 'engines/' + engine + '/body.html' %}

It has probably something to do with how they do paths on windows.

 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [05/Jun/2018 14:03:05] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "p:\venv\lib\site-packages\flask\app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "p:\venv\lib\site-packages\flask\app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "p:\venv\lib\site-packages\flask\app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "p:\venv\lib\site-packages\flask\_compat.py", line 33, in reraise
    raise value
  File "p:\venv\lib\site-packages\flask\app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "p:\venv\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "p:\venv\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "p:\venv\lib\site-packages\flask\_compat.py", line 33, in reraise
    raise value
  File "p:\venv\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "p:\venv\lib\site-packages\flask\app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "p:\venv\lib\site-packages\cicero\preview.py", line 59, in home
    engine=config['engine'])
  File "p:\venv\lib\site-packages\flask\templating.py", line 128, in render_template
    context, ctx.app)
  File "p:\venv\lib\site-packages\flask\templating.py", line 110, in _render
    rv = template.render(context)
  File "p:\venv\lib\site-packages\jinja2\asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "p:\venv\lib\site-packages\jinja2\environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "p:\venv\lib\site-packages\jinja2\environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "p:\venv\lib\site-packages\jinja2\_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "p:\venv\lib\site-packages\cicero\templates\render.html", line 20, in top-level template code
    {% include 'engines/' + engine + '/body.html' %}
  File "p:\venv\lib\site-packages\flask\templating.py", line 64, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: engines/remark-0.13.0/body.html
127.0.0.1 - - [05/Jun/2018 14:03:05] "GET /?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [05/Jun/2018 14:03:05] "GET /?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [05/Jun/2018 14:03:05] "GET /?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [05/Jun/2018 14:03:05] "GET /?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -
127.0.0.1 - - [05/Jun/2018 14:03:06] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -

@bast
Copy link
Owner

bast commented Jun 5, 2018

I will test it out on Azure - thanks for reporting.

@arnfinn
Copy link
Author

arnfinn commented Jun 5, 2018

We have to play our cards right in this new Windows era 😄

@bast
Copy link
Owner

bast commented Jun 5, 2018

Can you try the following:

  • download this repo as a zip file
  • extract
  • go in, and install requirements.txt into a venv
  • $ python cicero.py --file=...

Does this work? Because at least on Azure it worked then (but I got same error when serving from a clone). And the reason was that Windows did not understand symlinks. But I did not try in Git bash but rather from https://www.msys2.org.

@arnfinn
Copy link
Author

arnfinn commented Jun 5, 2018

I will, tomorrow (only windows @ work).

Thanks for looking at this!

@bast
Copy link
Owner

bast commented Jun 6, 2018

If this works then I need to think what to do about the symlinks. Of course I can get rid of them with some code duplication if needed.

@arnfinn
Copy link
Author

arnfinn commented Jun 6, 2018

I was not able to make it work.

@bast
Copy link
Owner

bast commented Jun 6, 2018

OK I need to test with Git bash then.

@bast
Copy link
Owner

bast commented Jun 6, 2018

Can we perhaps debug this together? Such an incredible struggle for me to get a Git bash going with Python.

@bast
Copy link
Owner

bast commented Jun 6, 2018

Alternative: can you try on https://www.msys2.org?

@arnfinn
Copy link
Author

arnfinn commented Jun 7, 2018

I can try to have a look at it next week. It is not very important for me that it is working on Windows, so please do not struggle for me:)

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

2 participants