Skip to content

can't autocomplete for cv2 #606

Closed
Closed
@yuboona

Description

@yuboona

Environment data

VS Code version: 1.19.2
Python Extension version: 0.9.1
Python Version: 3.5.2
OS and version: ubuntu 16.04.02

Actual behavior

2018-01-20 14-36-17

Expected behavior

Expect more autocompletions

Steps to reproduce:

  • pip install opencv-python
  • import cv2

Some test

I did some interesting test on py-extension's jedi. I new a test.py in the path where jedi locate in extension'~/.vscode/extensions/ms-python.python-0.9.1/pythonFiles/preview/jedi'. Then I import this jedi module.

  • In VScode, I excuted the test.py with F5:
      import jedi
      print(jedi.__file__)
      print(jedi.Script("import cv2\ncv2.").completions())

Output from Console window (Help->Developer Tools menu)

~/.vscode/extensions/ms-python.python-0.9.1/pythonFiles/preview/jedi/__init__.py
ImportError: numpy.core.multiarray failed to import
[<Completion: cv2>, <Completion: data>, <Completion: haarcascades>, <Completion: importlib>, <Completion: os>, <Completion: __doc__>, <Completion: __file__>, <Completion: __name__>, <Completion: __package__>]

But when I excuted code in my Terminal using 'python test.py', the output is the correct autocompletion and this is just done by extension's jedi:
Output from Terminal
output.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions