Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error runing osm2gtfs #87

Closed
jaullo opened this issue Nov 1, 2017 · 5 comments
Closed

Error runing osm2gtfs #87

jaullo opened this issue Nov 1, 2017 · 5 comments

Comments

@jaullo
Copy link

jaullo commented Nov 1, 2017

Hello to all!

I´m trying to run osm2gtfs using ubuntu 14 64 bits.

Steps i have made:

  1. Installed Python Version 2.7.6
  2. Installed PIP (apt-get install python-pip)
  3. Clone osm2gtfs git repository to /opt
  4. cd into osm2gtfs folder and run pip install -e . the following message appears

**Obtaining file:///opt/osm2gtfs
Running setup.py (path:/opt/osm2gtfs/setup.py) egg_info for package from file:///opt/osm2gtfs

Downloading/unpacking overpy>=0.4 (from osm2gtfs==0.0.1)
Downloading overpy-0.4.tar.gz (41kB): 41kB downloaded
Running setup.py (path:/tmp/pip_build_root/overpy/setup.py) egg_info for package overpy
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
your setuptools is too old (<12)
setuptools_scm functionality is degraded
zip_safe flag not set; analyzing archive contents...

Installed /tmp/pip_build_root/overpy/pytest_runner-3.0-py2.7.egg

warning: no files found matching 'docs.Makefile'

Downloading/unpacking transitfeed (from osm2gtfs==0.0.1)
Downloading transitfeed-1.2.14.tar.gz (347kB): 347kB downloaded
Running setup.py (path:/tmp/pip_build_root/transitfeed/setup.py) egg_info for package transitfeed

Installing collected packages: overpy, transitfeed, osm2gtfs
Running setup.py install for overpy

warning: no files found matching 'docs.Makefile'

Running setup.py install for transitfeed
changing mode of build/scripts-2.7/feedvalidator.py from 644 to 755
changing mode of build/scripts-2.7/schedule_viewer.py from 644 to 755
changing mode of build/scripts-2.7/kmlparser.py from 644 to 755
changing mode of build/scripts-2.7/kmlwriter.py from 644 to 755
changing mode of build/scripts-2.7/merge.py from 644 to 755
changing mode of build/scripts-2.7/unusual_trip_filter.py from 644 to 755
changing mode of build/scripts-2.7/location_editor.py from 644 to 755
changing mode of build/scripts-2.7/feedvalidator_googletransit.py from 644 to 755
changing mode of build/scripts-2.7/shape_importer.py from 644 to 755

changing mode of /usr/local/bin/feedvalidator.py to 755
changing mode of /usr/local/bin/kmlparser.py to 755
changing mode of /usr/local/bin/schedule_viewer.py to 755
changing mode of /usr/local/bin/location_editor.py to 755
changing mode of /usr/local/bin/shape_importer.py to 755
changing mode of /usr/local/bin/feedvalidator_googletransit.py to 755
changing mode of /usr/local/bin/unusual_trip_filter.py to 755
changing mode of /usr/local/bin/kmlwriter.py to 755
changing mode of /usr/local/bin/merge.py to 755

Running setup.py develop for osm2gtfs

Creating /usr/local/lib/python2.7/dist-packages/osm2gtfs.egg-link (link to .)
Adding osm2gtfs 0.0.1 to easy-install.pth file
Installing osm2gtfs script to /usr/local/bin

Installed /opt/osm2gtfs

Successfully installed overpy transitfeed osm2gtfs
Cleaning up...**

  1. Check if transitfeed is installed
    pip install transitfeed
    Requirement already satisfied (use --upgrade to upgrade): transitfeed in /usr/local/lib/python2.7/dist-packages

  2. Check if overpy is installed
    pip install overpy
    Requirement already satisfied (use --upgrade to upgrade): overpy in /usr/local/lib/python2.7/dist-packages

  3. Finally i run osm2gtfs command
    osm2gtfs --config incofer.json --output testinconfer

But i get an error

Traceback (most recent call last):
File "/usr/local/bin/osm2gtfs", line 9, in
load_entry_point('osm2gtfs==0.0.1', 'console_scripts', 'osm2gtfs')()
File "/opt/osm2gtfs/osm2gtfs/osm2gtfs.py", line 35, in main
config = Configuration(args)
File "/opt/osm2gtfs/osm2gtfs/core/configuration.py", line 32, in init
self._prepare_dates()
File "/opt/osm2gtfs/osm2gtfs/core/configuration.py", line 98, in _prepare_dates
if 'start_date' in config['feed_info']:
KeyError: 'feed_info'

What i doing wrong? Some one knows how to solve it?

Thanks

@grote
Copy link
Owner

grote commented Nov 1, 2017

Sounds like your configuration is missing feed_info

@jaullo
Copy link
Author

jaullo commented Nov 1, 2017

Hi grote thank you. I have reviewed osm2gtfs/creators/incofer/

And... this is what i have

{
"query": {
"bbox": {
"n": "10.0365",
"s": "9.8346",
"e": "-83.8507",
"w": "-84.2418"
},
"tags": {
"route": "train",
"network": "Tren Urbano",
"operator": "Incofer"
}
},
"stops": {
"name_without": "Parada sin nombre",
"name_auto": "yes"
},
"agency": {
"agency_id": "CR-Incofer",
"agency_name": "Incofer",
"agency_url": "http://www.incofer.go.cr",
"agency_timezone": "America/Costa_Rica",
"agency_lang": "ES",
"agency_phone": "506 25425800",
"agency_fare_url": ""
},
"feed_info": {
"publisher_name": "Laboratorio Experimental",
"publisher_url": "http://ic-itcr.ac.cr/~jgutierrez/incofer/",
"version": "0.1",
"start_date" : "20171101",
"end_date": "20171231"
},
"output_file": "/opt/cr-incofer.zip",
"selector": "incofer"
}

Updated the end and start date but same error

@grote
Copy link
Owner

grote commented Nov 5, 2017

If I run the following in the root project directory, everything works just fine:

pip2 install -e .
osm2gtfs -c osm2gtfs/creators/incofer/incofer.json

@jamescr
Copy link
Collaborator

jamescr commented Dec 20, 2017

It is working fine for me too, @jaullo you are still having errors?

@grote
Copy link
Owner

grote commented Jan 24, 2018

No response from poster for some month. Time to close this.

@grote grote closed this as completed Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants