Python Forum

Full Version: Python Issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am new to python and Kali linux. I have installed Kali linux on virtual box to practice Python. But I am unable to execute python programs which imports pandas,scapy etc.

I observed the following things in my Kali environment

1) when executed "which Python", it lists (same for Python3)
/usr/bin
2) when executed "which pip", it lists (same for pip3)
/usr/local/bin
/usr/bin

3) When tried to install scapy/ pandas using "apt-get install pandas/scapy", it is giving the following

pip3 install scapy


Requirement already satisfied: scapy in /root/.local/lib/python3.6/site-packages (2.4.0)

4) But when I execute python file which has "import scapy" statement is not executing. I am getting the following error

after this command python dummy.py

Traceback (most recent call last):
File "dummy.py", line 1, in <module>
import scapy.all as scapyall
File "/usr/local/lib/python2.7/dist-packages/scapy/all.py", line 10, in <module>
from .config import *
File "/usr/local/lib/python2.7/dist-packages/scapy/config.py", line 11, in <module>
from .data import *
File "/usr/local/lib/python2.7/dist-packages/scapy/data.py", line 184, in <module>
TCP_SERVICES,UDP_SERVICES=load_services("/etc/services")
File "/usr/local/lib/python2.7/dist-packages/scapy/data.py", line 109, in load_services
f=open(filename, errors='ignore')
TypeError: 'errors' is an invalid keyword argument for this function


Please help me, I am struggling with this from 5 days.

thanks,
Radha
python2

which python

python3

which python3
Mr. Axel_Erfurt

I have already mentioned these. please find my post
(Aug-28-2018, 01:29 PM)radharani1306 Wrote: [ -> ]after this command python dummy.py
Use python3 dummy.py
(Aug-28-2018, 01:29 PM)radharani1306 Wrote: [ -> ]I am new to python and Kali linux. I have installed Kali linux on virtual box to practice Python. But I am unable to execute python programs which imports pandas,scapy etc. I observed the following things in my Kali environment 1) when executed "which Python", it lists (same for Python3) /usr/bin 2) when executed "which pip", it lists (same for pip3) /usr/local/bin /usr/bin 3) When tried to install scapy/ pandas using "apt-get install pandas/scapy", it is giving the following pip3 install scapy Requirement already satisfied: scapy in /root/.local/lib/python3.6/site-packages (2.4.0) 4) But when I execute python file which has "import scapy" statement is not executing. I am getting the following error after this command python dummy.py Traceback (most recent call last): File "dummy.py", line 1, in <module> import scapy.all as scapyall File "/usr/local/lib/python2.7/dist-packages/scapy/all.py", line 10, in <module> from .config import * File "/usr/local/lib/python2.7/dist-packages/scapy/config.py", line 11, in <module> from .data import * File "/usr/local/lib/python2.7/dist-packages/scapy/data.py", line 184, in <module> TCP_SERVICES,UDP_SERVICES=load_services("/etc/services") File "/usr/local/lib/python2.7/dist-packages/scapy/data.py", line 109, in load_services f=open(filename, errors='ignore') TypeError: 'errors' is an invalid keyword argument for this function Please help me, I am struggling with this from 5 days. thanks, Radha


Hi Radha,

I have vast experience in Python and Linux and I feel we can assist you on this mandate.

Would be glad to discuss and take this forward.

Look forward to hearing from you.

Gmail: karen.cis10gmail.com
Skype: cisin.karen

Regards,
Karen
@KarenM:
This is forum, not freelance or job site. Yet we have also dedicated Jobs section.
If you can and want to help - do it here, so others could benefit too in the future.
Don't offer paid services, except in Job section of the forum.