-
Notifications
You must be signed in to change notification settings - Fork 110
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
[Bug] Support for Python 3.12 - Missing distutils #176
Comments
I am also experiencing this issue, is there any ETA for a fix? |
Would appreciate feedback on this - I'm working locally exploring the dataset/tooling in this module and also encountered this issue. I mitigated it by installing setuptools in the virtual environment where I'm working:
The other option was to create a virtual environment using an older version ( lesser than 3.12) of Python. Is there a preferred way from the perspective of the maintainers to mitigate this? |
Maintainer here. Hello! Personally I would like nothing more than to update this to work on Python 3.12, but my main focus has not been on that functionality yet. We are semi-stuck on Python 3.10 for a completely unrelated issue, but let me try to connect some dots.
The issue is not STIX 1 support (#163). The script that is modified in PR #181 ( I will work on this this week, and @stemarks thank you for the PR in the first place. I hope there are no hard feelings if I end up closing the PR and implement the same fix in a slightly different way as I rip out that and potentially some other content as well that we don't use, and using the cover of a breaking change might take the opportunity to do that in a release this week. |
@jondricek - this is all super helpful and informative - thank you! Based on this, my thinking is that the best short to medium term fix is to create a virtual environment that uses either 3.10 or 3.11 - is that accurate? While installing setuptools "fixes" the issue, my read is that using v3.10 or 3.11 will provide a more consistent experience until this is addressed in a systematic way - would you agree? |
@jondricek no hard feelings at all, I totally understand. I modified this as we needed it to work with 3.12 so thought I would share what I had done in case it helped you guys time wise, and also in case the solution helps anyone else out they can see my changes 👍 |
@billfitzgerald yes - i recommend 3.10 for the time being due to the legacy reason above, but i think it should work in 3.11 as well. Honestly, if installing setuptools in the 3.12 environment fixes it for you, that should be fine - however i realize it is, i'll just say obnoxious from our end to force someone to do that. (But i would totally do that in a testing environment on my own machine if I needed to) @stemarks thanks for lighting a fire under me to do our own version of PEP 594: Removing Dead Batteries (https://peps.python.org/pep-0594/). And thanks for sharing what you did to make it work! |
@jondricek - super helpful, thank you! RE: "obnoxious from our end" I mean, it's 2024 - if running a one line command is the worst part of my day, it's an awesome day! :) Thank you for your input here - very much appreciated. |
Expected Behavior
The library should function under Python3.12
Actual Behavior
The library attempts to load the distutils module, which was removed in Python3.12. See https://docs.python.org/3.10/library/distutils.html for background on the deprecation and removal of distutils.
Steps to Reproduce the Problem
python3 -m pip install mitreattack-python
Possible Solution
This may be related to #163, and removing support for STIX1 will remove the dependency.
The text was updated successfully, but these errors were encountered: