NiltonVolpato / python-progressbar

Text progress bar library for Python
Other
412 stars 105 forks source link

Cannot install with pip #42

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
pip3 install progressbar

Collecting progressbar
  Using cached progressbar-2.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/private/var/folders/w_/6ddpl57d1hx5m1m_nbhwd3qw0000gn/T/pip-build-3lzw6hbv/progressbar/setup.py", line 5, in <module>
        import progressbar
      File "/private/var/folders/w_/6ddpl57d1hx5m1m_nbhwd3qw0000gn/T/pip-build-3lzw6hbv/progressbar/progressbar/__init__.py", line 59, in <module>
        from progressbar.widgets import *
      File "/private/var/folders/w_/6ddpl57d1hx5m1m_nbhwd3qw0000gn/T/pip-build-3lzw6hbv/progressbar/progressbar/widgets.py", line 121, in <module>
        class FileTransferSpeed(Widget):
      File "/Users/mortenb/Downloads/test/env/bin/../lib/python3.4/abc.py", line 133, in __new__
        cls = super().__new__(mcls, name, bases, namespace)
    ValueError: 'format' in __slots__ conflicts with class variable

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/w_/6ddpl57d1hx5m1m_nbhwd3qw0000gn/T/pip-build-3lzw6hbv/progressbar

Original issue reported on code.google.com by mort...@gmail.com on 11 Apr 2015 at 11:16

GoogleCodeExporter commented 8 years ago
This is a straight up Python 3 bug: 
https://docs.python.org/3/reference/datamodel.html?highlight=__slots__#object.__
slots__

"__slots__ are implemented at the class level by creating descriptors 
(Implementing Descriptors) for each variable name. As a result, class 
attributes cannot be used to set default values for instance variables defined 
by __slots__; otherwise, the class attribute would overwrite the descriptor 
assignment."

The fix should be easy; assign default values in the __init__() instead of 
class variable.

Original comment by war...@gmail.com on 1 Jun 2015 at 10:30

GoogleCodeExporter commented 8 years ago
Looks like this is already fixed in their upstream, but not yet released.

Original comment by war...@gmail.com on 1 Jun 2015 at 10:34

GoogleCodeExporter commented 8 years ago
Yes, it was fixed on 
https://code.google.com/p/python-progressbar/source/detail?spec=svn235f632a9c86d
7a84c607151d5127652102549ab&r=3c94a3a1ebe1325c7c605cc8f11126dcc632b04d

I thought this was included in the 2.3 release. I'll probably have to do 
another release, then

Original comment by nilton.v...@gmail.com on 2 Jun 2015 at 12:21

avengerpenguin commented 8 years ago

Has this fix been released yet?

berlotto commented 8 years ago

@avengerpenguin not yet

yarikoptic commented 8 years ago

not released by I believe fixed in master in regard of compatibility with recent python3s

$> virtualenv --python=python3 venv           
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /tmp/venv/bin/python3
Not overwriting existing python script /tmp/venv/bin/python (you must use /tmp/venv/bin/python3)
Installing setuptools, pkg_resources, pip, wheel...source done.
2 11107.....................................:Wed 25 May 2016 11:35:29 PM EDT:.
hopa:/tmp
$> source venv/bin/activate
(venv) 2 11108.....................................:Wed 25 May 2016 11:35:35 PM EDT:.
hopa:/tmp
$> pip install https://github.com/datalad/python-progressbar/archive/master.zip
Collecting https://github.com/datalad/python-progressbar/archive/master.zip
  Downloading https://github.com/datalad/python-progressbar/archive/master.zip
     \ 20kB 1.1MB/s
Installing collected packages: progressbar
  Running setup.py install for progressbar ... done
Successfully installed progressbar-2.3
(venv) 2 11109.....................................:Wed 25 May 2016 11:35:47 PM EDT:.
hopa:/tmp
$> which python
/tmp/venv/bin/python
(venv) 2 11110.....................................:Wed 25 May 2016 11:35:54 PM EDT:.
hopa:/tmp
$> python --version
Python 3.5.1+
(venv) 2 11111.....................................:Wed 25 May 2016 11:35:57 PM EDT:.
hopa:/tmp
$> pip --version
pip 8.1.2 from /tmp/venv/local/lib/python3.5/site-packages (python 3.5)
fenchu commented 6 years ago

Please Gentlemen, Hit this bug today 1.5 year later. Still not released. Master works. python3 is taking over the world. Thanks

yarikoptic commented 6 years ago

I just switched to tqdm

MiX1964 commented 6 years ago

I don't know if still relevant but I experienced the same issue while trying to pip install progressbar. Found a fix in https://github.com/niltonvolpato/python-progressbar/issues/54 pip3 install progressbar33 worked for me