title: PermissionError: [Errno 1] Operation not permitted: '/Users/<local_path>/venv/pyvenv.cfg'
body: <p>I am running a Django application with a few cron tasks. Whenever I run <code>python manage.py crontab add</code> to register the cron tasks, I get a &quot;mail&quot; in the Terminal showing the following traceback:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site.py&quot;, line 609, in &lt;module&gt;
      main()
    File &quot;/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site.py&quot;, line 592, in main
      known_paths = venv(known_paths)
    File &quot;/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site.py&quot;, line 510, in venv
      with open(virtual_conf, encoding='utf-8') as f:
  PermissionError: [Errno 1] Operation not permitted: '/Users/&lt;local_path&gt;/venv/pyvenv.cfg'
  </code></pre>
  <p>I am running on macOS Catalina, python 3.7.3 in a virtual environment venv.</p>
  <p>I have tried giving full disk permission to bash, crontab, terminal, xcode and pycharm.</p>
  <p>I have also tried installing python versions 3.7.8 and 3.8.3</p>
  <h3>Partially solved</h3>
  <p>I disabled System Integrity Protection using <code>csrutil disable</code> in Recovery Mode and the cron ran successfully. However, I do not see it as full solution.</p>
  <h3>Final solution</h3>
  <p>I dockerized the app and ran it as a docker container.</p>