Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Issue
#1
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
Reply
#2
python2

which python

python3

which python3
Reply
#3
Mr. Axel_Erfurt

I have already mentioned these. please find my post
Reply
#4
(Aug-28-2018, 01:29 PM)radharani1306 Wrote: after this command python dummy.py
Use python3 dummy.py
Reply
#5
(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

User has been warned for this post. Reason: Offering paid services, not in Jobs section.
Reply
#6
@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.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020