redtoad / python-progressbar

Automatically exported from code.google.com/p/python-progressbar
Other
0 stars 0 forks source link

Your own examples don't run #35

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. virtualenv .
2. source bin/activate
3. pip install progressbar
4. wget http://python-progressbar.googlecode.com/hg/examples.py
5. python examples.py

What is the expected output? What do you see instead?

The expected output is 19 different examples of progress bars.

The actual output is:

    Traceback (most recent call last):
    File "examples.py", line 7, in <module>
        from progressbar import AnimatedMarker, Bar, BouncingBar, Counter, ETA, \
    ImportError: cannot import name AnimatedMarker

What version of the product are you using? On what operating system?

pip installs version 2.2. The operating system is linux mint (an ubuntu 
derivative).

Please provide any additional information below.

My initial attempts to use this library were as simple as:

    python -c 'import time
    from progressbar import ProgressBar          
    progress = ProgressBar()
    for i in progress(range(80)):
      time.sleep(0.01)'

(based on example 19). This does not work:

    Traceback (most recent call last):
      File "<string>", line 5, in <module>
    TypeError: 'ProgressBar' object is not callable

Original issue reported on code.google.com by ma...@gapps.semantico.com on 25 Feb 2014 at 10:48

GoogleCodeExporter commented 9 years ago
pip installs version 2.2, which does not support that syntax. The syntax is 
only supported with 2.3-dev, which you can install using "pip install -Iv 
https://python-progressbar.googlecode.com/files/progressbar-2.3-dev.tar.gz".

However, even using that, the examples.py errors out on me with a "ImportError: 
cannot import name AdaptiveETA". The basic example you wrote down above works 
with it, though.

Original comment by maxjma...@gmail.com on 24 Nov 2014 at 9:58

GoogleCodeExporter commented 9 years ago
Sorry , still your own example is not working 

GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from progressbar import AnimatedMarker, Bar, BouncingBar, Counter, ETA, 
FileTransferSpeed, FormatLabel, Percentage, ProgressBar, ReverseBar, 
RotatingMarker, SimpleProgress, Timer, AdaptiveETA, AdaptiveTransferSpeed
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name AnimatedMarker

You must have a local dependency, try to run your example outside the install 
directory where you have egg files

Original comment by arad...@gmail.com on 28 Jan 2015 at 10:33