OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

PermissionError: [Errno 1] Operation not permitted after macOS Catalina Update

  • Thread starter Thread starter QQQ
  • Start date Start date
Q

QQQ

Guest
After installing macOS 10.15 Catalina I am getting the following error for simple file and directory operations in Python 3.x: "PermissionError: [Errno 1] Operation not permitted"

Several operations trigger this error including opening an existing file from the cwd using open(...,'rb'), listdir() and getcwd().

After updating to Catalina and finding that Anaconda and Spyder wouldn't open I read about some of the problems. I removed Anaconda and re-installed it in /Users/myname/ using the .sh terminal installer. Conda and Spyder now open but I still can't perform the operations above.

This works:

Code:
os.chdir(basedir)

These do not work and throw the error above:

Code:
os.getcwd()
Traceback (most recent call last):

  File "<ipython-input-3-a78b1fb2bab9>", line 1, in <module>
    os.getcwd()

PermissionError: [Errno 1] Operation not permitted


Code:
os.listdir()
Traceback (most recent call last):

  File "<ipython-input-2-67fdccf289bf>", line 1, in <module>
    os.listdir()

PermissionError: [Errno 1] Operation not permitted


Code:
f=open([pre-existing file],'rb')


However, this does NOT throw the error:

Code:
f=open('f1.txt','wb')
f.close()
f=open('f1.txt','rb')

I've already tried setting Full Disk Access permissions for Anaconda and Spyder.
<p>After installing macOS 10.15 Catalina I am getting the following error for simple file and directory operations in Python 3.x: "PermissionError: [Errno 1] Operation not permitted"</p>

<p>Several operations trigger this error including opening an existing file from the cwd using open(...,'rb'), listdir() and getcwd().</p>

<p>After updating to Catalina and finding that Anaconda and Spyder wouldn't open I read about some of the problems. I removed Anaconda and re-installed it in /Users/myname/ using the .sh terminal installer. Conda and Spyder now open but I still can't perform the operations above.</p>

<p>This works: </p>

<pre><code>os.chdir(basedir)
</code></pre>

<p>These do not work and throw the error above:</p>

<pre><code>os.getcwd()
Traceback (most recent call last):

File "<ipython-input-3-a78b1fb2bab9>", line 1, in <module>
os.getcwd()

PermissionError: [Errno 1] Operation not permitted
</code></pre>

<hr>

<pre><code>os.listdir()
Traceback (most recent call last):

File "<ipython-input-2-67fdccf289bf>", line 1, in <module>
os.listdir()

PermissionError: [Errno 1] Operation not permitted
</code></pre>

<hr>

<pre><code>f=open([pre-existing file],'rb')
</code></pre>

<hr>

<p>However, this does NOT throw the error:</p>

<pre><code>f=open('f1.txt','wb')
f.close()
f=open('f1.txt','rb')
</code></pre>

<p>I've already tried setting Full Disk Access permissions for Anaconda and Spyder.</p>
 

Online statistics

Members online
0
Guests online
4
Total visitors
4
Top