我正在尝试使用 Pyinstaller 打包我的 Python 脚本。我的脚本导入了第三方模块 Exscript 和 Netaddr。当我尝试运行 Pyinstaller 生成的可执行文件时,出现以下错误。
我知道“pkg_resources”指的是 setuptools,但是我检查了并且我在 site-packages 下有 setuptools 18.2,我看到在脚本目录中很容易安装。我正在运行 Python 2.7。
任何有关让 Pyinstaller 工作的帮助表示赞赏。仅供参考,我确实在这里搜索并查看了类似的问题,但它们不适用于这个特定问题。
这是运行 Pyinstaller 的输出(我只包含错误):
C:\Python27\Lib\PyInstaller-2.1>pyinstaller c:\users\<username>\pycharmprojects\neworking2\network_login.py
5759 INFO: building because out00-Tree.toc missing or bad
5983 INFO: building because out01-Tree.toc missing or bad
7097 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing
9569 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing
9591 INFO: rebuilding out00-EXE.toc because network_login.exe missing
Run Code Online (Sandbox Code Playgroud)
执行 Pyinstaller 生成的 .exe 的输出:
C:\Python27\Lib\PyInstaller-2.1\network_login\dist\network_login>network_loginTraceback (most recent call last):
File "build\bdist.win32\egg\paramiko\__init__.py", line 30, in …
Run Code Online (Sandbox Code Playgroud)