Python安装progressbar遇到的问题及解决

本文介绍了在使用Anaconda或pip安装progressbar遇到与Python版本冲突的问题及其解决方案。由于原progressbar不支持Python 3.5,建议安装progressbar2以适配更高版本的Python。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

progressbar可以显示程序运行的进度,我主要用在jupyter notebook里。

在用Anaconda安装progressbar的时候,出现了这样的错误,提示progressbar是Python2.6使用的,Python3.5装不了。

UnsatisfiableError: The following specifications were found to be in conflict:
  - progressbar -> python 2.6*
  - python 3.5*
Use "conda info <package>" to see the dependencies for each package.

pip install progressbar则出现这样的错误:

Collecting progressbar
  Using cached https://files.pythonhosted.org/packages/0f/e1/f30b72ecabba259c7c38dd0eb944a173effced3fd7de2c9c2902bd6f649a/progressbar-2.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-build-i8m36ug8\progressbar\setup.py", line 5, in <module>
        import progressbar
      File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-build-i8m36ug8\progressbar\progressbar\__init__.py", line 59, in <module>
        from progressbar.widgets import *
      File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-build-i8m36ug8\progressbar\progressbar\widgets.py", line 121, in <module>
        class FileTransferSpeed(Widget):
      File "C:\Program Files\Anaconda3\lib\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 C:\Users\ADMINI~1\AppData\Local\Temp\pip-build-i8m36ug8\progressbar\

解决方法

pip install progressbar2
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值