Unable to install Psychtoolbox

=== delete this after reading ===
Please make sure you read this post before asking for help. No one can help you unless you provide a clear description of the software environment you are using and your programming problem…
=== delete until here ===
Hi

I am trying to install the Psychtoolbox on my MacBook Pro with MacOs Catalina version 10.15.7. And my matlab version is 2019B. I have installed the subversion through homebrew and add path in Matlab. I have also installed Xcode since someone else in the forum said that solves the problem.
However, I still get message like:

DownloadPsychtoolbox
DownloadPsychtoolbox(‘/Applications’,‘beta’,‘’)
Requested flavor is: beta
Requested location for the Psychtoolbox folder is inside: /Applications

Will use the svn client which is located in this folder: /usr/bin/
Good. Your privileges suffice for the requested installation into folder /Applications.

I will now download the latest Psychtoolbox for OSX.
Requested flavor is: beta
Target folder for installation: /Applications
The following CHECKOUT command asks the Subversion client to
download the Psychtoolbox:
/usr/bin/svn checkout https://github.com/Psychtoolbox-3/Psychtoolbox-3/branches/beta/Psychtoolbox/ “/Applications/Psychtoolbox”
Downloading. It’s nearly 100 MB, which can take many minutes.
Alas there may be no output to this window to indicate progress until the download is complete.
Please be patient …
If you see some message asking something like “accept certificate (p)ermanently, (t)emporarily? etc.”
then please press the p key on your keyboard, possibly followed by pressing the ENTER key.

svn: error: The subversion command line tools are no longer provided by Xcode.
Sorry, the download command “CHECKOUT” failed with error code 72:
svn: error: The subversion command line tools are no longer provided by Xcode.

The download failure might also be due to temporary network or server problems. You may want to try again in a
few minutes. It could also be that the subversion client was not (properly) installed. On Microsoft
Windows you will need to exit and restart Matlab or Octave after installation of the Subversion client. If that
does not help, you will need to reboot your machine before proceeding.
Another reason for download failure could be if an old working copy - a Psychtoolbox folder - still exists.
In that case, it may help to manually delete that folder. Or maybe you do not have write permissions for the target folder?

Error using DownloadPsychtoolbox (line 818)
Download failed.

My guess is that it would have probably worked if you hadn’t installed XCode in addition to subversion from HomeBrew. I think HomeBrew installs a proper svn executable into /usr/local/bin/svn, whereas XCode since quite recently installs an intentionally broken svn executable into /usr/bin/, because - well nobody apart from those differently gifted geniuses at the iToys company would know why one would do such an utterly non-sensical thing, but hey, “think different™”. So now DownloadPsychtoolbox finds the /usr/bin/svn fake executable from XCode and tries to use it and that fails because of Apples sabotage.

You could try to delete /usr/bin/svn or if that doesn’t work simply add /usr/local/bin to the Matlab path, so DownloadPsychtoolbox will search in /usr/local/bin first and find your HomeBrew svn executable.

Unfortunately whatever one does to fix this will typically not last more than a few months before Apple sabotages it again. Seems to be somebodies job there… - Their new motto in the era Cook is “It just doesn’t work™”.

I also had this problem. Installing command line tools with sudo xcode-select --install gave a new error about not being able to find the download.

I deleted command line tools with sudo rm -rf /Library/Developer/CommandLineTools and then installed subversion with homebrew.

For some reason this didn’t install properly:

dyld: Library not loaded: /usr/local/opt/libmagic/lib/libmagic.1.dylib
  Referenced from: /usr/local/Cellar/subversion/1.14.0_3/bin/svn
  Reason: image not found
/usr/local/Cellar/subversion/1.14.0_3/bin/svn checkout  https://github.com/Psychtoolbox-3/Psychtoolbox-3/branches/beta/Psychtoolbox/ "/Applications/Psychtoolbox": Aborted
Sorry, the download command "CHECKOUT" failed with error code 134:
dyld: Library not loaded: /usr/local/opt/libmagic/lib/libmagic.1.dylib
  Referenced from: /usr/local/Cellar/subversion/1.14.0_3/bin/svn
  Reason: image not found

But brew install libmagic fixed it and the PTB installer could then run.

Edit: this was 10.15.7

The wrong libmagic dependency bug was apparently fixed in HomeBrew just 3 hours ago:

So maybe it should work now with only subversion from HomeBrew, probably after a brew update or upgrade or whatever.