How do I import pcap or pyshark on python
Question: I want to write the Ethernet packets capture while using python. I googling
and found that I should using Pcap library or PyShark but I try to import
pcap, it said that can not found module name Pcap, so I try to using PyShark
instance but it show like this on Python shell

    
    
    Traceback (most recent call last):
      File "<pyshell#2>", line 1, in <module>
        import pyshark
      File "D:\Python27\lib\site-packages\pyshark-0.3.3-py2.7.egg\pyshark\__init__.py", line 1, in <module>
        from pyshark.capture.live_capture import LiveCapture
      File "D:\Python27\lib\site-packages\pyshark-0.3.3-py2.7.egg\pyshark\capture\live_capture.py", line 1, in <module>
        from pyshark.capture.capture import Capture
      File "D:\Python27\lib\site-packages\pyshark-0.3.3-py2.7.egg\pyshark\capture\capture.py", line 7, in <module>
        import trollius as asyncio
    ImportError: No module named trollius
    

About this problem, what should I do? How can I import the library to python?

OS is Windows 8.1 and Python version 2.7.9


Answer: The `pyshark` project requires that
[`trollius`](https://pypi.python.org/pypi/trollius) is installed for Python
versions before Python 3.4. You'll need to install that separately.

It _should_ have been installed when you installed the `pyshark` package
however. Make sure to always use a tool like `pip` to install your packages
and dependencies like these are taken care of automatically; the `pyshark`
project [declares the dependencies
correctly](https://github.com/KimiNewt/pyshark/blob/master/src/setup.py#L12):

    
    
    install_requires=['lxml', 'py', 'trollius', 'logbook'],
    

