我正在做一个项目,我在其中使用了 ǞǞǞ 和 pcap-ct using python in pycharm. My code was working fine but I have to transfer my project from one device to another. Both devices are running windows 10 pro with the same version.和I am using python 3.7.3 on both devices with the same pychram version, but on the first device, my project is running fine but on the second device I am getting this error.
我是这样导入的。
import pcap
import dpkt
和错误是这样的。
File "C:\Users\Desktop\Desktop\NetworkTraficAnalyser\ShowGraph.py", line 5, in <module>
import pcap
File "C:\Users\Desktop\Desktop\NetworkTraficAnalyser\venv\lib\site-packages\pcap\__init__.py", line 6, in <module>
from ._pcap import * ; del _pcap # noqa
File "C:\Users\Desktop\Desktop\NetworkTraficAnalyser\venv\lib\site-packages\pcap\_pcap.py", line 20, in <module>
from libpcap import (DLT_NULL, DLT_EN10MB, DLT_EN3MB, DLT_AX25,
File "C:\Users\Desktop\Desktop\NetworkTraficAnalyser\venv\lib\site-packages\libpcap\__init__.py", line 7, in <module>
from ._pcap import * ; del _pcap # noqa
File "C:\Users\Desktop\Desktop\NetworkTraficAnalyser\venv\lib\site-packages\libpcap\_pcap.py", line 73, in <module>
from ._dll import dll
File "C:\Users\Desktop\Desktop\NetworkTraficAnalyser\venv\lib\site-packages\libpcap\_dll.py", line 10, in <module>
raise exc
File "C:\Users\Desktop\Desktop\NetworkTraficAnalyser\venv\lib\site-packages\libpcap\_dll.py", line 8, in <module>
dll = DLL(DLL_PATH)
File "C:\Users\Desktop\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
我已经在我的这个目录中检查了C:\Windows\System32 我有这个文件wpcap.dll
我不知道在我的两个设备上这个文件是否相同,但它在两个设备上都存在。
我搜索过这个错误代码WinError 126和found the different question和their answers but they are because someone is importing any .dll file or using it和they use \ in path和answers are they should use / or \ instead because \ are also used in Escape sequences. But I am not using anything like this.
If pcap code is using like this I don't know.
can anyone help me what is the issue和what is the solution?