idapython: importing “site“ failed报错的解决方案

0x01问题原因

ida官网有对该问题的解释:

This issue is usually caused by presence of non-standard python27.dll
in the PATH which uses its own set of modules (you should edit PATH in
this case). However, it may happen if your Python installation is
broken in some way. Reinstalling Python manually may fix it.

翻译:你主机的环境变量path包含了非标准的python27.dll导致的,当然,也可能是某次安装时意外终端导致的。手动重新安装python可能会修复这个问题。

0x02问题修复

  1. 官方也好心的给出了详细的修复方法:
    查看python27.dll的位置
    c:\>where python27.dll
    C:\Windows\System32\python27.dll
  1. 查看注册表中 HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath的值是python2.7的安装路径
  2. 增加一个环境变量,key为PYTHONHOME,value为python的安装路径。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值