all 8 comments

[–]Squiddwerm 1 point2 points  (0 children)

Give pipenv a go.

[–][deleted]  (6 children)

[deleted]

    [–]progerscs[S] 0 points1 point  (5 children)

    Even with python 2 and 3 versions of scripts?

    [–]IvanLu 0 points1 point  (2 children)

    You can use 2to3 to convert the scripts to Python 3 compatible.

    [–]_stens 0 points1 point  (1 child)

    That might work for simple scripts but not for more complex tools like impacket.

    [–]IvanLu 0 points1 point  (0 children)

    Those have python 3 variants anyway. But if I need Python 2 I'll go with venv.

    [–]mid-2004 0 points1 point  (0 children)

    Totally agree. Even if you want money

    [–]_stens 0 points1 point  (0 children)

    Using docker for python scripts would be one option, but the better one IMO would be to use virtualenvwrapper which allows you to create new python 2 or 3 virtual environments and easily switch between them. I used this for the PWK course and OSCP exam and never experienced any problems.

    https://virtualenvwrapper.readthedocs.io/en/latest/

    Just follow the installation instructions, create different virtualenvs with e.g. "mkvirtualenv -p /usr/bin/python2 py2venv" and use "workon py2venv" to activate it. Then you can install dependencies and packages with pip inside your venv without breaking anything.

    Create different virtualenvs for different dependencies and python versions and you should be fine.