CxAalto / gtfspy

Public transport network analysis using Python 🚊🚇🚃🚌🛳️🚡🚠🚞
MIT License
157 stars 30 forks source link

Add support for Windows operating systems. #13

Open rmkujala opened 6 years ago

rmkujala commented 6 years ago

Some crucial parts of gtfspy do not work on Windows.

To sort this out, we should

  1. Identify what parts do not work on Windows (at least the way the process timezones is set does not work sometimes?)
  2. Work around these issues when time permits.

Any contributions towards this end are also welcome!

Documenting the progress on this front in this issue. Let us also know (by commenting below), if this issue (library not running on windows) is blocking you from using this library.

In the meanwhile, one workaround could be to work around the problem using VirtualBox or installing Linux next to with Windows.

guidesc commented 6 years ago

Hi Rainer,

Thx for all your efforts to open source this library. I'm on Windows 7 and has an issue when I ran example_export.py file.

The issue is the following: module 'time' has no attribute 'tzset'.

I searched online and it seems like it only supports Unix system.

rkdarst commented 6 years ago

The original reason for the timezone handling was to use the operating system timezone database with the built-in sqlite functions (because unix comes with the full zoneinfo database and can be configured per-process). Windows doesn't have that functionality... so you have to use pytz instead. Since all the sqlite date handling is my fault, I took a look to see what needs to be updated for timezone stuff:

A while ago, I think someone did most of the work needed to make it independent of the OS, so actually is pretty easy.

I see the remaining sqlite functions in these places:

So overall, I think @rmkujala or someone already solved the hardest problems, and these are easier relatively...

Another workaround: Installing Cygwin used to be a good workaround on Windows (basically unix operating system APIs on windows). I think it should emulate the right APIs.

evelyn9191 commented 4 years ago

This issue is blocking me from using this library on Windows. Maybe with another library, such as pytz, the same could be achieved?

jweckstr commented 4 years ago

I'm sorry for the let down but at the moment no one of the gtfspy developers have the time nor the resources to implement these changes. However, we gladly invite anyone to implement the changes themselves and make a pull request.