Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: attempted relative import with no known parent package #38

Closed
javiersopena opened this issue Mar 3, 2024 · 5 comments
Closed

Comments

@javiersopena
Copy link

Hello. Just cloned the repo to test your tool, but it seems that python3 does not recognize the location for /lib functions.
I simply did
$ git clone https://github.com/Pepelux/sippts.git
$ cd sippts
$ pip3 install -r requirements.txt
$ cd src/sippts
$ python3 sipenumerate.py -h
Traceback (most recent call last):
File "/home/kali/milcom/sippts/src/sippts/sipenumerate.py", line 14, in
from .lib.functions import create_message, get_free_port, parse_message, fingerprinting, format_time
ImportError: attempted relative import with no known parent package

$ python3 sipfuzzer.py
Traceback (most recent call last):
File "/home/kali/milcom/sippts/src/sippts/sipfuzzer.py", line 20, in
from .lib.functions import create_message, get_free_port
ImportError: attempted relative import with no known parent package

@Pepelux
Copy link
Owner

Pepelux commented Mar 4, 2024

You have to install it:

$ git clone https://github.com/Pepelux/sippts.git
$ cd sippts
$ pip3 install .

@javiersopena
Copy link
Author

$ pip3 install .
Defaulting to user installation because normal site-packages is not writeable
Processing /home/kali/milcom/sippts
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: netifaces in /usr/lib/python3/dist-packages (from sippts==3.4.dev0) (0.11.0)
Requirement already satisfied: IPy in /usr/lib/python3/dist-packages (from sippts==3.4.dev0) (1.1)
Requirement already satisfied: pyshark in /home/kali/.local/lib/python3.11/site-packages (from sippts==3.4.dev0) (0.6)
Requirement already satisfied: scapy in /usr/lib/python3/dist-packages (from sippts==3.4.dev0) (2.5.0)
Requirement already satisfied: ArpSpoof in /home/kali/.local/lib/python3.11/site-packages (from sippts==3.4.dev0) (1.1.2)
Requirement already satisfied: websocket-client in /usr/lib/python3/dist-packages (from sippts==3.4.dev0) (1.2.3)
Requirement already satisfied: rel in /home/kali/.local/lib/python3.11/site-packages (from sippts==3.4.dev0) (0.4.9.6)
Requirement already satisfied: pyradamsa in /home/kali/.local/lib/python3.11/site-packages (from sippts==3.4.dev0) (0.1.1)
Requirement already satisfied: PythonToolsKit in /home/kali/.local/lib/python3.11/site-packages (from ArpSpoof->sippts==3.4.dev0) (1.2.6)
Requirement already satisfied: lxml in /usr/lib/python3/dist-packages (from pyshark->sippts==3.4.dev0) (4.9.3)
Requirement already satisfied: termcolor in /usr/lib/python3/dist-packages (from pyshark->sippts==3.4.dev0) (1.1.0)
Requirement already satisfied: packaging in /usr/lib/python3/dist-packages (from pyshark->sippts==3.4.dev0) (23.1)
Requirement already satisfied: appdirs in /usr/lib/python3/dist-packages (from pyshark->sippts==3.4.dev0) (1.4.4)
Building wheels for collected packages: sippts
Building wheel for sippts (pyproject.toml) ... done
Created wheel for sippts: filename=sippts-3.4.dev0-py3-none-any.whl size=115542 sha256=5b0be1f3a571d9d4d0199608eebc50d9c264e36a77b3d4579ec074417beada22
Stored in directory: /tmp/pip-ephem-wheel-cache-nv9euma_/wheels/e1/ef/62/2d159a06bec88fc8cf1cbcc49885f1322e60dd30df40b52a53
Successfully built sippts
Installing collected packages: sippts
Successfully installed sippts-3.4.dev0

$ cd src/sippts
$ python3 sipenumerate.py -h
Traceback (most recent call last):
File "/home/kali/milcom/sippts/src/sippts/sipenumerate.py", line 14, in
from .lib.functions import create_message, get_free_port, parse_message, fingerprinting, format_time
ImportError: attempted relative import with no known parent package

@Pepelux
Copy link
Owner

Pepelux commented Mar 4, 2024

no no no ... once installed it will be in the path. You can simple run:

$ sipenumerate -h

@javiersopena
Copy link
Author

Aaaahm Thank you!

@javiersopena
Copy link
Author

Solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants