在 Windows 10 python 2.7(64 位)上安装 pypcap [英] Installing pypcap on Windows 10 python 2.7 (64 bit)

查看:74
本文介绍了在 Windows 10 python 2.7(64 位)上安装 pypcap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从以下位置安装 pypcap:https://github.com/dugsong/pypcap/blob/master/INSTALL#L75

I'm trying to install pypcap from: https://github.com/dugsong/pypcap/blob/master/INSTALL#L75

我正在尝试将其安装在 Windows 10 - 64 位和 python 2.7.11 64 位上.我下载了源代码并将其移动到 c:\pypcap.下载 pyrex 并安装它.它把 wpdpack 文件放在 c:\wpdpack 中,就像安装页面说的那样.创建配置文件并更改生成文件.

I'm trying to install it on Windows 10 - 64 bit and python 2.7.11 64 bit. I downloaded the source and moved it to c:\pypcap. downloaded pyrex and installed it as well. It put the wpdpack files in c:\wpdpack like the install page says. Created the config file and changed the makefile.

我还从他们的网站安装了带有基本包和 g++ 包的 mingw.

I also installed the mingw from their website with the basic package and the g++ package.

我尝试这样做:

C:\pypcap> set PATH=%PATH%;c:\MinGW\bin;c:\Python27
C:\pypcap> mingw32-make

这里失败了,它得到以下错误:

and here it fails, it gets the following error:

In file included from C:\Python27\include/Python.h:8:0,
                 from pcap.c:4:
C:\Python27\include/pyconfig.h:68:16: fatal error: io.h: No such file or directory
 #include <io.h>

所以我没有这个 io.h 文件.我该怎么做才能使其编译并使用 pypcap?

so I don't got this io.h file. What can I do to make it compile and use the pypcap?

在尝试之前我尝试过

C:\pypcap>pip install pypcap
Collecting pypcap
  Using cached pypcap-1.1.4.tar.gz
    Complete output from command python setup.py egg_info:
    pcap.h not found

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\USER\appdata\local\temp\pip-build-fvgkhs\pypcap\

之后我尝试使用轮子下载,但也失败了.

and after that I tried using the wheel download but it failed as well.

预先感谢您的帮助

推荐答案

  1. 解压 WinPcap Developer Pack 这样你就有 C:\WpdPack\IncludeC:\WpdPack\Lib

解压pypcap source 这样你就有 C:\pypcap-1.1.4\setup.py

安装 Microsoft Visual C++ Compiler for Python 2.7

为您的 Python27 位数启动相关的 cmd 提示:
<代码>开始 ->程序 ->适用于 Python 2.7 的 Microsoft Visual C++ 编译器包

Start the relevant cmd prompt for your Python27 bitness from:
Start -> Programs -> Microsoft Visual C++ Compiler Package for Python 2.7

从那个 cmd 提示符安装/构建 pypcap:

Install/build pypcap from that cmd prompt with:

    set INCLUDE=%INCLUDE%;c:\WpdPack\Include
    set LIB=%LIB%;c:\WpdPack\Lib
    pushd C:\pypcap-1.1.4
    python setup.py install

这篇关于在 Windows 10 python 2.7(64 位)上安装 pypcap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆