Repository: spyder-ide/spyder

Issue:
ModuleNotFoundError when running code analysis on Windows installer
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

Hello, 
I do not know why this "Issue Reporter" pop-up appears every time when I run "Code Analysis". Previously, when I was executing my code, it was appearing when plot appear. At that I was using "matplotlib" for plotting. Please help me fix this problem. 

Thanks, 
Usman 

### Traceback
```python-traceback
pylint error:

Traceback (most recent call last):
  File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\runpy.py", line 193, in _run_module_as_main
  File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\runpy.py", line 85, in _run_code
  File "C:\Users\Usman Hamid\AppData\Local\Programs\Spyder\pkgs\pylint\__main__.py", line 9, in <module>
    pylint.run_pylint()
  File "C:\Users\Usman Hamid\AppData\Local\Programs\Spyder\pkgs\pylint\__init__.py", line 21, in run_pylint
    from pylint.lint import Run as PylintRun
  File "C:\Users\Usman Hamid\AppData\Local\Programs\Spyder\pkgs\pylint\lint\__init__.py", line 75, in <module>
    from pylint.lint.parallel import check_parallel
  File "C:\Users\Usman Hamid\AppData\Local\Programs\Spyder\pkgs\pylint\lint\parallel.py", line 7, in <module>
    from pylint import reporters
  File "C:\Users\Usman Hamid\AppData\Local\Programs\Spyder\pkgs\pylint\reporters\__init__.py", line 24, in <module>
    from pylint import utils
  File "C:\Users\Usman Hamid\AppData\Local\Programs\Spyder\pkgs\pylint\utils\__init__.py", line 45, in <module>
    from pylint.utils.ast_walker import ASTWalker
  File "C:\Users\Usman Hamid\AppData\Local\Programs\Spyder\pkgs\pylint\utils\ast_walker.py", line 6, in <module>
    from astroid import nodes
  File "C:\Users\Usman Hamid\AppData\Local\Programs\Spyder\pkgs\astroid\__init__.py", line 41, in <module>
    import enum
ModuleNotFoundError: No module named 'enum'

```

## Versions

* Spyder version: 5.0.0 
* Python version: 3.7.9
* Qt version: 5.12.10
* PyQt5 version: 5.12.3
* Operating System: Windows 10

### Dependencies

```

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree                  :  None (OK)
IPython >=7.6.0               :  7.22.0 (OK)
jedi =0.17.2                  :  0.17.2 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.0.1 (OK)
nbconvert >=4.0               :  6.0.7 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
paramiko >=2.4.0              :  2.7.2 (OK)
parso =0.7.0                  :  0.7.0 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.8.1 (OK)
pylint >=1.0                  :  2.7.4 (OK)
pyls >=0.36.2;<1.0.0          :  0.36.2 (OK)
pyls_black >=0.4.6            :  0.4.6 (OK)
pyls_spyder >=0.3.2           :  0.3.2 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=0.5.7             :  1.0.2 (OK)
qtconsole >=5.0.3             :  5.0.3 (OK)
qtpy >=1.5.0                  :  1.9.0 (OK)
rtree >=0.8.3                 :  0.9.4 (OK)
setuptools >=39.0.0           :  54.2.0 (OK)
sphinx >=0.6.6                :  3.5.3 (OK)
spyder_kernels >=2.0.1,<2.1.0 :  2.0.1 (NOK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog                      :  1.0.2 (OK)
zmq >=17                      :  22.0.3 (OK)

# Optional:
cython >=0.21                 :  0.29.22 (OK)
matplotlib >=2.0.0            :  3.4.1 (OK)
numpy >=1.7                   :  1.19.3 (OK)
pandas >=1.1.1                :  1.2.3 (OK)
scipy >=0.17.0                :  1.6.2 (OK)
sympy >=0.7.3                 :  1.7.1 (OK)
```



Discussion:
Hi @usmanhamid444 thanks for the feedback! Could you provide us a code example to reproduce this in our side? Thanks!
I am facing this problem in almost every program. You may use this code and run "Code Analysis".  My Spyder version is 5.0.0. 

def Usm(test = 78.0):
    print('Usman =', test)

print(Usm(90.0))
Thanks for the example code @usmanhamid444 I was able to reproduce this using the Windows installer, we will check it in a future release
Note: Seems like the line causing this is inside Pylint when it modifies `sys.path` at line 8 `pylint.modify_sys_path()` inside `pylint\__main__.py`
Note: https://github.com/spyder-ide/spyder/issues/15466 could also be related with something similar but when using the Profiler

Resolving patch:
diff --git a/installers/Windows/installer.py b/installers/Windows/installer.py
--- a/installers/Windows/installer.py
+++ b/installers/Windows/installer.py
@@ -101,6 +101,7 @@
 files={package_dist_info} > $INSTDIR/pkgs
     black-20.8b1.dist-info > $INSTDIR/pkgs
     __main__.py > $INSTDIR/pkgs/jedi/inference/compiled/subprocess
+    __init__.py > $INSTDIR/pkgs/pylint
     lib
     tcl86t.dll > $INSTDIR/pkgs
     tk86t.dll > $INSTDIR/pkgs
@@ -353,6 +354,11 @@ def run(python_version, bitness, repo_root, entrypoint, package, icon_path,
                 "installers/Windows/assets/jedi/__main__.py",
                 os.path.join(work_dir, "__main__.py"))
 
+            print("Copying patched __init__.py for Pylint")
+            shutil.copy(
+                "installers/Windows/assets/pylint/__init__.py",
+                os.path.join(work_dir, "__init__.py"))
+
             print("Copying required assets for Tkinter to work")
             shutil.copytree(
                 "installers/Windows/assets/tcl/lib",


Test patch: