0
点赞
收藏
分享

微信扫一扫

8-1|pyinstaller打包报错 with open(path, 'rb') as stream: FileNotFoundError: [Errno 2] No such file o

pyinstaller打包报错 with open(path, 'rb') as stream: FileNotFoundError: [Errno 2] No such file or directory: 'd:\\python3.6.8\\lib\\site-packages\\prettytable-3.8.0-py3.6.egg\\EGG-INFO\\top_level.txt' 中文回答我

看起来你在使用 PyInstaller 打包你的 Python 程序时遇到了问题。出现这个错误可能是因为 PyInstaller 在尝试读取 `prettytable` 库的元信息时找不到 `top_level.txt` 文件。这可能是由于你的环境中 `prettytable` 库的安装问题。


以下是一些可能的解决方案:


1. **重新安装 `prettytable` 库**:可能的一个解决方案是重新安装 `prettytable`。你可以使用以下命令来卸载并重新安装 `prettytable`:


  ```bash

  pip uninstall prettytable

  pip install prettytable

  ```


  请确保你在与打包程序相同的环境(例如,相同的虚拟环境)中进行这些操作。


2. **检查 `prettytable` 库的安装路径**:确保 `prettytable` 库已经被安装在正确的路径下。你可以在 Python 中导入 `prettytable` 并打印其文件路径来检查:


  ```python

  import prettytable

  print(prettytable.__file__)

  ```


  确保这个路径和错误消息中的路径匹配。


3. **更新 PyInstaller**:你可能正在使用的 PyInstaller 的版本与 `prettytable` 库不兼容。尝试更新 PyInstaller 到最新版本可能有助于解决问题:


  ```bash

  pip install --upgrade pyinstaller

  ```


举报

相关推荐

0 条评论