我正尝试在笔记本上运行的python3.8中导入wget。我尝试了pip install wget,它显示“需求已经满足: c:\users\mahmu\appdata\local\programs\python\python38\lib\site-packages (3.2)中的wget”,但在尝试导入它时得到以下错误:
if os.name=='nt':
!pip install wget
import wget
输出
Collecting wget
Using cached wget-3.2.zip (10 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Using legacy 'setup.py install' for wget, since package 'wheel' is not installed.
Installing collected packages: wget
Running setup.py install for wget: started
Running setup.py install for wget: finished with status 'done'
Successfully installed wget-3.2
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_10204/1879926059.py in <module>
1 if os.name=='nt':
2 get_ipython().system('pip install wget')
----> 3 import wget
ModuleNotFoundError: No module named 'wget'
发布于 2021-11-21 06:30:38
notebook需要重新启动以导入在notebook运行时安装的模块。因此,请安装模块,然后重新启动notebook
当你在运行时安装一个模块时,你可能会在Jupiter notebook中得到这样的消息:
Note: you may need to restart the kernel to use updated packages.
https://stackoverflow.com/questions/70052154
复制相似问题