ropensci / opencv

R bindings for OpenCV
https://docs.ropensci.org/opencv
Other
133 stars 27 forks source link

Problems with installation #3

Closed laresbernardo closed 6 years ago

laresbernardo commented 6 years ago

Hello. I have tried this library with Python and I loved it.. but I am a mostly a R person! Thanks for this library. The problem is that I can't install it.. check out the error I am getting:

devtools::install_github("ropenscilabs/opencv")
Using GitHub PAT from envvar GITHUB_PAT
Downloading GitHub repo ropenscilabs/opencv@master
from URL https://api.github.com/repos/ropenscilabs/opencv/zipball/master
Installing opencv
Downloading GitHub repo RcppCore/Rcpp@master
from URL https://api.github.com/repos/RcppCore/Rcpp/zipball/master
Installing Rcpp
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/hy/8z_f0wrn7qs4pgwqr2l4x4f40000gn/T/RtmpXYHKMg/devtools27ed29d6a8ba/RcppCore-Rcpp-b0d669e'  \
  --library='/Library/Frameworks/R.framework/Versions/3.5/Resources/library' --install-tests 

* installing *source* package ‘Rcpp’ ...
** libs
clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Date.cpp -o Date.o
clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Module.cpp -o Module.o
clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c Rcpp_init.cpp -o Rcpp_init.o
clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c api.cpp -o api.o
clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c attributes.cpp -o attributes.o
clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c barrier.cpp -o barrier.o
clang++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/libs
** R
** inst
** tests
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (Rcpp)
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/hy/8z_f0wrn7qs4pgwqr2l4x4f40000gn/T/RtmpXYHKMg/devtools27ed1b851970/ropenscilabs-opencv-2caa207'  \
  --library='/Library/Frameworks/R.framework/Versions/3.5/Resources/library' --install-tests 

* installing *source* package ‘opencv’ ...
Homebrew 1.6.7
Homebrew/homebrew-core (git revision 60e5; last commit 2018-06-07)
Using PKG_CFLAGS=-I/usr/local/opt/opencv/include
Using PKG_LIBS=-L/usr/local/opt/opencv/lib -lopencv_{stitching,superres,videostab,aruco,bgsegm,bioinspired,ccalib,dnn_objdetect,dpm,face,photo,fuzzy,hfs,img_hash,line_descriptor,optflow,reg,rgbd,saliency,stereo,structured_light,phase_unwrapping,surface_matching,tracking,datasets,dnn,plot,xfeatures2d,shape,video,ml,ximgproc,calib3d,features2d,highgui,videoio,flann,xobjdetect,imgcodecs,objdetect,xphoto,imgproc,core}
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because opencv was not found. Try installing:
 * deb: libopencv-dev (Debian, Ubuntu, etc)
 * rpm: opencv-devel (Fedora, CentOS, RHEL)
 * brew: opencv (Mac OSX)
If opencv is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a opencv.pc file.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘opencv’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/opencv’
Installation failed: Command failed (1)

Hope you know how can I fix this!! Thanks ;)

emiltb commented 6 years ago

Did you install opencv, before installing the package? Check the last part of your error message:

Configuration failed because opencv was not found. Try installing:
 * deb: libopencv-dev (Debian, Ubuntu, etc)
 * rpm: opencv-devel (Fedora, CentOS, RHEL)
 * brew: opencv (Mac OSX)
If opencv is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a opencv.pc file.

If you are on a mac you need to run brew install opencv

laresbernardo commented 6 years ago

Yes, I actually have it installed

Warning: opencv 3.4.1_5 is already installed and up-to-date
To reinstall 3.4.1_5, run `brew reinstall opencv`
bernardolares commented 6 years ago

I restarted my laptop and now it works.. thanks! 👍

sasmitamahakud commented 2 years ago

Now I am facing same problem. I reinstall it with codeblocks, still the error libopencv-core460.dll not found. I followed-"medium.com/@sourabhjigjinni/install-opencv-4-0-0-for-c-windows-7-10-code-blocks-tdm-gcc-64-dff65addf162". ![Uploading 20220721_235848.jpg…]()

sasmitamahakud commented 2 years ago

Can anyone help me