Fixed issue: setuptools keeps complaining about python2 #178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).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 justpip
as currently used for bothbin/ctf-tools-pip
andbin/ctf-tools-pip3
.The Fix
Remove the symlink of
ctf-tools-pip3
(that pointed toctf-tools-pip
), copy the content fromctf-tools-pip
and replaceexec pip
byexec 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$