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

Cannot import LabelTimeBoardingsAndRoute #3

Open
leoferres opened this issue Oct 21, 2017 · 3 comments
Open

Cannot import LabelTimeBoardingsAndRoute #3

leoferres opened this issue Oct 21, 2017 · 3 comments

Comments

@leoferres
Copy link

Hi! Thanks for your software.
I was wondering why I cannot import

from gtfspy.routing.node_profile_analyzer_time_and_veh_legs import NodeProfileAnalyzerTimeAndVehLegs

it gives me a

ImportError: cannot import name 'LabelTimeBoardingsAndRoute'

Any idea what I may be doing wrong? The complete traceback is as follows:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-132-606c8e7069fa> in <module>()
      1 from gtfspy.routing.helpers import get_transit_connections
----> 2 from gtfspy.routing.node_profile_analyzer_time_and_veh_legs import NodeProfileAnalyzerTimeAndVehLegs
      3 from gtfspy.routing.multi_objective_pseudo_connection_scan_profiler import MultiObjectivePseudoCSAProfiler

~/anaconda3/envs/gis/lib/python3.6/site-packages/gtfspy/routing/node_profile_analyzer_time_and_veh_legs.py in <module>()
     15 
     16 from gtfspy.routing.fastest_path_analyzer import FastestPathAnalyzer
---> 17 from gtfspy.routing.node_profile_multiobjective import NodeProfileMultiObjective
     18 from gtfspy.routing.label import LabelTimeWithBoardingsCount, compute_pareto_front, LabelTimeSimple
     19 from gtfspy.routing.node_profile_analyzer_time import NodeProfileAnalyzerTime

~/anaconda3/envs/gis/lib/python3.6/site-packages/gtfspy/routing/node_profile_multiobjective.py in <module>()
      1 import numpy
      2 
----> 3 from gtfspy.routing.label import LabelTimeWithBoardingsCount, merge_pareto_frontiers, compute_pareto_front, \
      4     LabelVehLegCount, LabelTime, LabelTimeBoardingsAndRoute, LabelTimeAndRoute
      5 from gtfspy.routing.connection import Connection

ImportError: cannot import name 'LabelTimeBoardingsAndRoute'
@rmkujala
Copy link
Member

Hi and thanks for testing out our code!

I was able to replicate this bug.
For some reason I found that the import failed when using Python 3.6, but succeeded when using Python 3.5.
So if using Python 3.5 is an option for you, that would probably be a quick fix for this.

I have no clear idea why the import does not work with Python 3.6, and unfortunately can not promise when I would have the time to dwell into this problem.

For the time being, I changed the recommended Python version to Python 3.5 in the package README file (in commit a5e1e0b ).

@leoferres
Copy link
Author

Great! Meanwhile, I tried it with py3.5 and it worked fine. Thanks!

@rmkujala
Copy link
Member

Great! Let us know if you encounter further problems or something is unclear, as the package has not yet had that many users.

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

2 participants