QPixmap(): argument 1 has unexpected type 'PngImageFile'
<p>(Sorry for poor English, my native language is not English)</p>

<p>I'm using Anaconda, Pycharm, Windows 10 and QtDesigner<br>
I'm trying to set variable that contains image as icon, and I'm having an issue that is written at title<br>
I imported Image from PIL and QtGui,QtCore, uic from PyQt4<br>
And this is the code:</p>

<pre><code>image2 = Image.open('./Images/Cache/Cache.png')
finalimage = QtGui.QIcon()
finalimage.addPixmap(QtGui.QPixmap(image2), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.FinalImage.setIcon(finalimage)
self.FinalImage.setIconSize(QtCore.QSize(1300, 342))
</code></pre>

<p>It will work when I use: </p>

<pre><code>finalimage.addPixmap(QtGui.QPixmap('./Images/Cache/Cache.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
</code></pre>

<p>But I have to use variable instead of the file path...<br>
What do I have to change to use variable as icon?</p>