我运行了代码pip install progressbar,它成功运行,但是当我尝试在SPYDER IDE中使用它时,它无法正常工作,并且没有提供名为“ progressbar”的模块。请帮助
这是我在cmd中与输出一起运行的
C:\WINDOWS\system32>pip install progressbar
Collecting progressbar
Using cached https://files.pythonhosted.org/packages/a3/a6/b8e451f6cff1c99b4747a2f7235aa904d2d49e8e1464e0b798272aa84358/progressbar-2.5.tar.gz
Building wheels for collected packages: progressbar
Building wheel for progressbar (setup.py) ... done
Stored in directory: C:\Users\arish\AppData\Local\pip\Cache\wheels\c0\e9\6b\ea01090205e285175842339aa3b491adeb4015206cda272ff0
Successfully built progressbar
Installing collected packages: progressbar
Successfully installed progressbar-2.5
这是我在spyder中运行的代码:
from progressbar import ProgressBar
pbar = ProgressBar()
for x in pbar(50):
print(x)
这是我得到的错误
runfile('C:/Users/arish/trialprogbar.py', wdir='C:/Users/arish')
Traceback (most recent call last):
File "<ipython-input-3-3c2e1e78ee9d>", line 1, in <module>
runfile('C:/Users/arish/trialprogbar.py', wdir='C:/Users/arish')
File "C:\Users\arish\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile
execfile(filename, namespace)
File "C:\Users\arish\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/arish/trialprogbar.py", line 1, in <module>
from progressbar import ProgressBar
ModuleNotFoundError: No module named 'progressbar'