Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
documentation needed: install pre-requisites on a Windows host using Cygwin #8
OK, here's where I'm up to. I'll build a Scripts/flask-diamond.cmd file next to make the script work on the command line:
Using python 3.5 (from python.org) on Windows 8.1 (it should be the same on W10 though)
(venv) W:\Python\diamond>python venv\Scripts\flask-diamond.py scaffold tutorial-planets
W:\Python\diamond\venv\lib\site-packages\flask\exthook.py:71: ExtDeprecationWarning: Importing flask.ext.sqlalchemy is deprecated, use flask_sqlalchemy instead.
W:\Python\diamond\venv\lib\site-packages\flask\exthook.py:71: ExtDeprecationWarning: Importing flask.ext.script is deprecated, use flask_script instead.
W:\Python\diamond\venv\lib\site-packages\flask\exthook.py:71: ExtDeprecationWarning: Importing
W:\Python\diamond\venv\lib\site-packages\flask\exthook.py:71: ExtDeprecationWarning: Importing flask.ext.babelex is deprecated, use flask_babelex instead.
W:\Python\diamond\venv\lib\site-packages\flask\exthook.py:71: ExtDeprecationWarning: Importing flask.ext.restful is deprecated, use flask_restful instead.
I'm using Python 3.4.4 on Windows 7 at first I got
As julianz pointed out:
is correct. I'll continue to look into this.
I'm having the same trouble with the mr.bob install on Windows 10.
Is there a way this can be done with an alternative to mr.bob? What it's having problems with is this character (at least initially):
I get that it's part of displaying a file structure cleanly, but if that's a big issue in Windows, then there may be a reason to deprecate mr.bob until it's fixed.
EDIT: There's a 0.1.2 version of mr.bob that claims to have fixed the Unicode errors during install, consider updating dependencies?
I had the issue with Mr.Bob on Windows and report the issue at the beginning of January. I have not gotten a response. When I install the library by itself I still get the unicode error as @Sanjurjo7 also notes.
Here is the issue and I am to new to python to know what exactly is going on - domenkozar/mr.bob#84
@StuRyan56 there's a comment from @julianz that explains how to install mr.bob separately when it fails on Windows. I found recently though that flask-diamond still needs a slightly older version and I needed to do
@julianz I've managed to get the point of running the python ~/virt/script/scaffold app (note I didn't add the .py not sure if it matter but it seems to run throwing all the import errors mentioned above. I get the following as an error. Seems to be mr.bob as yet another hurdle.
(Edit) Should probably mention I'm on Windows 10 using Python 3.5.
@iandennismiller I just gave that command a try and ended up with the exact same error. And tracing through to see what it's choking on in the stack trace yielded an unexpected result. I dropped some print statements at the top of find_and_load_unlocked but got no output.
I also pulled down a brand new copy of flask-diamond to make sure everything was as clean as it could be. It seems like it doesn't like the path because the name that is passed into
Alright so I narrowed things down to the configurator.py file line 38
after the rsplit the
Alright finally update for tonight. Seems that the problem stems from the configurator.py file in mr.bob package. The specific function is parse_template on line 69 and the problem point is on line 91.
It seems to assume that if there's a ":" in the path that it's a python type path and tries to resolve it through the dotted path but since Windows paths are usually c:\path to file this short circuits it. I took a page out of @Annakan's book and simply change that function to the following:
This seems to allow the skel template to be applied using the cli interface at least.
Referred to: domenkozar/mr.bob#49
Apparently it's been known since 2013 that this causes problems for Windows.
Hi @yokai117 - thanks for all your investigating on this!
I now have my own Windows 10 machine for experimentation. I am using the following invocation, which looks to me like a good general form for Win10 invocation of the scaffold:
I'm able to reproduce the issue addressed in domenkozar/mr.bob#49 - thanks for tracking that down!
I see what you're saying about
Since the scaffolding command itself that launches mr.bob seems to only handle a fully qualified path the only way to get mrbob to run properly was to tell it to fail if the file path existed at the point that it was making the choice between resolving a dotted path or a file path.
We may not have to go that far if it's possible to provide a relative python style path to the skel file in the scaffold call which would ensure similar functionality on unix and windows.
Just thinking outloud.
PS. just incase I wasn't clear, yes I patched the configurator.py in mr.bob's implementation the same as it was mentioned in that issue I referenced.
Hi @yokai117 - I've implemented a possible solution in the
I'm going to describe my development environment and the steps I took. I would appreciate your help in determining whether you can reproduce these results.
I am using Windows 10,
Using PowerShell, I installed the following python packages as Administrator:
I used cmd.exe for all the remaining steps - no longer as Administrator. I set up a workspace in my home directory called
obtain develop branch of flask-diamond
There are a few steps to get the
build Flask-diamond from source
Make sure you have
Try to scaffold the planets tutorial. Just call the app
I was able to start the planets tutorial server from a new PowerShell window with the following:
Please note the new configuration file called
I am now able to use the mr.bob app skel and it produces a working flask-diamond scaffold. The resulting app actually works on a windows host. However, I have found a few ways this doesn't quite work as expected "out of the box" - particularly the Makefile.
It seems to me like the planets tutorial is now working on a Windows 10 host. Are you able to reproduce this result?
So I didn't use Cygwin which probably caused me more grief than it should have I was able to get it running though with no code changes but I still needed to install mr.bob using the command
Got the correct version installed.
And there was two modifications to the dev-win.conf, the Log path and the SQLite DB path need to be changed. The format for the SQLite on Windows is a little different.
Only need 3 slashes before the drive letter.
Thanks for running it from the develop branch! Thanks for noting the two changes to the install process - specifically pyreadline (which I added to requirements.txt) and mr.bob. I edited my comment above to reflect this, but here's the important update to the install procedure:
build Flask-diamond from source
Based on your notes regarding the DB and LOG config items, I tweaked the template for dev-win, which is located at
The last change I made is to create a Makefile target called
So I've bumped the version to 0.5.2rc2 with commit 24f2418. I think that should address the Windows documentation and compatibility - and we can close this issue soon. I'm going to test this a little more myself, too, but I'm eager to release this so that Windows users can get started!
The documentation isn't fully updated yet, but the develop branch has updated notes regarding Windows:
Now the develop documentation is also visible on readthedocs.