wikimapper
wikimapper copied to clipboard
Avoiding Overflow Error when Building Index on Windows
Thank you for this great library, I have found it very useful!
If I run the build index command as specified in the README on Windows using the library binaries, I encounter the following error:
OverflowError: Python int too large to convert to C long
Here are steps I took to run the program on Windows:
- Clone the repository locally
- In cli.py, add this code so it can be run as a standalone Python program:
if __name__ == "__main__":
main()
- In cli.py, change the import to use the local version of processor.py:
from wikimapper import download_wikidumps, WikiMapper
from processor import create_index
- In processor.py, comment out line 117:
#csv.field_size_limit(sys.maxsize)
Then you can run the code locally in this way:
cli.py create enwiki-latest --dumpdir data --target data/index_enwiki-latest.db
Hope it helps someone!
Thanks for the issue report! I fixed it and added tests for Windows. I also released 0.1.6 which contains the fix. Please close the bug if that resolves the issue.