title: Why does reading an image from OpenCV python samples giving error where as it does not give error in c++?
body: <p>I am trying to read an image in opencv python  </p>
  
  <pre class="lang-py prettyprint-override"><code>import cv2
  import numpy as np
  
  # Read images
  image=cv2.imread(cv2.samples.findFile("lena.jpg"))
  cv2.imshow("image",image)
  cv2.waitKey(0)
  </code></pre>
  
  <p>and it gives the following error</p>
  
  <pre><code>[ WARN:0] global C:\projects\opencv-python\opencv\modules\core\src\utils\samples.cpp (59) cv::samples::findFile cv::samples::findFile('lena.jpg') =&gt; ''
  Traceback (most recent call last):
    File "D:/all_libraries/main.py", line 5, in &lt;module&gt;
      image=cv2.imread(cv2.samples.findFile("lena.jpg"))
  cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\core\src\utils\samples.cpp:62: error: (-2:Unspecified error) OpenCV samples: Can't find required data file: lena.jpg in function 'cv::samples::findFile'
  
  </code></pre>
  
  <p>where as the  C++ version of this does not give any error</p>
  
  <pre><code>
  #include &lt;iostream&gt;
  
  #include &lt;opencv2/core.hpp&gt;
  #include &lt;opencv2/ml.hpp&gt;
  #include &lt;opencv2/highgui.hpp&gt;
  
  using namespace std;
  using namespace cv;
  using namespace cv::ml;
  int main()
  {
  
      Mat image;
      image=imread(samples::findFile("lena.jpg"));
      imshow("lena.jpg",image);
      waitKey(0);
  
      return 0;
  }
  
  </code></pre>
  
  <p>I have installed OpenCV 4.1.1 in  pycharm 
  c++ version is also 4.1.1
  operating system Windows</p>