python ImportError: C extension: DLL load failed while importing strptime的解决办法

程序一直用得好好的,再新建一个PY,显示如下错误:

import pandas as pd #导入panads
File “C:\Users\lenovo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas_init_.py”, line 35, in
raise ImportError(
ImportError: C extension: DLL load failed while importing strptime: 拒绝访问。 not built. If you want to import pandas from the source directory, you may need to run ‘python setup.py build_ext --inplace --force’ to build the C extensions first.

提示未导入的pandas 错误,因为已经安装还运行正常,不明就理
解决办法,重新卸载,
pip uninstall pandas
再安装
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas

提示:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: ‘c:\users\lenovo\appdata\local\programs\python\python38-32\Lib\site-packages\pandas\_libs\tslibs\strptime.cp38-win32.pyd’
Consider using the --user option or check the permissions.

再安装
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas --user
成功!

不知道pandas库什么原因坏掉了,重新安装就正常了
后记:
后来出现过几次,发现是杀软把有的PYD文件给删除造成的。

你可能感兴趣的:(python学习)