ImportError with toposort.
Closed this issue · 1 comments
Just install bowerstatic into a venv and I got the following ImportError:
ImportError: No module named 'toposort'
I believe that if it is a dependency it would be best if it were installed automatically, unless there is some other reason not too. Either way, the next thing to do was to install 'toposort' with pip, but I still get an ImportError.
from toposort import topological_sort
ImportError: cannot import name 'topological_sort'
Looking at the current version of toposort, the only functions it has is toposort and toposort_flatten. Changed the import to
from toposort import toposort as topological_sort
and everything worked.
I'm not sure if you would like to depend on a specific version of toposort or to use the current.
Thanks for your time
You found a bug!
The published toposort package is actually not what I'm using; I include my own implementation in bowerstatic. I'm surprised the public implementation even works at all! :)
The code was not importing toposort (which is included) correctly relatively to the package and instead trying to do an absolute import, which in some circumstances leads to an error, like when there's a 'toposort' package installed. I've fixed this now in git.