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
error: opencv4nodejs module is required to use OpenCV features. #11865
Comments
Did you read the howto document from the error message above? |
Yes sir, I did. I use a mac and I am unable to realize how to install opencv4nodejs. Can you please refer on the how to doc, what's exactly need to be done to install it. |
How did you install appium? |
Try to read https://docs.npmjs.com/ to know more about npm and NodeJS packaging system |
@KazuCocoa, I used the command npm i -g opencv4nodejs quite many times and restarted the appium. I was getting the same error again and again. (error: opencv4nodejs module is required to use OpenCV features). |
If you handle appium with |
The same problem, does anyone fix it? |
In general, this is npm(and If you manage your project with $ npm list opencv4nodejs # no opencv4nodejs
your/project
└── (empty)
$ npm list opencv4nodejs # has opencv4nodejs
your/project
└── opencv4nodejs@4.11.0 If you manage your Appium environment with $ npm list -g opencv4nodejs # no opencv4nodejs
/Users/kazuaki/.nodebrew/node/v11.4.0/lib
└── (empty)
$ npm list -g opencv4nodejs # has opencv4nodejs
/Users/kazuaki/.nodebrew/node/v10.11.0/lib
└── opencv4nodejs@4.11.0 If you cannot find correct dependencies on your local, you probably make sure your node/npm environment in order node/npm can resolve their dependencies, first. As mykola addressed in #11865 (comment) , I would recommend you to read npm documentation if you are using |
macmini550:~ vkuhi$ npm list opencv4nodejs It is in the node_modules package, how can I get access to it from my java project? |
If the If your Java project manages appium by |
I do not have any package.json in my Java project. How does the appium will know where this package located? |
it depends on npm/node. Appium depends on them to resolve dependencies. |
@vkuhi Initially I ran appium desktop app. I later (after reading the suggestions from in here) realized that the appium I am running and opencv4nodejs i installed are not from the same package/node_modules. So the shutdown the appium desktop app and verfiied the version of global appium, which was 1.7.2. I upgraded it to 1.9. Now that both appium and opencv4nodejs come from same package or node_modules, starting the appium from there solved my issue. Thanks @KazuCocoa and @mykola-mokhnach for your prompt help :-) |
Ah... I see. Thanks. I only explained about appium which is CLI tool. In desktop's case, that has its own package info. so, it can not find global opencv4nodejs. I would link appium/appium-desktop#714 |
I have same issue, node can't find opencv, working with win 10, any help will be appriciate. Appium server: I have already installed the opencv through npm, mime must be a string I am mantion that I already use install opencv in various ways: And also tried mannually, the appium doctor keep saying: But I got indication that the opencv is installed success when install from npm, |
What result can you get with |
That's the output: I am using appium server from java code, I am not using appium gui client desktop. |
thanks. |
I enter there, But honestly I have no idea what to do according that post, |
One is building Appium code. Another is waiting for the PR's release in beta building Appium from code
Or just wait for the PR will release.
|
didn't help, |
Nothing help so far.... |
Update: |
thanks. I guess node dependencies affected that... |
I have install opencv4nodejs by npm install -g opencv4nodejs. How should I install the opencv4nodejs and anything need to be configured? |
I could not find the solution for desktop appium/appium-desktop#714 You can run appium CLI separately and connect to it from the desktop app via the custom server tab in the inspector. |
@KazuCocoa , { Error: Command 'ffmpeg -version' exited with code null is FFMPEG is required by OpenCV4nodejs? or do we need tessract lib. ? (Becoz i've removed it for issue in opencv4nodejs installation) |
Simply they required |
Hi @KazuCocoa The issue got resolved and working fine, able to click on element by the image... The issue seems to be with after reinstalling got solved the issue Thanx a lot for helping me... and sparing ur valuable time... |
@adityabhargav Can you please share your steps/commands in re-installing those 3 mentioned issues ? By the way, my appium-doctor logs are below: Other info: @KazuCocoa |
Hi @sumanthvakacharla , above mentioned are node libs., and need to install w.r.t to the node_modules folder where opencv4nodejs is placed... 1.FFMPEG -- npm i ffmpeg |
[debug] �[35m[Support]�[39m Failed to load global package 'opencv4nodejs': The "path" argument must be of type string. Received undefined Still facing the issue on windows 10. Any solution for this?? |
Please explai in details how you solved this. Please? |
@suswari how you solved your issue reported here |
I have this same problem and i solver by installing cmake before trying to install opencv4nodejs with npm |
/Users/mohamedgamal/.npm-global/lib but i have the issue when run test script Executing command 'compareImages' |
the same issue when run test script xecuting command 'compareImages' |
Have you installed opencv4nodejs? |
npm list -g opencv4nodejs |
I guess your local environment refers to Latest Appium loads a npm package as https://github.com/appium/appium-support/blob/15afcad2329e872f76195120ff238450fafc3bbb/lib/node.js#L38-L64, so it calls e.g.
|
issue :- Initializing opencv thanks for your reply but i did not understand how to resolve it now |
I guess you can try to set
I haven't met the error and tried the environment, but i guess your environment has two paths for |
@KazuCocoa also i have the same issue when follow path which appeared in log /opt/homebrew/lib/node_modules/opencv4nodejs/build/Release/ |
What is the result of As i guess your environment has two paths for lib for node/npm, the root cause is probably your local configuration had two cases. One was to |
@KazuCocoa >> the result of npm config get prefix is>>>> /Users/mohamedgamal/.npm-global So i tried to link the opencv4nodejs module to appium by going to Users/mohamedgamal/.npm-globaland and running below mentioned command: npm ls -g opencv4nodejs --depth=0 && npm link opencv4nodejs /Users/mohamedgamal/.npm-global/lib /Users/mohamedgamal/node_modules/opencv4nodejs -> /Users/mohamedgamal/.npm-global/lib/node_modules/opencv4nodejs but the issue is still [debug] [XCUITest] Executing command 'compareImages' |
Btw, did the
|
@KazuCocoa
} |
@KazuCocoa but after use brew install brew install opencv@4 then npm i -g opencv4nodejs i got different issue 1 error generated.
|
@KazuCocoa. i found the same issue but i can not understand justadudewhohacks/opencv4nodejs#661 (comment) and also the same issue but i did not understand the solve |
I found my old comment about the version #15210 (comment) ( |
@KazuCocoa
info install OPENCV4NODEJS_DISABLE_AUTOBUILD is set
CXX(target) Release/obj.target/opencv4nodejs/cc/opencv4nodejs.o npm ERR! A complete log of this run can be found in: |
OpenCV is very difficult to install. I wish we didn't depend on it for these features. But we cannot support OpenCV & OpenCV4NodeJS installations. Once you have it set where opencv4nodejs can be required, then Appium will work with it. |
can. you advise me about other libraries to compare two images for same element ? |
The problem
I am trying to use appium image comparison and used the reference code
byte[] screenshot = Base64.encodeBase64(driver.getScreenshotAs(OutputType.BYTES));
OccurrenceMatchingResult result = driver
.findImageOccurrence(screenshot, partialImage, new OccurrenceMatchingOptions()
.withEnabledVisualization());
assertThat(result.getVisualization().length, is(greaterThan(0)));
assertNotNull(result.getRect());
I see the following error:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
My project is in java and I am really not sure about performing npm i -g opencv4nodejs. Should I do npm i -g opencv4nodejs under the project root, though the project doest not have package.json
Environment
Details
If necessary, describe the problem you have been experiencing in more detail.
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'ICF2008045', ip: 'fe80:0:0:0:46:b040:b1:8193%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '1.8.0_181'
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities {app: /Users/sadla/Library/Develo..., autoWebview: true, automationName: XCUITest, browserName: , bundleId: com.icfi.energystarhome, databaseEnabled: false, deviceName: iPad Air 2, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, platform: MAC, platformName: iOS, platformVersion: 11.1, takesScreenshot: true, udid: D4469918-75D5-4277-A205-808..., webStorageEnabled: false}
Session ID: 5ae7aa6a-3eb7-45a4-9458-c88296598bb7
The text was updated successfully, but these errors were encountered: