# Doesn't working image window

**URL:** <https://forum.opencv.org/t/doesnt-working-image-window/12611>\
**Category:** Python\
**Tags:** programming, pycharm\
**Created:** [March 30, 2023, 4:22pm UTC](https://forum.opencv.org/t/doesnt-working-image-window/12611 "2023-03-30T16:22:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![evilmonkey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/evilmonkey/32/7538_2.png) [@evilmonkey](https://forum.opencv.org/u/evilmonkey)\
**Post date:** [March 30, 2023, 4:22pm UTC](https://forum.opencv.org/t/doesnt-working-image-window/12611/1 "2023-03-30T16:22:23Z")

</div>

Hello  
I’m practicing coding in opencv pycham.  
I want to load the image, and I specified the exact path name,  
The image window does not appear.  
I’ve tried various methods, but I can’t load all the images.  
Please help me. Thank you.

```auto
import cv2
import numpy as np

src = cv2.imread("newproject/Lena.png")

cv2.imshow('src', src)
cv2.waitKey(0)
cv2.destroyAllWindows()

```

and error is

C:\Users\ㅇㅇㅇ\PycharmProjects\newproject\venv\Scripts\python.exe C:\Users\ㅇㅇㅇ\PycharmProjects\newproject\openopic.py  
[WARN:0@0.027] global loadsave.cpp:244 cv::findDecoder imread\_(‘newproject/Lena.png’): can’t open/read file: check file path/integrity  
Traceback (most recent call last):  
File “C:\Users\ㅇㅇㅇ\PycharmProjects\newproject\openopic.py”, line 8, in   
cv2.imshow(‘src’, src)  
cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:971: error: (-215:Assertion failed) size.width\>0 && size.height\>0 in function ‘cv::imshow’

Process finished with exit code 1

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [March 30, 2023, 4:50pm UTC](https://forum.opencv.org/t/doesnt-working-image-window/12611/3 "2023-03-30T16:50:11Z")

</div>

the window _is_ working, your image did not load (path problem)

try NOT to use that ide (you have NO IDEA, what the cwd is) , it’ll only harm you !

---

<div class="post-metadata">

**Author:** ![evilmonkey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/evilmonkey/32/7538_2.png) [@evilmonkey](https://forum.opencv.org/u/evilmonkey)\
**Post date:** [March 30, 2023, 5:12pm UTC](https://forum.opencv.org/t/doesnt-working-image-window/12611/4 "2023-03-30T17:12:47Z")

</div>

as you see i think i typed right…  
(sorry if i didnt’t)… i had to upload image to show path , and image is in folder…

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [March 30, 2023, 5:25pm UTC](https://forum.opencv.org/t/doesnt-working-image-window/12611/5 "2023-03-30T17:25:45Z")

</div>

> [@evilmonkey](#):
>
> `newproject/Lena.png`

so, it is looking for another folder called newproject (which does not exist)

if you’re unsure, use _absolute_ pathes

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 30, 2023, 5:43pm UTC](https://forum.opencv.org/t/doesnt-working-image-window/12611/6 "2023-03-30T17:43:02Z")

</div>

please learn what a _ **current working directory** _ is.
