0

My current project involves receiving data packets from an external IP device and displaying/using the data with python. I am currently trying to use pyshark to extract this data, but am running into the error message 'no module named pyshark.' I have installed all the necessary support packages as far as i have read (lxml, py, trollius, logbook, were included with original package as far as my knowledge goes)

I am very new to IP/TCP data, and from my research on the topic, this code should at least run past line 1:

import pyshark
cap = pyshark.FileCapture('http.cap')

print(cap[0])

Is there perhaps something i am missing or looking over? I feel this issue may be a very easy solution :) Any help on this problem and even any help on interpreting the incoming data packets would also be fantastic. Thank you!

python -m pip --version yields pip 20.0.2 and running sys.version yields 3.8.1

complete error message:

Traceback (most recent call last):
  File "C:/ABWorkingFiles/Kairos/2020_Mar17/systemVersion.py", line 3, in <module>
    import pyshark
ModuleNotFoundError: No module named 'pyshark'
  • How did you install pyshark, and how are you running this code? – John Gordon Mar 17 '20 at 19:20
  • @JohnGordon Using the windows console, i entered **python -m pip install pyshark**. I am running this code with Pycharm. If it helps also, this is the location i found the pyshark module **https://pypi.org/project/pyshark/#files** – AcePilotWarhawk Mar 17 '20 at 19:54
  • 1
    Can you provide `python -m pip --version` and inside your script do `import sys; print(sys.version)` and post the results to your question? also can you post the complete error message? There's an edit button at the bottom of your question. – Ross Jacobs Mar 17 '20 at 21:01
  • Would you mind providing the full output of these commands in your question? Use triple backticks for blocks – Ross Jacobs Mar 17 '20 at 21:09
  • @RossJacobs Question edited – AcePilotWarhawk Mar 17 '20 at 21:19
  • @AcePilotWarhawk did you find the reason for that? I have the same problem. – Furin Jan 26 '22 at 15:04

1 Answers1

1

You need to have tshark installed in the system, for pyshark module to work. Use https://tshark.dev/setup/install/ to install tshark.

dvs
  • 511
  • 1
  • 10
  • 27