Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Microsoft Python language server crashes due to scipy?? why? #456

Closed
mehditlili opened this issue Dec 5, 2018 · 4 comments
Closed

Microsoft Python language server crashes due to scipy?? why? #456

mehditlili opened this issue Dec 5, 2018 · 4 comments
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@mehditlili
Copy link

mehditlili commented Dec 5, 2018

Kind of confusing, how can a third-party lib make the language server crash?
I am using it on VSCode 1.28.1, and I have python-scipy 0.17.0-1 installed from the normal Ubuntu 16.04 packages repository.
Here is the error log:

Starting Microsoft Python language server.
##########Linting Output - pep8##########
Microsoft Python Language Server version 0.1.66.0
Initializing for /usr/bin/python
[Error - 12:50:58 PM] System.IO.FileNotFoundException: Could not find file '/usr/lib/python2.7/dist-packages/scipy/_lib/decorator.py'.
File name: '/usr/lib/python2.7/dist-packages/scipy/_lib/decorator.py'
   at Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter.ImportModule(String name)
   at Microsoft.PythonTools.Analysis.ModuleTable.TryImport(String name, ModuleReference& moduleReference)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.TryImportModule(String modName, Boolean forceAbsolute, ModuleReference& moduleRef, IReadOnlyList`1& remainingParts)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(FromImportStatement node)
   at Microsoft.PythonTools.Parsing.Ast.FromImportStatement.Walk(PythonWalker walker)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node)
   at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker)
   at Microsoft.PythonTools.Parsing.Ast.PythonAst.Walk(PythonWalker walker)
   at Microsoft.PythonTools.Analysis.AnalysisUnit.AnalyzeWorker(DDG ddg, CancellationToken cancel)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.Analyze(Deque`1 queue, CancellationToken cancel, Action`1 reportQueueSize, Int32 reportQueueInterval)
   at Microsoft.PythonTools.Analysis.PythonAnalyzer.AnalyzeQueuedEntries(CancellationToken cancel)
   at Microsoft.PythonTools.Intellisense.AnalysisQueue.GroupAnalysis.Analyze(CancellationToken cancel)
   at Microsoft.PythonTools.Intellisense.AnalysisQueue.HandleAnalyzable(IAnalyzable item, AnalysisPriority priority, CancellationToken cancellationToken)
   at Microsoft.PythonTools.Intellisense.AnalysisQueue.ConsumerLoop()
@MikhailArkhipov
Copy link

Probably should be handling this?

@MikhailArkhipov
Copy link

Probably just add handling of IOException and return null.

@MikhailArkhipov MikhailArkhipov added the bug Something isn't working label Dec 19, 2018
@mehditlili
Copy link
Author

mehditlili commented Jan 21, 2019

If this can help, I tried reinstallin scipy and noticed this:

sudo apt install --reinstall python-scipy
[sudo] password for mehdi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 36 not upgraded.
Need to get 8,733 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://packages.magazino.local/ubuntu xenial/main amd64 python-scipy amd64 0.17.0-1 [8,733 kB]
Fetched 8,733 kB in 1s (8,331 kB/s)
(Reading database ... 740165 files and directories currently installed.)
Preparing to unpack .../python-scipy_0.17.0-1_amd64.deb ...
Unpacking python-scipy (0.17.0-1) over (0.17.0-1) ...
Setting up python-scipy (0.17.0-1) ...
W: pycompile:160: dangling symlink skipped: /usr/lib/python2.7/dist-packages/scipy/_lib/decorator.py (../../decorator.py)

that decorator.py is what is causing the python server to crash

I could solve the problem by running

sudo apt install --reinstall python-six python-decorator
sudo apt install --reinstall python-scipy

After resintalling six and decorator, scipy didn't complain anymore about the dangling symlink, and visual code could load the python language server correctly.

@MikhailArkhipov MikhailArkhipov added the duplicate This issue or pull request already exists label Feb 9, 2019
@MikhailArkhipov
Copy link

Looks the same as #522

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants