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

Fixed issue: setuptools keeps complaining about python2 #178

Merged
merged 1 commit into from May 22, 2020

Conversation

samduy
Copy link
Contributor

@samduy samduy commented May 18, 2020

Description:

On the system that has both python2 and python3 that have been running well together (like Kali Linux), it's unable to complete even the first step in setting up ctf-tools environment. When execute bin/manage-tools setup it always fails where setuptools complain about python2 (see details below).

kali@kali:/opt/ctf-tools$ bin/manage-tools setup
Hit:1 http://ftp.▪️▪️▪️▪️▪️▪️/pub/kali kali-rolling InRelease
Reading package lists... Done
/home/kali/.virtualenvs/ctftools/lib/python2.7/site-packages/pkg_resources/py2_warn.py:21: UserWarning: Setuptools will stop working on Python 2
************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please follow up at
https://bit.ly/setuptools-py2-warning.
************************************************************
  sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support 

Analysis

The reason of this complaining is ctf-tools using the same script for both python2 and python3 environment and then forcing python2's pip to install setuptools even though setuptools can be (and is recommended) to installed with python3.

Solution

The fix is specifically call pip for python3 by python3 -m pip instead of just pip as currently used for both bin/ctf-tools-pip and bin/ctf-tools-pip3.

The Fix

Remove the symlink of ctf-tools-pip3 (that pointed to ctf-tools-pip), copy the content from ctf-tools-pip and replace exec pip by exec python3 -m pip

Result after fix

kali@kali:/opt/ctf-tools$ bin/manage-tools setup
[sudo] password for kali: 
Hit:1 http://ftp.▪️▪️▪️▪️▪️▪️/pub/kali kali-rolling InRelease
Reading package lists... Done
kali@kali:/opt/ctf-tools$ 

@zardus zardus merged commit e0b1ab5 into zardus:master May 22, 2020
@zardus
Copy link
Owner

zardus commented May 22, 2020

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants