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

Incompatibilty of PRET on Kali Linux and Python3 #42

Open
thomsoe opened this issue Dec 25, 2020 · 5 comments
Open

Incompatibilty of PRET on Kali Linux and Python3 #42

thomsoe opened this issue Dec 25, 2020 · 5 comments

Comments

@thomsoe
Copy link

thomsoe commented Dec 25, 2020

Hi everybody!
So I clone PRET on my Kali Linux and I obviously get this error because Python 2 has been removed of Kali but it will mess the execution of PRET :
python -m pip install colorama pysnmP
/usr/bin/python: No module named pip

So when I start ./pret.py, I get :
./pret.py
Please install the 'colorama' module for color support.
Please install the 'pysnmp' module for SNMP support.
usage: pret.py [-h] [-s] [-q] [-d] [-i file] [-o file] target {ps,pjl,pcl}
pret.py: error: too few arguments

So I try with Python 3 and get these following errors (because it's not written to work with Python 2 ig) :
Traceback (most recent call last):
File "./pret.py", line 8, in
from discovery import discovery
File "/home/thoms/Bureau/AdventOfCyber/PRET/PRET/discovery.py", line 7, in
from helper import output, conv
File "/home/thoms/Bureau/AdventOfCyber/PRET/PRET/helper.py", line 130
def discover(self, (ipaddr, (device, uptime, status, prstat))):
^
SyntaxError: invalid syntax`

How can I make PRET fully functionnal??

PS : when I use "python3 -m pip install colorama pysnmP", I get this :
python3 -m pip install colorama pysnmP
Requirement already satisfied: colorama in /usr/lib/python3/dist-packages (0.4.3)
Requirement already satisfied: pysnmP in /usr/lib/python3/dist-packages (4.4.6)

@SlothDotEXE
Copy link

SlothDotEXE commented Dec 26, 2020

Hi,

I couldn't find a simple solution to having multiple interpreters, so I made a Docker solution and posted the repo a few hours ago.

https://github.com/SlothDotEXE/PRET-Docker

@thomsoe
Copy link
Author

thomsoe commented Dec 26, 2020

Okay thanks, I'll test it but I really want to know how to make it fully functionnal without a docker. If a distribution like Kali has python2 disabled it means that we can't use PRET....

@SlothDotEXE
Copy link

Okay thanks, I'll test it but I really want to know how to make it fully functionnal without a docker. If a distribution like Kali has python2 disabled it means that we can't use PRET....

Understandable. It's possible by changing the $PATH environments or by using a dedicated environment manager like Anaconda, although my experience in that is limited.

https://docs.anaconda.com/anaconda/user-guide/tasks/switch-environment/

@Einstein2150
Copy link

Install python2 ...

@OlegXio
Copy link

OlegXio commented Jul 22, 2024

same issue for windows. Except for colorama, everything is fine from it:

D:\Python\PRET\pret.py:55: SyntaxWarning: invalid escape sequence '\|'
  print("  |-||/_____\||-.  | |´         dumpster diving obsolete‥ 」       ")
Please install the 'pysnmp' module for SNMP support.

usage: pret.py [-h] [-s] [-q] [-d] [-i file] [-o file] target {ps,pjl,pcl}
pret.py: error: the following arguments are required: target, mode

However, if you specify the command in full, along the lines of python pret.py 1.1.1.1 pjl, it's fine (I haven't tested this on a really real IP of a real network printer, though)

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

4 participants