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

Autocomplete does not work properly for some libraries #4859

Closed
ghost opened this issue Jul 30, 2017 · 8 comments
Closed

Autocomplete does not work properly for some libraries #4859

ghost opened this issue Jul 30, 2017 · 8 comments

Comments

@ghost
Copy link

ghost commented Jul 30, 2017

Description of your problem

Autocomplete does not work properly for some libraries. So if we "import numpy", we can later use "numpy.autocomplete". But if we deal with cv2, things are different.

Example bellow

What steps will reproduce the problem?

1.1. import cv2
1.2. cv2.autocomplete suggest cv2
1.3. cv2.cv2.no autocomplete

So does not work.

But:
2.1. import cv2 as cv2
2.2. cv2.autocomplete suggest cv2
2.3. cv2.cv2.autocomplete for cv2

So this one gets me there, but with an extra step. And I cannot run like that, I need to remove extra cv2

What is the expected output? What do you see instead?

In a case of "2.3" I can get autocomplete that I need, but I need to remember to delete this extra cv2. Basically, I want to get cv2.autocomplete for cv2

Additional information

This issue only happens in the editor. Console works fine.

Versions and main components

  • Spyder Version: 3.2.0
  • Python Version: 3.5.3. 64bit
  • Qt Version: 5.6.2
  • PyQt Version: 5.6
  • Operating system: Windows 10

Dependencies

IPython >=4.0 : 6.1.0 (OK)
cython >=0.21 : 0.26 (OK)
jedi >=0.9.0 : 0.9.0 (OK)
nbconvert >=4.0 : 5.2.1 (OK)
numpy >=1.7 : 1.13.1 (OK)
pandas >=0.13.1 : 0.20.3 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.5.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.6.4 (OK)
qtconsole >=4.2.0: 4.3.0 (OK)
rope >=0.9.4 : 0.10.5 (OK)
sphinx >=0.6.6 : 1.3.1 (OK)
sympy >=0.7.3 : 1.1.1 (OK)

@ccordoba12
Copy link
Member

@andfoy, can you reproduce this on Windows?

@andfoy
Copy link
Member

andfoy commented Aug 9, 2017

This is an actual error related to the packaging of OpenCV, while jedi and other autocompletion engines make suggestions based on the contents of plain python sources, OpenCV is a compiled library packaged on a pyd file that cannot be analysed, unfortunately. We're not the only editor that presents this issue:

https://stackoverflow.com/questions/18672087/autocomplete-for-opencv-python-in-windows-not-working

https://stackoverflow.com/questions/43093400/code-completion-is-not-working-for-opencv-and-python

autocomplete-python/autocomplete-python#268

https://stackoverflow.com/questions/43231766/visual-studio-weird-behavior-of-auto-complete-for-opencv-python

@yaceben
Copy link

yaceben commented Aug 12, 2017

Does not work for any libraries for me, e.g. pattern, numpy, nltk, etc.

Python 2.7.13 64bits, Qt 5.6.2, PyQt5 5.6 on Linux (Fedora 24) installed through pip.

IPython >=4.0;<6.0:  5.4.1 (OK)
cython >=0.21     :  0.26 (OK)
jedi >=0.9.0      :  0.10.2 (OK)
nbconvert >=4.0   :  5.2.1 (OK)
numpy >=1.7       :  1.11.0 (OK)
pandas >=0.13.1   :  0.18.0 (OK)
psutil >=0.3      :  5.2.2 (OK)
pycodestyle >=2.3 :  2.3.1 (OK)
pyflakes >=0.5.0  :  1.6.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
pylint >=0.25     :  1.7.2 (OK)
qtconsole >=4.2.0 :  4.3.0 (OK)
rope >=0.9.4      :  0.10.5 (OK)
sphinx >=0.6.6    :  1.6.3 (OK)
sympy >=0.7.3     :  1.0 (OK)

Did not try Python 3.5 yet as pattern library is incompatible.

@andfoy
Copy link
Member

andfoy commented Aug 12, 2017

@yaceben I think your error is unrelated to this issue (Precompiled library autocompletion). Please open a new issue with this information

@yaceben
Copy link

yaceben commented Aug 12, 2017

@andfoy Alright, will do. Thanks

@andfoy
Copy link
Member

andfoy commented Aug 14, 2017

@ccordoba, I think we should close this one

@bcolsen
Copy link
Member

bcolsen commented Dec 19, 2017

I can't reproduce this using latest anaconda and spyder master.

cv complete

@ccordoba12 ccordoba12 modified the milestones: v3.2.6, v3.2.7 Dec 29, 2017
@ccordoba12 ccordoba12 modified the milestones: v3.2.7, v3.2.8 Jan 8, 2018
@ccordoba12 ccordoba12 modified the milestones: v3.2.8, v3.2.9 Mar 3, 2018
@ccordoba12 ccordoba12 modified the milestones: v3.3, v3.3.1 May 22, 2018
@ccordoba12 ccordoba12 modified the milestones: v3.3.1, v3.3.2 Jul 15, 2018
@ccordoba12 ccordoba12 modified the milestones: v3.3.2, v4.0beta3 Aug 18, 2018
@ccordoba12 ccordoba12 modified the milestones: v4.0beta3, v4.0beta4 May 18, 2019
@ccordoba12 ccordoba12 modified the milestones: v4.0betaX, 4.0.1 Aug 10, 2019
@ccordoba12 ccordoba12 removed this from the 4.0.1 milestone Nov 6, 2019
@ccordoba12
Copy link
Member

It seems this is solved now, as @MadsDyrmann pointed out.

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

4 participants