Unable to install Scamp

I am trying to install Scamp on my MAC OS 10.13.6. I have successfully downloaded Thonny 4.0.1 but when I try to download Scamp through Thonny as per the Install web page I get the following error:-

AssertionError: /Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py
Process returned with code 1

Can someone please help me

Thank you

Jonathan

I’ll try to look into it. Is that the entire error you’re getting? Are there any more details?

Hi Marc

the entire message I get is:-

Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_distutils_hack/init.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the distutils module in sys.modules. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
warnings.warn(
/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn(“Setuptools is replacing distutils.”)
Traceback (most recent call last):
File “/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/Users/jonathanclark/pip.py”, line 23470, in
main()
File “/Users/jonathanclark/pip.py”, line 198, in main
bootstrap(tmpdir=tmpdir)
File “/Users/jonathanclark/pip.py”, line 120, in bootstrap
import setuptools # noqa
File “/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/init.py”, line 8, in
import _distutils_hack.override # noqa: F401
File “/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_distutils_hack/override.py”, line 1, in
import(’_distutils_hack’).do_override()
File “/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_distutils_hack/init.py”, line 77, in do_override
ensure_local_distutils()
File “/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_distutils_hack/init.py”, line 64, in ensure_local_distutils
assert ‘_distutils’ in core.file, core.file
AssertionError: /Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py
Process returned with code 1

Hope this helps. I’m really looking forward to using Scamp

Jonathan

This is a strange error — I don’t think it has anything to do with SCAMP. I seems to be an issue with the mechanism for installing libraries generally. Can you try installing some other Python packages? Like pynput? Or numpy? Do they cause the same error?

I have tried to install both pynput and nympy and get exactly the same error. I compared all error messages using TextWangler to ensure they were exactly the same.

Thanks for your help

Jonathan

I’ve been poking around and found two files on my home directory pip and pip.py. After changing them to pipx and pipx.py I retried installing scamp using thonny and it seems to be successful. I have yet to complete the process on your installation page. Some years ago I used python with an app called sikuli which may be where these files came from. Would it be safe to delete them? I can see from thonny that I could install pip from there if I ever need it. I shall report back as soon as I successfully have scamp up and running

Jonathan

I have now installed everything successfully. When running test_run I got some warnings that said they would only appear on running for the first time. And Lo and Behold that was true. However I seem to always get the following when running the test script from the editor even after closing and reopening thonny.

/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 2 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d ’

Curiously I don’t get this if I run it from the shell prompt. Is this something I should be worried about?

In any case thanks for your help and I now need to read the documentation.

Best wishes

Jonathan

It could be that the pip related files in your home directory were being mistakenly imported and causing errors. Anyway, glad to hear you figured it out!

As for the semaphore thing, it could be that this is due to an issue inside SCAMP which is showing up on Python 3.10. You can just ignore it; might be something for me to look into though.

Thanks again

Jonathan