python 3.3 import errors
When trying to install from the mercurial tip (changeset 36:3c94a3a1ebe1 from
September 21), I get the following error:
Traceback (most recent call last):
File "setup.py", line 5, in <module>
import progressbar
File "/usr/local/src/python-progressbar/progressbar/__init__.py", line 47, in <module>
from compat import *
ImportError: No module named 'compat'
This is because the imports aren't relative to the current package. Changing
the imports in __init__.py to
from .compat import *
and so on works, as would `from progressbar.compat`.
I also needed to change `import widgets` to `from . import widgets` in
`progressbar.py`. Then everything worked.
Also note that the version in pypi (2.3-dev) still has the `__slots__` problem
that was fixed back in September - it'd be nice to release a new version with
these two problems fixed, so `pip install progressbar` works.
Original issue reported on code.google.com by [email protected] on 17 Dec 2012 at 1:31
I guess I should change it to use explicit relative imports. The only problem
is that would drop support for python 2.4. Not sure if there are people using
the library in python 2.4 yet.
Original comment by [email protected] on 22 Dec 2012 at 9:20
I'd much rather see support for Python 3.3 than 2.4. Perhaps a good compromise
is to increment the version to 3.0 and support Python 3.x, keep 2.x as the
Python 2.x series.
Original comment by [email protected] on 22 Dec 2012 at 9:41
I've tested the change and Python 3.3 seems happy with it:
https://github.com/bradleyayers/python-progressbar/commit/c25e56619ca625344b7101
6c9dd7a7bbd5a67285
Original comment by [email protected] on 22 Dec 2012 at 9:44
Can you please submit the Python 3.3 compatible library to PyPi?
Original comment by [email protected] on 1 Jun 2013 at 6:00
Yes-yes please
Original comment by koukopoulos on 10 Oct 2013 at 9:22
I uploaded to PyPi a version of python-progressbar that should work on Python
3.3. You can get it by running:
pip install progressbar33
Original comment by [email protected] on 29 Aug 2014 at 9:03
I'll just note - as a Python 3.4 user I was surprised to see that `pip install
progressbar` failed with an odd error (which lead me here). I have it working
with `pip install progressbar33`. Looking at the comment about Python 2.4
support - I'll note that Python 2.4's support was withdrawn in 2009, so it has
been unsupported for 6 years now.
Python 2.7 itself is unsupported in 4.5 years time. Python 3.4+ is the future
(and, well, the current for many of us). I'd strongly vote for dropping 2.4
support and letting 3.4 users enjoy this fine library without hunting through
bug reports.
Original comment by [email protected] on 4 Jun 2015 at 9:12
@[email protected]: +1
This fork has python 3 compatibility progressbar33 and works just fine.