New issue 173: Tweak to work with Windows 10 + VisualStudio 2015 + Python 3.6
https://bitbucket.org/blais/beancount/issues/173/tweak-to-work-with-windows-10-visualstudio
rayalan:
So it turns out that it's fairly trivial to get a working install with
Python3.6 + Visual Studio 2015 on Windows 10 (and I presume other
configurations).
(The long story is that I've been looking for something like beancounter, but
would like decent Windows support and didn't want to deal with cygwin etc. So I
said "How hard can this be to ignore all the instructions for how to do a
Windows build and do it the Python way?" It turns out that it isn't too hard.)
1. Download the source code.
2. Modify `parser/lexer.c` and `parser/lexer.h` to optionally include unistd.h,
which isn't available under VS2015. e.g.
```
#ifndef _WIN32
#include <unistd.h>
#endif
```
3. Modify setup.py to define the source hash macro differently. Both these
options work, but the second is likely more cross-platform friendly.
```
define_macros=[('PARSER_SOURCE_HASH',
'\\"{}\\"'.format(hash_parser_source_files()))]),
define_macros=[('PARSER_SOURCE_HASH',
'"h{}"'.format(hash_parser_source_files()))]),
```
(The root issue here is Visual Studio strips out the quotes, and so it
interprets the hash as a number, and then gets angry when the number isn't a
valid number. So one can either escape the quotes, or simply ensure that the
hash starts with a letter -- like 'h'.
4. Install: ```python setup.py install```
5. profit.
--
You received this message because you are subscribed to the Google Groups
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beancount/20170706002354.14997.55273%40celery-worker-105.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.