python - 在 Anaconda 安装后运行 pyinstaller 导致 ImportError : no Module named 'pefile'

标签 python anaconda pyinstaller

我根据 Anaconda's website 执行了 conda install -c acellera pyinstaller=3.2.3它看起来安装正确,但如果我尝试通过 cmd 运行它,我会得到以下信息:

C:\Users\Cornelis Dirk Haupt\PycharmProjects\Mesoscale-Brain-Explorer\src>pyinstaller
Traceback (most recent call last):
  File "C:\Anaconda3\Scripts\pyinstaller-script.py", line 9, in <module>
    load_entry_point('PyInstaller==3.3.dev0+g8756735', 'console_scripts', 'pyinstaller')()
  File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 542, in load_entry_point
  File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2569, in load_entry_point
  File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2229, in load
  File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2235, in resolve
  File "C:\Anaconda3\lib\site-packages\PyInstaller\__main__.py", line 21, in <module>
    import PyInstaller.building.build_main
  File "C:\Anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 34, in <module>
    from .api import PYZ, EXE, COLLECT, MERGE
  File "C:\Anaconda3\lib\site-packages\PyInstaller\building\api.py", line 38, in <module>
    from PyInstaller.utils.win32 import winmanifest, icon, versioninfo, winresource
  File "C:\Anaconda3\lib\site-packages\PyInstaller\utils\win32\versioninfo.py", line 17, in <module>
    import pefile
ImportError: No module named 'pefile'

这是怎么回事? Pyinstaller 可以在没有 Anaconda 的情况下与 python 2.7 一起正常工作。但我最近决定跳转到 Anaconda + 3.5。我找不到任何名为 pefile 的模块或如何使用 Anaconda 安装它。不过,我可以使用 pip3 轻松安装 pefile。

最佳答案

可以使用Anaconda的pip安装,进入Anaconda中的Script文件夹执行:

pip.exe install pefile

关于python - 在 Anaconda 安装后运行 pyinstaller 导致 ImportError : no Module named 'pefile' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39728108/

相关文章:

python - SFTP : Copy/Download all files in a folder recursively from remote server

python - 按键分组 tensorflow 数据集,按键分组

python - 创建 numpy 数组的扩展 View

python - 尝试安装 Anaconda 时出现 TypeError

python - 我无法使用pyinstaller将python文件转换为exe

python - 将自定义 .py 文件打包成 .exe

python - PyInstaller 和 PySide,如何包含 imageformats 文件夹?

python - 变量在递归时意外改变?

python - Jupyter Notebook 和 Conda 命令行之间的包不一致

python - 无法将Anaconda base升级到Python 3.8