UDST / urbanaccess

A tool for GTFS transit and OSM pedestrian network accessibility analysis by UrbanSim
https://udst.github.io/urbanaccess/index.html
GNU Affero General Public License v3.0
236 stars 56 forks source link

Errors on module import #41

Closed Nate-Wessel closed 5 years ago

Nate-Wessel commented 6 years ago

Description of the bug

When importing the module, errors are produced and the module fails to be imported.

Environment

The code that reproduces the issue:

import urbanaccess

The error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "urbanaccess/__init__.py", line 5, in <module>
    from .osm.load import *
  File "urbanaccess/osm/load.py", line 12, in <module>
    reserve_num_graphs(40)
  File "/usr/local/lib/python2.7/dist-packages/pandana/network.py", line 16, in reserve_num_graphs
    raise Exception("reserve_num_graphs is no longer required - remove from your code")
Exception: reserve_num_graphs is no longer required - remove from your code
sablanchard commented 6 years ago

Thanks for the report @Nate-Wessel, I am assuming you have pandana version 0.4.0, correct? If so, this error is generated by pandana 0.4.0 which no longer uses reserve_num_graphs. As such urbanaccess 0.1.0 is only compatible with pandana 0.3.0 mainly due to issues with 0.4.0 builds on different OS platforms which have only recently been resolved. We have compatibility with pandana 0.4.0 on our to do list but it wont get in for some time yet. For the time being I suggest you downgrade pandana to 0.3.0 or comment out that line code in the codebase here: https://github.com/UDST/urbanaccess/blob/master/urbanaccess/osm/load.py#L12. Please let us know if this solves your issue.

Nate-Wessel commented 6 years ago

I did indeed have Pandana 0.4.0. Commenting that line out seems to solve the issue and the module now imports with reporting any errors.

Thanks for the quick reply!!

edmondklai commented 6 years ago

Problem still exists, confirm that urbanaccess works with downgrading pandana to 0.3.0

sablanchard commented 5 years ago

PR #48 updated urbanaccess to v0.2.0 which now supports pandana v0.3.0 and v0.4.1 so this issue should now be addressed. Closing issue for now.