Skip to content

fix "ImportError: DLL load failed while importing cv2" while installing from pre-built binaries#23321

Merged
asmorkalov merged 1 commit intoopencv:3.4from
a-sajjad72:patch-1
Apr 2, 2023
Merged

fix "ImportError: DLL load failed while importing cv2" while installing from pre-built binaries#23321
asmorkalov merged 1 commit intoopencv:3.4from
a-sajjad72:patch-1

Conversation

@a-sajjad72
Copy link
Copy Markdown

@a-sajjad72 a-sajjad72 commented Mar 2, 2023

after copying the cv2.pyd file to the site-packages directory python interpreter shows error
"ImportError: DLL load failed while importing cv2: The specified module could not be found." when installing using pre-built binaries as discussed in the #22072

file opencv_world.dll also need to be copied.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov added the category: documentation Documentation fix or update label Mar 3, 2023
@asmorkalov asmorkalov self-requested a review March 21, 2023 15:24
@asmorkalov asmorkalov self-assigned this Mar 21, 2023
@asmorkalov asmorkalov added the pr: needs rebase Rebase patch (and squash fixup commits) on the top of target branch label Mar 21, 2023
@asmorkalov
Copy link
Copy Markdown
Contributor

The same issue exists in 3.4 branch too. Please rebase the branch on top of 3.4 and re-target the PR to 3.4.

@asmorkalov
Copy link
Copy Markdown
Contributor

Also OpenCV build may contain other dynamic libraries, not only opencv_world.dll. They should be copied too.

@a-sajjad72
Copy link
Copy Markdown
Author

Also OpenCV build may contain other dynamic libraries, not only opencv_world.dll. They should be copied too.

but the issue is resolved by copying just only opencv_world.dll. but i'll still try to figure out which dynamic libraries should be copied too.

@a-sajjad72 a-sajjad72 changed the title fix "ImportError: DLL load failed while importing cv2" fix "ImportError: DLL load failed while importing cv2" while installing from pre-built binaries Mar 27, 2023
@a-sajjad72 a-sajjad72 changed the base branch from 4.x to 3.4 March 27, 2023 01:47
@asmorkalov asmorkalov removed the pr: needs rebase Rebase patch (and squash fixup commits) on the top of target branch label Apr 2, 2023
@asmorkalov asmorkalov added this to the 3.4.20 milestone Apr 2, 2023
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@asmorkalov asmorkalov merged commit 57460b1 into opencv:3.4 Apr 2, 2023
@asmorkalov asmorkalov mentioned this pull request Apr 20, 2023
@asmorkalov asmorkalov mentioned this pull request May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: documentation Documentation fix or update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants