Fatal Python error:initsite:Failed to import the site module

踩坑记录一下python报错处理

早上运行python(3.7)代码时发现一运行就报错,debug断点打到最开始的地方也进去不了,使用conda命令切换至3.7然后执行命令:python也报错,然后就开始百度,上Stack Overflow,按照他们给的方式处理都没有用

心中的想法时大概率是py环境的问题,当我切换至3.6时果然执行正常

在进行了无数次conda删除创建命令时终于发现了报错如下:

SafetyError: The package for python located at /opt/anaconda3/pkgs/python-3.7.10-hdb3f193_0
appears to be corrupted. The path 'lib/python3.7/os.py'
has an incorrect size.
  reported size: 37901 bytes
  actual size: 37913 bytes

                                                                                                                                                              done
Executing transaction: done

泪目终于找到了问题,处理这个错误按照博客上操作:

删除有问题的环境:conda remove -n <env name> --all
清空anaconda pkg缓存:conda clean -a
然后可以进入anaconda3/pkgs下查看有问题的包是不是没有了

再重新创建安装环境注意报错即可

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Resolution A.1023(26) Adopted on 2 December 2009 (Agenda item 10) CODE FOR THE CONSTRUCTION AND EQUIPMENT OF MOBILE OFFSHORE DRILLING UNITS, 2009 (2009 MODU CODE) THE ASSEMBLY, RECALLING Article 15(j) of the Convention on the International Maritime Organization concerning the functions of the Assembly in relation to regulations and guidelines concerning maritime safety, NOTING that mobile offshore drilling units continue to be moved and operated internationally, RECOGNIZING that the design criteria for such units are often quite different from those of conventional ships and that, by virtue of this, international conventions (such as the International Convention for the Safety of Life at Sea, 1974, as amended, and the International Convention on Load Lines, 1966, as amended) cannot apply in respect of mobile offshore drilling units, RECALLING FURTHER that, when the Code for the Construction and Equipment of Mobile Offshore Drilling Units (MODU Code) was adopted in 1979 by resolution A.414(XI), it was recognized that the design technology of mobile offshore drilling units was rapidly evolving and that new features of mobile offshore drilling units were being introduced to improve technical and safety standards, RECALLING ALSO the adoption of the Code for the Construction and Equipment of Mobile Offshore Drilling Units (MODU Code), 1989, which superseded the 1979 MODU Code, by resolution A.649(16), following a number of tragic MODU casualties which emphasized the need for a review of the international safety standards developed by the Organization, NOTING that, since the adoption of the 1989 MODU Code, ICAO has adopted amendments to the Convention on International Civil Aviation, which impact on the 1989 Code provisions for helicopter facilities; and that the Organization has, since, adopted a number of amendments to SOLAS regulations, which are referenced in the 1989 MODU Code,

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值