title: PermissionError: [Errno 13] Permission denied: Python
body: <p>I have a script that is called from DJango, but it doesn't execute instead it gives <code>PermissionError: [Errno 13] Permission denied</code>. I'm using CMD on Windows as admin.</p>
  <p>Here is how I'm calling:</p>
  <pre><code>cmd = os.path.join(os.getcwd(), &quot;D:/commerceTest/cs50-commerceM/Photo/GFPGAN/inference_gfpgan.py --upscale 2 --model_path D:/commerceTest/cs50-commerceM/Photo/GFPGAN/experiments/pretrained_models/ --test_path inputs/whole_imgs/GFPGANCleanv1-NoCE-C2.pth --save_root D:/commerceTest/cs50-commerceM/Photo/GFPGAN/results&quot;)
          #os.system(&quot;python D:/commerceTest/cs50-commerceM/Photo/GFPGAN/inference_gfpgan.py --upscale 2 --model_path D:/commerceTest/cs50-commerceM/Photo/GFPGAN/experiments/pretrained_models/ --test_path inputs/whole_imgs/GFPGANCleanv1-NoCE-C2.pth --save_root D:/commerceTest/cs50-commerceM/Photo/GFPGAN/results&quot;)
  os.system('{} {}'.format('python', cmd))
  </code></pre>
  <p>Here is the message I received:</p>
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File &quot;D:\commerceTest\cs50-commerceM\Photo\GFPGAN\inference_gfpgan.py&quot;, line 98, in &lt;module&gt;
      main()
    File &quot;D:\commerceTest\cs50-commerceM\Photo\GFPGAN\inference_gfpgan.py&quot;, line 52, in main
      restorer = GFPGANer(
    File &quot;D:\commerceTest\cs50-commerceM\Photo\GFPGAN\gfpgan\utils.py&quot;, line 60, in __init__
      loadnet = torch.load(model_path)
    File &quot;D:\Users\rapha\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py&quot;, line 594, in load
      with _open_file_like(f, 'rb') as opened_file:
    File &quot;D:\Users\rapha\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py&quot;, line 230, in _open_file_like
      return _open_file(name_or_buffer, mode)
    File &quot;D:\Users\rapha\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py&quot;, line 211, in __init__
      super(_open_file, self).__init__(open(name, mode))
  PermissionError: [Errno 13] Permission denied: 'D:/commerceTest/cs50-commerceM/Photo/GFPGAN/experiments/pretrained_models/'
  </code></pre>