Looking through other issues, guessing this isn't new per se. Looks like this all began as a Python v2 script that's been brought to v3 but still tied to some older modules.
For reference my system:
- 2019 27" iMac with Core i5 and 32GB RAM
- macOS 13.2
- Python.org's Python 3.11.2
- Command Line Tools for Xcode 14.2
Did a git clone of repo.
First attempt to run script:
% ./mcxToProfile.py
zsh: ./mcxToProfile.py: bad interpreter: /usr/bin/python: no such file or directory
Looking at file, I see top line shows #!/usr/bin/python. Yeah, that's not gonna work. Modified it to #!/usr/bin/python3 and re-ran script. Now I get
% ./mcxToProfile.py
Traceback (most recent call last):
File "/Users/frank/Desktop/mcxToProfile/./mcxToProfile.py", line 15, in <module>
from Foundation import NSData, \
ModuleNotFoundError: No module named 'Foundation'
I did some digging and seems that the underbelly of this relies on something called PyObjC. I tried installing it after finding it on PyPi.org, but pip install pyobjc failed miserably.
Found the source code for that here: https://github.com/ronaldoussoren/pyobjc
So cloned it into the directory where I had this script. I setup a virtual environ using virtualenv venv followed by source venv/bin/activate, so I can sandbox this setup somewhat.
At that point I followed the instructions and tried to do python3 pyobjc/install.py but that failed due to not being able to import _install_tool. I moved down into ./pyobjc and re-ran it as python3 install.py, and THAT seemed to do the trick. Got lots of warnings/etc., but it spent the next 20+ minutes compiling. Sadly, that ended badly with
...
^
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pyobjc-framework-WebKit
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Installing 'pyobjc-framework-WebKit' failed (status 1)
Cannot build one of the projects, bailing out
So still can't run this.
Anyway, so looks like this "Foundation" module isn't installed, nor can I get the bits going to do so.
If I had to guess, this script relies on features not found on stock macOS systems. Is that a fair assessment? If there are dependencies, might it not help to articulate them in the README.md file so users have a better chance of using this tool? It feels like this could do with a requirements.txt or similar file to let folks know what is expected.
I came here as I was dealing with a Munki issue and multiple references mentioned this particular tool. Sadly looks like it's not quite as simple to use as they made it sound.
Looking through other issues, guessing this isn't new per se. Looks like this all began as a Python v2 script that's been brought to v3 but still tied to some older modules.
For reference my system:
Did a
git cloneof repo.First attempt to run script:
Looking at file, I see top line shows
#!/usr/bin/python. Yeah, that's not gonna work. Modified it to#!/usr/bin/python3and re-ran script. Now I getI did some digging and seems that the underbelly of this relies on something called PyObjC. I tried installing it after finding it on PyPi.org, but
pip install pyobjcfailed miserably.Found the source code for that here: https://github.com/ronaldoussoren/pyobjc
So cloned it into the directory where I had this script. I setup a virtual environ using
virtualenv venvfollowed bysource venv/bin/activate, so I can sandbox this setup somewhat.At that point I followed the instructions and tried to do
python3 pyobjc/install.pybut that failed due to not being able toimport _install_tool. I moved down into./pyobjcand re-ran it aspython3 install.py, and THAT seemed to do the trick. Got lots of warnings/etc., but it spent the next 20+ minutes compiling. Sadly, that ended badly withSo still can't run this.
Anyway, so looks like this "Foundation" module isn't installed, nor can I get the bits going to do so.
If I had to guess, this script relies on features not found on stock macOS systems. Is that a fair assessment? If there are dependencies, might it not help to articulate them in the README.md file so users have a better chance of using this tool? It feels like this could do with a
requirements.txtor similar file to let folks know what is expected.I came here as I was dealing with a Munki issue and multiple references mentioned this particular tool. Sadly looks like it's not quite as simple to use as they made it sound.