[英]pip giving error ModuleNotFoundError: No module named 'enum'
Running python 3.7.7 on Windows 7 x64.在 Windows 7 x64 上运行 python 3.7.7。 I've just upgraded from python 2.7 and I'm trying to install the module
emcee
using pip install emcee
.我刚刚从Python 2.7版升级,我试图安装模块
emcee
使用pip install emcee
。 Pip threw the error ModuleNotFoundError: No module named 'enum'
. Pip 抛出错误
ModuleNotFoundError: No module named 'enum'
。 I've also tried installing modules matplotlib, enum34, and numpy, but all threw the same error.我还尝试安装模块 matplotlib、enum34 和 numpy,但都抛出了相同的错误。 I've also tried to upgrade pip with
pip install --upgrade pip
, which again threw the same error.我还尝试使用
pip install --upgrade pip
升级 pip,这再次引发了相同的错误。 I've looked into my \\python37\\lib
folder, and enum.py
is present right where it's supposed to be, but it's still not working.我查看了我的
\\python37\\lib
文件夹,并且enum.py
就在它应该在的位置,但它仍然无法正常工作。
Please help.请帮忙。
Could you please confirm that you have python installed ie it's upgraded and in existence.您能否确认您已安装 python,即它已升级并存在。 You can do this by typing python in the cmd or terminal window.
您可以通过在 cmd 或终端窗口中键入 python 来执行此操作。 This should push you into a python shell.
这应该会将您推入 python shell。 If it does not do so.
如果不这样做。 Trying reinstalling python.
尝试重新安装python。 May be the upgrade did not work so well.
可能是升级没有那么好。
enum
is part of the standard library for Python 3.7, and you've confirmed that it's there. enum
是 Python 3.7 标准库的一部分,您已经确认它在那里。 Therefore the error raises the suspicion that, when you're launching pip
, it might be getting executed by a Python distribution/installation other than the one you think it is.因此,该错误令人怀疑,当您启动
pip
,它可能会被 Python 发行版/安装执行,而不是您认为的那个发行版/安装。 One way to make sure it's working on the correct distro is to say:确保它在正确的发行版上工作的一种方法是说:
C:\WHATEVER\PATH\TO\python.exe -m pip install emcee
This is more precise than just typing pip
at the command-line, because in the latter case you just have to hope/assume that the first pip
Windows finds on its %Path%
will be the correct one.这比仅在命令行输入
pip
更精确,因为在后一种情况下,您只需要希望/假设 Windows 在其%Path%
上找到的第一个pip
将是正确的。 That's not always the case.情况并非总是如此。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.