吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2926|回复: 13
收起左侧

[Python 转载] 运行简单程序,为什么出现这个错误

[复制链接]
zcwch 发表于 2020-12-18 21:10

import pandas as pd

df = pd.DataFrame(pd.read_excel('E:/lc/1.xlsx'))


错误
C:\Users\wang\PycharmProjects\pythonProject2\venv\Scripts\python.exe C:/Users/wang/PycharmProjects/pythonProject2/1.py
Traceback (most recent call last):
  File "C:/Users/wang/PycharmProjects/pythonProject2/1.py", line 2, in <module>
    import pandas as pd
  File "C:\Users\wang\PycharmProjects\pythonProject2\venv\lib\site-packages\pandas\__init__.py", line 11, in <module>
    __import__(dependency)
  File "C:\Users\wang\PycharmProjects\pythonProject2\venv\lib\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Users\wang\PycharmProjects\pythonProject2\venv\lib\site-packages\numpy\__init__.py", line 302, in _win_os_check
    raise RuntimeError(msg.format(__file__)) from None
RuntimeError: The current Numpy installation ('C:\\Users\\wang\\PycharmProjects\\pythonProject2\\venv\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https://tinyurl.com/y3dm3h86

Process finished with exit code 1

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| zcwch 发表于 2020-12-18 21:23
ciker_li 发表于 2020-12-18 21:17
貌似是Numpy版本有问题,重装一下,或者升级试试

Microsoft Windows [版本 10.0.19041.264]
(c) 2020 Microsoft Corporation. 保留所有权利。

C:\Users\wang>pip install Numpy
Requirement already satisfied: Numpy in c:\users\wang\appdata\local\programs\python\python38\lib\site-packages (1.19.4)

C:\Users\wang>
6f7a8d 发表于 2020-12-18 21:46
zcwch 发表于 2020-12-18 21:23
Microsoft Windows [版本 10.0.19041.264]
(c) 2020 Microsoft Corporation. 保留所有权利。

重装是不行的,要把Numpy退回到上一个版本
[Shell] 纯文本查看 复制代码
pip install numpy==1.19.3
ciker_li 发表于 2020-12-18 21:17
貌似是Numpy版本有问题,重装一下,或者升级试试
 楼主| zcwch 发表于 2020-12-18 21:22
如何升级
Appla 发表于 2020-12-18 22:50
the temporary solution is to use numpy 1.19.3.

pip install numpy==1.19.3
From this Microsoft thread fix will be available around January 2021.

你用的pycharm内的venv,在pycharm里调整下numpy的版本到 1.19.3
啊清 发表于 2020-12-19 01:30
厉害&#128516;
 楼主| zcwch 发表于 2020-12-19 08:37
Appla 发表于 2020-12-18 22:50
你用的pycharm内的venv,在pycharm里调整下numpy的版本到 1.19.3

重新安装了,也不行,怎么解决?
lcxxhp 发表于 2020-12-19 13:56
import pandas as pd

df = pd.DataFrame(pd.read_excel('E://lc//1.xlsx'))
lvcaolhx 发表于 2020-12-19 17:18
在PyCharm中,在File – Setting – Project(就是当前的Project)中,修改Python Interpreter,点击+号,搜索numpy,但是注意这里的版本不要太高
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-25 21:32

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表