wardi / speedometer

Chart network TX/RX and file download rates on the console
http://excess.org/speedometer/
GNU Lesser General Public License v2.1
215 stars 52 forks source link

NameError: name 'urwid' is not defined in setup.py #2

Closed AdmiralNemo closed 2 years ago

AdmiralNemo commented 11 years ago

If urwid is not yet installed when running setup.py, the following exception is raised:

Traceback (most recent call last):
  File "setup.py", line 25, in <module>
    import speedometer
  File "/home/dustin/src/speedometer/speedometer.py", line 302, in <module>
    class GraphDisplay(urwid.WidgetWrap):
NameError: name 'urwid' is not defined

It is best not to rely on code being functional when setup.py is run. The pkg_resources module from setuptools provides an API for version discovery, which will do what you want in this case. I've made the necessary changes to setup.py and speedometer.py to fix this problem while still avoiding redundant version specifications.

aalemayhu commented 7 years ago

I was seeing the exact the same error when attempting to install ToT on Fedora. Applying this locally makes setup python.py install work as expected. Thanks.

rahul003 commented 6 years ago

@wardi Could you look into merging this tool. This project is really nice and this PR would help make it easier for people to use.

Perhaps we can also package it with pip?