title: Unable to install PyTorch in PyCharm (Python 3.9 / macOS)
body: <p>Environment:</p>
  <ul>
  <li>pip version: 20.2.4</li>
  <li>interpreter: Python 3.9.0</li>
  <li>OS: macOS Big Sur</li>
  <li>Everything else is also up to date</li>
  </ul>
  <p>I tried the following commands in the Terminal and none worked:</p>
  <ul>
  <li>pip install torch</li>
  <li>pip3 install torch</li>
  <li>pip install torch torchvision torchaudio</li>
  </ul>
  <p>I get different error messages for each command, but this is the output of &quot;pip install torch&quot;:</p>
  <pre><code>Collecting torch
    Using cached torch-0.1.2.post2.tar.gz (128 kB)
  Requirement already satisfied: pyyaml in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from torch) (5.3.1)
  Using legacy 'setup.py install' for torch, since package 'wheel' is not installed.
  Installing collected packages: torch
      Running setup.py install for torch: started
      Running setup.py install for torch: finished with status 'error'
  
  DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
      ERROR: Command errored out with exit status 1:
       command: /usr/local/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/private/var/folders/jz/bbl56kxj3tl_wssc22lnxqmc0000gn/T/pycharm-packaging/torch/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/private/var/folders/jz/bbl56kxj3tl_wssc22lnxqmc0000gn/T/pycharm-packaging/torch/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' install --record /private/var/folders/jz/bbl56kxj3tl_wssc22lnxqmc0000gn/T/pip-record-92u0tiue/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/torch
           cwd: /private/var/folders/jz/bbl56kxj3tl_wssc22lnxqmc0000gn/T/pycharm-packaging/torch/
      Complete output (23 lines):
      running install
      running build_deps
      Traceback (most recent call last):
        File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
        File &quot;/private/var/folders/jz/bbl56kxj3tl_wssc22lnxqmc0000gn/T/pycharm-packaging/torch/setup.py&quot;, line 225, in &lt;module&gt;
          setup(name=&quot;torch&quot;, version=&quot;0.1.2.post2&quot;,
        File &quot;/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/__init__.py&quot;, line 153, in setup
          return distutils.core.setup(**attrs)
        File &quot;/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py&quot;, line 148, in setup
          dist.run_commands()
        File &quot;/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py&quot;, line 966, in run_commands
          self.run_command(cmd)
        File &quot;/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py&quot;, line 985, in run_command
          cmd_obj.run()
        File &quot;/private/var/folders/jz/bbl56kxj3tl_wssc22lnxqmc0000gn/T/pycharm-packaging/torch/setup.py&quot;, line 99, in run
          self.run_command('build_deps')
        File &quot;/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py&quot;, line 313, in run_command
          self.distribution.run_command(command)
        File &quot;/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py&quot;, line 985, in run_command
          cmd_obj.run()
        File &quot;/private/var/folders/jz/bbl56kxj3tl_wssc22lnxqmc0000gn/T/pycharm-packaging/torch/setup.py&quot;, line 51, in run
          from tools.nnwrap import generate_wrappers as generate_nn_wrappers
      ModuleNotFoundError: No module named 'tools.nnwrap'
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /usr/local/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/private/var/folders/jz/bbl56kxj3tl_wssc22lnxqmc0000gn/T/pycharm-packaging/torch/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/private/var/folders/jz/bbl56kxj3tl_wssc22lnxqmc0000gn/T/pycharm-packaging/torch/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' install --record /private/var/folders/jz/bbl56kxj3tl_wssc22lnxqmc0000gn/T/pip-record-92u0tiue/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/torch Check the logs for full command output.
  </code></pre>