码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 我遇到的报错合集(更新中)


    报错列表

    • Script file` 'E:\Download\Anaconda3\Scripts\pip-script.py' is not present.`
    • ImportError: `Something is wrong with the numpy installation. While importing we detected an older version of numpy in ['E:\\Download\\Anaconda3\\lib\\site-packages\\numpy']. One method of fixing this is to repeatedly uninstall numpy until none is found, then reinstall this version.`
    • ImportError: `Matplotlib requires numpy>=1.17; you have 1.16.1`
    • ZeroDivisionError: `float division by zero`
    • ValueError: `You are trying to merge on object and int64 columns. If you wish to proceed you should use pd.concat`
    • ValueError: `operands could not be broadcast together with shapes (82,) (82,2)`
    • TypeError:`Object of type 'int32/int64/ndarray' is not JSON serializable`

    Script file 'E:\Download\Anaconda3\Scripts\pip-script.py' is not present.

    报错原因:卸载了pip后如何安装pip【更新pip时发生】

    参考链接: https://blog.csdn.net/weixin_46088071/article/details/107656035
    没有pip怎么用pip安装pip?
    没有pip也能安装pip,如下:

    (base)  C:\Users\admin>pip install pip
    Cannot open E:\Anaconda3\Scripts\pip-script.py
    
    (base)  C:\Users\admin>E:
    
    (base)  E:>
    
    (base)  E:>cd E:\Anaconda3\Scripts 
    
    (base) E:\Anaconda3\Scripts>
    
    (base) E:\Anaconda3\Scripts>easy_install pip
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    ImportError: Something is wrong with the numpy installation. While importing we detected an older version of numpy in ['E:\\Download\\Anaconda3\\lib\\site-packages\\numpy']. One method of fixing this is to repeatedly uninstall numpy until none is found, then reinstall this version.

    报错原因:numpy版本冲突

    先卸载numpy: pip uninstall numpy
    再卸载numpy,直到卸载到提示信息显示,此时完全已经没有numpy了为止。
    在安装所需版本的numpy:

    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy==1.16.1
    
    • 1

    ImportError: Matplotlib requires numpy>=1.17; you have 1.16.1

    报错原因:numpy版本不对
    卸载numpy:pip uninstall numpy
    重新安装需要的版本:

    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy==1.18.2
    
    • 1

    ZeroDivisionError: float division by zero

    报错原因:除数为0
    数据处理: data = data.fillna(method=‘ffill’)

    ValueError: You are trying to merge on object and int64 columns. If you wish to proceed you should use pd.concat

    报错原因: merge的第一个参数是字符串类型,转化成int
    例如:df1[‘a’] = df1[‘a’].astype(int)
    将合并关键字转化格式就行,对整个表转格式会出现第二个报错。
    TypeError: int() argument must be a string, a bytes-like object or a number, not ‘NoneType’

    ValueError: operands could not be broadcast together with shapes (82,) (82,2)

    报错原因:数据格式不对
    函数可调用的数据是(82,1),传入数据是(82,2)
    检查数据是否有重合项。

    TypeError:Object of type 'int32/int64/ndarray' is not JSON serializable

    报错原因:json不认numpy的array
    参考链接: https://blog.csdn.net/qq_29592829/article/details/100162574
    使用tolist()方法将array转换成list

  • 相关阅读:
    AlexNet 06
    【ArcGIS】11 河道断面提取
    数据库 MySql快速导入外部数据库流程
    计算机网络——TCP/IP网络层次模型
    【毕业设计】图像识别垃圾分类系统 - python 深度学习
    解决nexus3登录x509: certificate has expired or is not yet valid
    计算机CV方向-顶级会议和期刊
    阿里云和腾讯云2核2G服务器价格和性能对比
    SQLite3 数据库学习(文章链接汇总)
    u盘分区了怎么合并?u盘分区了怎么恢复教程
  • 原文地址:https://blog.csdn.net/qq_47326711/article/details/126145240
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号