MacOS – Problems using Anaconda in macOS Catalina

catalinamacospermission

I recently upgrade to macOS Catalina and I made a clean installation Anaconda Navigator.
I install again Anaconda but it didn't work. I also reinstall the OS but didn't work too. The permissions of the files are ok, I can read and write files. I don't know why I can't open a file from Spyder. This is the image of my terminal in Spyder:

enter image description here

Best Answer

The problems observed are related to the new system policy for user owned "system folders" like Documents, Desktop etc.

Here is a related syslog entry me trying to execute or open some script/file in $USER/Documents/ with Spyder/iPython:

Sandbox: python(2233) System Policy: deny(1) file-read-data /Users/admin/Documents
Violation:       System Policy: deny(1) file-read-data /Users/admin/Documents 
Process:         python [2233]
Path:            /Users/admin/opt/anaconda3/python.app/Contents/MacOS/python
Load Address:    0x103cbc000
Identifier:      com.continuum.python
Version:         ??? (???)
Code Type:       x86_64 (Native)
Parent Process:  bash [2232]
Responsible:     /bin/sh [/Users/admin/opt/anaconda3/Anaconda-Navigator.app/Contents/MacOS/run.sh]
User ID:         501

I had no problems to execute scripts in subfolders of Documents though.

One may add an executable to System Preferences > Security & Privacy > Privacy > Full disk access (see this q&a), but since too many execs may be involved, it's much simpler to create a new folder (e.g Development, Dev, Anaconda-Dev etc.) in your user folder and move your dev files & folders in there. The permission errors should disappear afterwards.