简体   繁体   English

pip 给出错误 ModuleNotFoundError: No module named 'enum'

[英]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.

相关问题 pip安装错误:ModuleNotFoundError没有名为“ setuptools”的模块 - pip install error: ModuleNotFoundError No module named 'setuptools' ModuleNotFoundError:spyder 中没有名为“pip”的模块 - ModuleNotFoundError: No module named 'pip' in spyder ModuleNotFoundError:没有名为“rosbag”的模块,带有 pip - ModuleNotFoundError: No module named 'rosbag' with pip python install pip,错误为“ ModuleNotFoundError:没有名为“ _struct”的模块” - python install pip with error “ModuleNotFoundError: No module named '_struct'” Pipenv 错误:ModuleNotFoundError:没有名为“pip._internal”的模块 - Pipenv-Error: ModuleNotFoundError: No module named 'pip._internal' ModuleNotFoundError: No module named 'face_recognition'->pip install dlib 错误 - ModuleNotFoundError: No module named 'face_recognition'->pip install dlib error Python pip 安装失败,出现 ModuleNotFoundError:没有名为“pyexpat”的模块错误 - Python pip Install failing with ModuleNotFoundError: No module named 'pyexpat' error ModuleNotFoundError:没有名为“pip”python3的模块 - ModuleNotFoundError: No module named 'pip' python3 ModuleNotFoundError:没有名为&#39;pip.commands&#39;的模块 - ModuleNotFoundError: No module named 'pip.commands' ModuleNotFoundError: 没有命名模块<modulename> pip安装后 - ModuleNotFoundError: No module named <modulename> after pip install
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM