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 is still not working on pycharm. #821

Closed
3 of 4 tasks
zihaomu opened this issue Mar 20, 2023 · 14 comments
Closed
3 of 4 tasks

Autocomplete is still not working on pycharm. #821

zihaomu opened this issue Mar 20, 2023 · 14 comments

Comments

@zihaomu
Copy link
Member

zihaomu commented Mar 20, 2023

Expected behaviour

Autocomplete is still not working on pycharm.

Steps to reproduce

Test it with Apple M1, PyCharm.
And the opencv-version:
4.7.0.68 and 4.7.0.72 are both not working.

Related discuss: https://stackoverflow.com/a/75054982/14419009

Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python
@perspicacitee
Copy link

How it solved, can I get some advice, plz

@xucian
Copy link

xucian commented Mar 31, 2023

any updates?

@775124946
Copy link

me too

@775124946
Copy link

me too

pip install opencv-python
pip install opencv-contrib-python

success ~~

@Gornoka
Copy link
Contributor

Gornoka commented Apr 27, 2023

Workaround for Windows is to create a hard link from the site-packages folder to the binary file mentioned in the linked discussion.

be aware that 'mklink' is only available in the old windows command line.

cd <your_venv_location>/Lib/site-packages
mklink /H cv2.pyd cv2\cv2.pyd

@damonmaria
Copy link

On MacOS (M1) I had to symlink the cv2.abi3.so file into the site-packages dir:

cd <venv>/lib/python3.8/site-packages
ln -s cv2/cv2.abi3.so

@kylefmohr
Copy link

On MacOS (M1) I had to symlink the cv2.abi3.so file into the site-packages dir:

cd <venv>/lib/python3.8/site-packages
ln -s cv2/cv2.abi3.so

Thanks, this also does the trick on my Intel Mac. I ran:

ln -s /Users/kyle/PycharmProjects/animation-processing/venv/lib/python3.11/site-packages/cv2/cv2.abi3.so /Users/kyle/PycharmProjects/animation-processing/venv/lib/python3.11/site-packages/

And then I also needed to invalidate caches in PyCharm before autocomplete started working (File -> Invalidate Caches)

@damonmaria
Copy link

@kylefmohr I'm doing this in IDEA where the symlink gets picked up automatically.

But an issue with the symlink is pipenv often seems to clear it away and I have to re-add the symlink fairly often.

@Gornoka
Copy link
Contributor

Gornoka commented May 23, 2023

I now had access to a test system with Linux/AMD64, and the workaround also works there.

Linux and Mac (thanks to @damonmaria):

cd <your_venv>/lib/<your_python_version>/site-packages
ln -s cv2/cv2.abi3.so

Windows (old windows cmd line)

cd <your_venv_location>/Lib/site-packages
mklink /H cv2.pyd cv2\cv2.pyd

@damonmaria
Copy link

Linux and Mac (thanks to @damonmaria):

cd <your_venv>/lib/<your_python_version>/site-packages
ln -s cv2/cv2.abi3.so

I do find you have to recreate it fairly often (with pipenv anyway). But still worth it.

@Gornoka
Copy link
Contributor

Gornoka commented May 23, 2023

Linux and Mac (thanks to @damonmaria):

cd <your_venv>/lib/<your_python_version>/site-packages
ln -s cv2/cv2.abi3.so

I do find you have to recreate it fairly often (with pipenv anyway). But still worth it.

I normally use venv, which does not appear to have this problem.

@asmorkalov
Copy link
Collaborator

@Gornoka
Copy link
Contributor

Gornoka commented Jun 23, 2023

Thanks a @asmorkalov lot for working on a fix for that, do you happen to know when we can expect the next release of the Python package?

@asmorkalov
Copy link
Collaborator

In good luck - next week. Main OpenCV release will happen first, OpenCV-Python in a couple of days.

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

8 participants