Jump to content

Our forum made possible by displaying online advertisements to our visitors.

Please consider supporting us by disabling your ads blocker.

  • Announcements

    • EmperoR

      Dear Guests   12/24/2016

      Welcome to the GIS-AREA. like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be a part of GIS-AREA by signing in or creating an account here. Once you have created your account and have introduced yourself to our community, you can start new topics, reply to others, subscribe interesting threads, get your customize profiles, make news friends, and others nice stuff. To make your stay as pleasant and constructive as possible, please don't forget to read through our pinned forum rules and board guidelines in each section before you do anything else.
bramot

OpenStreetMap to PostGIS in Windows using Python

Recommended Posts

Hey, 

My quest:
I would like to create my own postgis database using Openstreetmap.

My problem:
None of the OSM/map libraries for python seems to work on windows.

My setup:
- Windows 7
- Python 2.x / 3.x

Anyone here who know how to use any of the libs in windows?

Thanks in advance.

Share this post


Link to post
Share on other sites

Usually Python libs work in Windows, installing them is the problem. Mostly there is somewhat cryptic error saying it cannot find vcvarsall.bat or some other file. However, if you install the prerequisites from the precompiled wheels, you can install the library using pip.

For example, OSMpythonTools has a lot of prerequisites, such as lxml, pandas, matplotlib, ujson. Now just typing in "pip install osmpythontools" gives an error like this:

"

  Running setup.py install for ujson ... error
    Complete output from command C:\Python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Tanel\\AppData\\Local\\Temp\\pip-build-hrf5z5wi\\ujson\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Test\AppData\Local\Temp\pip-tva4s83x-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'ujson' extension
    error: Unable to find vcvarsall.bat


"

So the solution is to download the precompiled wheel from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/

And install the wheel "pip install C:\tmp\ujson-1.35-cp34-cp34m-win_amd64.whl".

Then retry installing and if there is error with any packages, install corresponding wheels.

Edited by jorrarro

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×

Important Information

By using this site, you agree to our Terms of Use.