已解决WARNING: Ignoring invalid distribution xxx

Posted 未名编程

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了已解决WARNING: Ignoring invalid distribution xxx相关的知识,希望对你有一定的参考价值。

问题

WARNING: Ignoring invalid distribution -umpy (c:\\users\\xxx\\appdata\\roaming\\python\\python36\\site-packages)

解决方案

在报错的路径下(c:\\users\\xxx\\appdata\\roaming\\python\\python36\\site-packages),找到~对应文件夹,此处报错WARNING: Ignoring invalid distribution -umpy,故删除如下文件夹,其他亦然

解释

This message appears to be related to a problem with a Python package installation. It seems to be indicating that there is an invalid distribution package named “umpy” located in the specified file path, and it is being ignored.

This warning message can occur when there is a problem with the package, such as a missing dependency or a conflict with other packages. It could also occur if the package is not compatible with the version of Python being used.

You can try to install the package again, and make sure you have the correct version of python and all dependencies. You can also check if you have another package with similar name and it is conflicting with this package.
If the issue persists please check the package documentation or reach out to the package maintainers for assistance.
此消息似乎与 Python 包安装问题有关。它似乎表明在指定的文件路径中存在一个名为“umpy”的无效分发包,并且它被忽略了。

当包出现问题(例如缺少依赖项或与其他包冲突)时,可能会出现此警告消息。如果包与正在使用的 Python 版本不兼容,也可能发生这种情况。

您可以尝试再次安装该软件包,并确保您拥有正确版本的 python 和所有依赖项。您还可以检查是否有另一个具有相似名称的包,并且它与此包冲突。
如果问题仍然存在,请查看软件包文档或联系软件包维护者寻求帮助。

warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-resu

这个是C语言当中常见的错误,意思是

     对于输入的scanf参数的内容,没有进行类型判断,所以才会产生这个问题.

解决方法:

     1、添加if判断方式

技术图片
1 if(scanf("%d",&a)==1){
2     // 成功继续执行其他代码
3  }
View Code

    2、其它类型判断方式扩展

技术图片
 1 if(scanf("%d",&a)==1){
 2     // 成功继续执行其他代码
 3 }
 4 
 5 if(scanf("%f",&a)==1){
 6     // 成功继续执行其他代码
 7 }
 8 
 9 if(scanf("%s",&a)==1){
10     // 成功继续执行其他代码
11 }
View Code

    3、参数个数扩展

技术图片
1 scanf("%d",&a);正确输入则返回1;
2 scanf("%d%d",&a,&b);正确输入,则返回2,以此类推;
View Code

即:如果输入一个参数,就判断结果是否==1,如果输入两个参数就判断是否==2,如果输入三个参数就判断==3,以此类推

技术图片
1 if(scanf(“%d %d",&a,&b)==2){
2    // 功能代码
3 }
4 
5 if(scanf(“%d %d %d",&a,&b,&c)==3){
6    // 功能代码
7 }
View Code

 

以上是关于已解决WARNING: Ignoring invalid distribution xxx的主要内容,如果未能解决你的问题,请参考以下文章

android studio解决warning: Ignoring InnerClasses attribute for an anonymous inner class

Android Studio 之 warning: Ignoring InnerClasses attribute for an anonymous inner class

BugList 丨 Error:warning: Ignoring InnerClasses attribute for an anonymous inner class

[WARNING]: Could not match supplied host pattern, ignoring: servers

warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-resu

warning: ignoring option PermSize=256m; support was removed in 8.0