Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError when running code analysis on Windows installer #15452

Closed
usmanhamid444 opened this issue Apr 28, 2021 · 5 comments
Closed

Comments

@usmanhamid444
Copy link

Description

What steps will reproduce the problem?

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

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)
@dalthviz
Copy link
Member

Hi @usmanhamid444 thanks for the feedback! Could you provide us a code example to reproduce this in our side? Thanks!

@usmanhamid444
Copy link
Author

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))

@dalthviz
Copy link
Member

Thanks for the example code @usmanhamid444 I was able to reproduce this using the Windows installer, we will check it in a future release

@dalthviz
Copy link
Member

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

@dalthviz dalthviz modified the milestones: v5.x, v5.0.2, v5.0.3 Apr 30, 2021
@dalthviz
Copy link
Member

dalthviz commented May 1, 2021

Note: #15466 could also be related with something similar but when using the Profiler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants