title: How to solve the ValueError importing torch in python
body: <p>After installing pytorch package, I have tried to import pytorch with</p>
  <pre><code>import torch
  </code></pre>
  <p>but got the error</p>
  <pre><code>Traceback (most recent call last):
    File &quot;&lt;console&gt;&quot;, line 1, in &lt;module&gt;
    File &quot;c:\users\user\appdata\local\programs\python\python38\lib\site-packages\torch\__init__.py&quot;, line 190, in &lt;module&gt;
      from torch._C import *
  ValueError: module functions cannot set METH_CLASS or METH_STATIC
  </code></pre>
  <p>from searching, I have read that this could be about numpy. So I have tried uninstalling and installing with those</p>
  <pre><code>pip uninstall numpy
  pip install numpy -I
  pip install numpy -U
  </code></pre>
  <p>It didn't work.</p>
  <p>I would be happy to hear from you if you have any idea why such an error occurs and how to correct it?</p>
  <p>in case needed: Python version 3.8.6 ,
  torch version 1.7.0 ,
  numpy version 1.19.4</p>