您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

python – pyinstaller:AttributeError:’module’对象没有属性’RSA’

5b51 2022/1/14 8:22:02 python 字数 3543 阅读 527 来源 www.jb51.cc/python

我的python文件可以直接使用python运行:python detectIPConflict.py 但是,当PyInstaller打包的脚本时:pyinstaller --onefile detectIPConflict.py ./dist/detectIPConflict 出现错误:WARNING: No route found for IPv6 de

概述

我的python文件可以直接使用python运行:

python detectIPConflict.py

但是,当PyInstaller打包的脚本时:

pyinstaller --onefile detectIPConflict.py
./dist/detectIPConflict

出现错误

WARNING: No route found for IPv6 destination :: (no default route?)
Traceback (most recent call last):
  File "
  
   __init__.py",line 17,module.__dict__)
  File "scapy/crypto/cert.py",line 19,in 
   
  

我也在第19行寻求scapy / crypto / cert.py:

from Crypto.PublicKey import *

我找不到为什么会发生这个错误.
我很困惑.

有人可以帮忙吗?

版本信息:

> Python:2.7.6
> pyinstaller:3.1.1
> scapy:2.3.2(由pip命令安装)
> pycrypto:2.6.1

这是detectIPConflict.py:

#!/usr/bin/env python
# -*- coding:utf-8 -*-
from scapy.all import *

def ip_conflict():
    ipscan='10.2.86.190/23'
    ip_dict = dict()
    ip_me = get_if_addr('eth0')
    mac_me = get_if_hwaddr('eth0')
    print "--------IP ME---------"
    print ip_me,"--",mac_me
    print "----------------------"
    ip_dict[ip_me] = mac_me
    try:
        ans,unans=srp(Ether(dst="FF:FF:FF:FF:FF:FF")/ARP(pdst=ipscan),iface="br0",timeout=2,verbose=False)
    except Exception,e:
        print str(e)
    else:
        print ("   MAC            --   IP   ")
        for snd,rcv in ans:
            list_mac=rcv.sprintf("%Ether.src% -- %ARP.psrc%")
            mac = rcv.sprintf("%Ether.src%")
            ip = rcv.sprintf("%ARP.psrc%")
            # print mac,'-->',ip
            if ip not in ip_dict:
                ip_dict[ip] = mac
    for has_ip in ip_dict.keys():
        print has_ip,"------ " + ip_dict[has_ip]
if __name__ == "__main__":
    ip_conflict()

from Crypto.PublicKey import RSA
from Crypto.Cipher import ARC2
from Crypto.Hash import MD2

这适合我.

但是,我不知道为什么pyinstaller无法识别’import *’.
感谢任何解释.

总结

以上是编程之家为你收集整理的python – pyinstaller:AttributeError:’module’对象没有属性’RSA’全部内容,希望文章能够帮你解决python – pyinstaller:AttributeError:’module’对象没有属性’RSA’所遇到的程序开发问题。


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶