1

I am trying to install pyshark in windows. [Python 2.6]. When I try to import pyshark in my python code. I get the following error -

**Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyshark\__init__.py", line 1, in <module>
    from pyshark.capture.live_capture import LiveCapture
  File "pyshark\capture\live_capture.py", line 3, in <module>
    from pyshark.capture.capture import Capture
  File "pyshark\capture\capture.py", line 4, in <module>
    from pyshark.tshark.tshark_xml import packet_from_xml_packet
  File "pyshark\tshark\tshark_xml.py", line 4, in <module>
    import lxml.objectify
ImportError: DLL load failed: The specified procedure could not be found.**

looks like the lxml.objectify is not available, but I have installed lxml.

Dhia
  • 10,119
  • 11
  • 58
  • 69
Vishak
  • 13
  • 1
  • 3
  • Can you import `lxml.objectify` directly, or do you get an ImportError? – Gerrat Jul 30 '14 at 21:25
  • I get an import error – Vishak Jul 30 '14 at 21:30
  • ...so...it appears that you don't have lxml installed (or at least correctly). – Gerrat Jul 30 '14 at 21:37
  • I found from https://pypi.python.org/pypi/pyshark/0.2.5. – Vishak Jul 30 '14 at 21:57
  • @user2746064: How did you install that package? If you used something like pip, it should have either 1) installed lxml; 2) issued an error saying that it couldn't. From your error, you don't have it installed. You could try this command on the command-line: pip install lxml (which may or may not work depending on your configuration) – mtik00 Jul 30 '14 at 22:32

2 Answers2

0

If you're on Windows (and it looks like you are), download and install lxml from Christoph Gohlke's Python Extension Packages.

Then you should be able to use pyshark.

bbayles
  • 4,389
  • 1
  • 26
  • 34
0

Recently, I tried different packages for Python. You can try firstly pip install xyz, if it is not workable then swift to Anaconda or miniconda and write conda install xyz in cmd.

LW001
  • 2,452
  • 6
  • 27
  • 36
faiz
  • 115
  • 1
  • 10