title: networkx installed but cannot import: No module named 'networkx'
body: <p>I installed networkx with <code>pip</code> using this command:</p>
  <pre><code>[JohnRambo@Machine ~]$ pip install networkx
  </code></pre>
  <p>Just to show you, by using <code>pip install networkx</code>, it says it is already installed:</p>
  <pre><code>Requirement already satisfied: networkx in ./anaconda3/lib/python3.7/site-packages (2.6.2)
  </code></pre>
  <p>However, when I try to import networkx into python</p>
  <pre><code>import networkx as nx
  </code></pre>
  <p>I get this message:</p>
  <pre><code>ModuleNotFoundError: No module named 'networkx'
  </code></pre>
  <p>In addition, also by trying with (<a href="https://networkx.org/documentation/latest/install.html" rel="nofollow noreferrer">pytest networkx</a>)</p>
  <pre><code>[JohnRambo@Machine ~]$ pytest networkx
  </code></pre>
  <p>I get the error <code>file not found: networkx</code>, as shown here below:</p>
  <pre><code>============================= test session starts ==============================
  platform linux -- Python 3.7.7, pytest-3.8.0, py-1.6.0, pluggy-0.7.1
  rootdir: /home/JohnRambo, inifile:
  plugins: remotedata-0.3.0, openfiles-0.3.0, doctestplus-0.1.3, arraydiff-0.2
  
  ========================= no tests ran in 0.01 seconds =========================
  ERROR: file not found: networkx
  </code></pre>
  <p><strong>Any idea on how to fix it?</strong></p>
  <p>Additional information, if it can be useful:</p>
  <pre><code>[JohnRambo@Machine ~]$ python -V
  Python 3.7.7
  
  [JohnRambo@Machine ~]$ python3 -V 
  Python 3.7.7
  
  [JohnRambo@Machine ~]$ pip --version 
  pip 21.1.3 from /home/JohnRambo/anaconda3/lib/python3.7/site-packages/pip (python 3.7) 
  
  [JohnRambo@Machine ~]$ pip3 --version 
  pip 21.1.3 from /home/JohnRambo/anaconda3/lib/python3.7/site-packages/pip (python 3.7)
  
  [JohnRambo@Machine ~]$ which python 
  ~/anaconda3/bin/python 
  
  [JohnRambo@Machine ~]$ which python3 
  ~/anaconda3/bin/python3 
  
  [JohnRambo@Machine ~]$ which pip 
  ~/anaconda3/bin/pip 
  
  [JohnRambo@Machine ~]$ which pip3 
  ~/anaconda3/bin/pip3
  
  [JohnRambo@Machine ~]$ which pytest 
  ~/anaconda3/bin/pytest
  </code></pre>