title: pyinstaller ImportError error - how to solve it?
body: <p>I have installed pyinstaller in my Linux in order to create an executable to my Python script, which runs normaly with the command:</p>
  
  <pre><code>python3 exemplo.py
  </code></pre>
  
  <p>However when I execute bellow command:</p>
  
  <pre><code>pyinstaller --onefile example.py
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>File "/home/pedro/.local/bin/pyinstaller", line 11, in &lt;module&gt;
       sys.exit(run())   File "/home/pedro/.local/lib/python2.7/site-packages/PyInstaller/__main__.py",
  line 79, in run
      import PyInstaller.building.build_main   File "/home/pedro/.local/lib/python2.7/site-packages/PyInstaller/building/build_main.py",
  line 33, in &lt;module&gt;
     from ..depend import bindepend   File "/home/pedro/.local/lib/python2.7/site-packages/PyInstaller/depend/bindepend.py",
  line 26, in &lt;module&gt;
      from . import dylib, utils   File "/home/pedro/.local/lib/python2.7/site-packages/PyInstaller/depend/utils.py",
  line 25, in &lt;module&gt;
       from ..lib.modulegraph import util, modulegraph   File "/home/pedro/.local/lib/python2.7/site-packages/PyInstaller/lib/modulegraph/util.py",
  line 16, in &lt;module&gt;
       from ._compat import StringIO, BytesIO, get_instructions, _READ_MODE   File "/home/pedro/.local/lib/python2.7/site-packages/PyInstaller/lib/modulegraph/_compat.py",
  line 29, in &lt;module&gt;
       from dis3 import get_instructions ImportError: No module named dis3
  </code></pre>
  
  <p>What is wrong?</p>
  
  <p>I tried to install dis3:</p>
  
  <pre><code>python3 -m pip install --user dis3
  </code></pre>
  
  <p>But I still get the same error.</p>
  
  <p>I uninstalled it ...</p>
  
  <pre><code>python -m pip uninstall pyinstaller
  </code></pre>
  
  <p>Installed again as recommended. </p>
  
  <pre><code>python3 -m pip install --user pyinstaller
  </code></pre>
  
  <p>I have set the PATH variable:</p>
  
  <pre><code>echo $PATH
  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/pedro/.local/bin
  </code></pre>
  
  <p>Now I get the message:</p>
  
  <pre><code>pedro@pedro-pc:~/Documents/instabot/instabot_c.py$ python -m pyinstaller --onefile example.py
  /usr/bin/python: No module named pyinstaller
  </code></pre>
  
  <p>Indeed ... it does not appear on pip list:</p>
  
  <pre><code>pedro@pedro-pc:~/Documents/instabot/instabot_c.py/__pycache__$ pip list
  /home/pedro/.local/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
    warnings.warn(warning, RequestsDependencyWarning)
  Package        Version               
  -------------- ----------------------
  altgraph       0.16.1                
  arandr         0.1.9                 
  beautifulsoup4 4.4.1                 
  certifi        2018.10.15            
  chardet        3.0.4                 
  cryptography   1.2.3                 
  defer          1.0.6                 
  enum34         1.1.2                 
  fake-useragent 0.1.11                
  future         0.17.1                
  html5lib       0.999                 
  idna           2.7                   
  ipaddress      1.0.16                
  lxml           3.5.0                 
  macholib       1.11                  
  numpy          1.11.0                
  pefile         2018.8.8              
  pip            18.1                  
  psutil         3.4.2                 
  pyasn1         0.1.9                 
  pycurl         7.43.0                
  Pygments       2.1                   
  pygobject      3.20.0                
  pyOpenSSL      0.15.1                
  pysqlite       2.7.0                 
  python-apt     1.1.0b1+ubuntu0.16.4.2
  python-debian  0.1.27                
  pyxdg          0.25                  
  requests       2.20.0                
  scour          0.32                  
  setuptools     20.7.0                
  six            1.10.0                
  urllib3        1.24                  
  wheel          0.29.0   
  </code></pre>
  
  <p>What is wrong?</p>