使用pyinstaller打包py文件为exe时,如果出现下面问题

File "c:\xxx\anaconda3\lib\site-packages\PyInstaller\hooks\hook-gevent.py", line 25, in <module>
datas += copy_metadata('gevent', recursive=True)
File "c:\xxx\anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 940, in copy_metadata
dest = _copy_metadata_dest(dist.egg_info, dist.project_name)
File "c:\xxx\anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 975, in _copy_metadata_dest
f"No metadata path found for distribution '{project_name}'.")
RuntimeError: No metadata path found for distribution 'greenlet'.

可以使用如下方法解决

pip  install --ignore-installed greenlet

据说也可以使用下面方法(方法二)解决,该方法,博主未测试过,不知道是否可用,放在主要为了回头有机会在测试一下。

遇到这种问题直接卸载原来的重装但是这个重装会ERROR: Cannot uninstall ‘greenlet’. It is a distutils installed
project and thus we cannot accurately determine which files belong to
it which would lead to only a partial uninstall.然后你可以根据重装的地址找到这个文件的地方删除就好了。

参考
https://chowdera.com/2021/08/20210814032437206L.html

[pyinstaller] “RuntimeError: No metadata path found for distribution ‘greenlet‘相关推荐

  1. pyinstaller打包前后os.path.abspath(__file__)和os.path.realpath(sys.executable)的区别

    在pycharm中运行和生成exe之后os.path.dirname(__file__)返回的位置不一样. 使用pycharm和直接点击运行py文件,这个路径均为脚本的所在路径, 运行pyinstal ...

  2. python打包工具报错_Python打包发布神器—Pyinstaller

    一前言 在windows平台学习python的过程中,你肯定会遇到需要把.py脚本打包成.exe的情形,如此,至少有两方面的好处:第一,你的代码保密性更好,其他人不能直接看到python代码:第二,打 ...

  3. python中os.path.isfile函数

    os.path.isfile():判断某一对象(需提供绝对路径)是否为文件 os.path.isdir():判断某一对象(需提供绝对路径)是否为目录 在学习word2vec中看到这段程序 if os. ...

  4. pyinstaller打包技巧

    简介 当我们使用Python开发好程序需要打包成exe时,主流的做法便是使用pyinstaller,这玩意,看似简单,其实挺麻烦的,坑比较多,特别是涉及到比较复杂的库时,另外一个麻烦的事情是,打包失败 ...

  5. python用另一个字段替代本字段的null_Python中的数据库

    数据库和Python 持久化存储 在任何应用中,都需要持久化存储,一般有三种基础的存储机制,文件,数据库系统,以及一些混合类型,一种是使用普通文件或者python特定文件进行访问,另一种是使用数据库管 ...

  6. Python与数据库

    数据库和Python 持久化存储 在任何应用中,都需要持久化存储,一般有三种基础的存储机制,文件,数据库系统,以及一些混合类型,一种是使用普通文件或者python特定文件进行访问,另一种是使用数据库管 ...

  7. pytorch读取常用数据集dataset实现例子

    MNIST示例 定义 class MNIST(VisionDataset):"""`MNIST <http://yann.lecun.com/exdb/mnist/ ...

  8. Cuda: Handle Conflicting Installation Methods

    彻底卸载 cuda:https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#handle-uninstallatio ...

  9. CIFAR10数据集

    目录 一.CIFAR10数据集简介: 二.CIRAR10数据集格式 三.CIFAR10数据集下载与读取 1.下载: 2.读取 四.class:torchvision.datasets.CIFAR10 ...

最新文章

  1. MySQL 如何优化 CPU 消耗?
  2. StringUtil中常用的方法
  3. Error creating bean with name ‘org.springframework.security.oauth2.config.annotation.web.configurati
  4. Gateway网关-全局过滤器
  5. leetcode 496, 503, 556. Next Greater Element I, II, III | 496, 503, 556. 下一个更大元素 I,II,III(单调栈)
  6. javascript写入_如何在JavaScript中写入HTML元素?
  7. LeetCode547. Friends Circles 利用union find | bfs | dfs三种方法解决
  8. [BZOJ4484][JSOI2015]最小表示(拓扑排序+bitset)
  9. AndroidDeveloper Weekly No.5
  10. Ubuntu16.04 jsoncpp 的安装
  11. C# 单例模式(转)
  12. 基于数码相机拍照图像分析的植被覆盖率(FVC)计算软件
  13. Greenplum单机版部署
  14. 基于JMP的独立样本t检验、配对t检验、单样本t检验
  15. Pytorch安装找不到指定的模块\torch\lib\asmjit.dll
  16. 山东理工大学ACM平台题答案 数列有序! 1244
  17. js正则表达式 part1 - Kaiqisan
  18. [leetcode] Ugly Number II
  19. 《GPU高性能编程》——gl_helper.h
  20. python 实践--新闻聚合

热门文章

  1. java.net.SocketException四大异常解决方案
  2. ORA-00907: 缺失右括号问题整理解决
  3. 虚拟机安装linux系统无法上网的解决方法
  4. 解决mysql中limit和in不能同时使用的问题
  5. 【记录】解决uni-app 用nginx反向代理出现Invalid Host header问题
  6. SpringBoot集成Quartz(解决@Autowired空指针Null问题即依赖注入的属性为null)
  7. 基于FastJson的通用泛型解决方案
  8. 如何在Node JS中卸载NPM模块?
  9. python3与python2的编码问题
  10. 针对还没搞懂javascript中this关键字的同学