PYQT5 Application images not loaded when convert into exe using pyinstaller I have a mainwindow and its having a window icon and image in the screen.  The image and the icon is in the subfolder  ("/images/"). the script working well when i execute the py file..     When i try to convert this script to exe i couldn't find image and icon file in the app.    Command used to convert py to exe  pyinstaller --onefile -w main.py   Script code below:  from PyQt5.QtWidgets import QApplication,QMainWindow,QAction, QMessageBox,QLabel,QVBoxLayout, QWidget,QDialog from PyQt5 import QtGui from PyQt5.QtGui import QPixmap import sys  class Mainwindow(QMainWindow):     def __init__(self):         super().__init__()         self.title = 'VASA STUDIO'         self.left = 600         self.top = 200         self.width = 400         self.height = 300          icon_image = 'images\VASA_ICON.png'         self.main_image = 'images\VASA_MAIN.jpg'          self.setWindowTitle(self.title)         self.windowpage()         self.setWindowIcon(QtGui.QIcon(icon_image))          self.centralWidget()         self.show()      def windowpage(self):          menubar = self.menuBar()         menubar.setStyleSheet(('font: 10 14pt "Calibri" bold'))         self.loginmenu = menubar.addMenu('Login')         chgpwdmenu = menubar.addMenu('Change Password')         addstaffmenu = menubar.addMenu('Add Staffs')         custbillmenu = menubar.addMenu('Customer Billing')         prodcostmenu = menubar.addMenu('Product Cost')         expensemenu = menubar.addMenu('Expense')         workstatsmenu= menubar.addMenu('Work Status')         reportsmenu = menubar.addMenu('Reports')         remindermenu = menubar.addMenu('Reminders')         logoutmenu = menubar.addMenu('Log Out')         exitmenu =menubar.addMenu('Exit')           self.menulist = [chgpwdmenu,addstaffmenu,custbillmenu,prodcostmenu,expensemenu,workstatsmenu,reportsmenu,remindermenu,logoutmenu]         self.staffmenu =[custbillmenu,reportsmenu,remindermenu,logoutmenu,exitmenu]          for menu in self.menulist:             menu.setDisabled(True)          self.central_widget = QWidget()         self.setCentralWidget(self.central_widget)         vbox = QVBoxLayout(self.central_widget)          self.label = QLabel()         pixmap = QPixmap(self.main_image)         self.label.setPixmap(pixmap)         self.label.setScaledContents(True)         self.label.resize(pixmap.width(),pixmap.height())          vbox.addWidget(self.label)  if __name__ == "__main__":     app = QApplication(sys.argv)     window = Mainwindow()     window.showMaximized()     sys.exit(app.exec_())   Please help on this how to get the images and icons in the app.
Determining application path in a Python EXE generated by pyInstaller I have an application that resides in a single .py file.  I've been able to get pyInstaller to bundle it successfully into an EXE for Windows.  The problem is, the application requires a .cfg file that always sits directly beside the application in the same directory.  Normally, I build the path using the following code:  import os config_name = 'myapp.cfg' config_path = os.path.join(sys.path[0], config_name)   However, it seems the sys.path is blank when its called from an EXE generated by pyInstaller.  This same behaviour occurs when you run the python interactive command line and try to fetch sys.path[0].  Is there a more concrete way of getting the path of the currently running application so that I can find files that are relative to it?
Are static class variables possible in Python? How can the Next Generation's unfamiliarity with the Borg be explained after Archer's encounter? In  Starfleet learns about a culture that we (as audience) know as The Borg. According to TNG, the Federation doesn't seem to know anything about these beings when . Although Archer's crew doesn't learn the name of the Borg, it would be reasonable that the Federation would inherit the information about such a menacing enemy and it would also be reasonable to assume the crew of the Enterprise-D to be able to match their encounter with their databases' information.  Obviously, out-of-universe the explanation is that the scripts weren't written in chronological order, but how can the apparent obliviousness about the Borg be explained in-universe? How can we sum up $\sin$ and $\cos$ series when the angles are in arithmetic progression? Units and Nilpotents How to sort a ConcurrentSkipListMap by value? dist$(x,A)=0$ if and only if $x\in \overline{A}$ (closure of $A$) Let $(X,d)$ be  a metric space and non-empty $A\subset X$. The distance from $x$ to $A$ is defined as $$\mbox{dist}(x,A)=\inf\{d(x,a):a\in A\}$$  I want to show that dist$(x,A)=0$ if and only if $x$ is in the closure of $A$.     (=>): dist$(x,A)=0$ implies $\inf \{d(x,a):a\in A\}=0$. Suppose $x\not\in \overline{A}$, then $x\in X\setminus \overline{A}$, which is an open set. Thus $\exists\epsilon &gt;0$ such that punctured open ball $B(x;\epsilon)\setminus\{x\}= \{y\in X:0&lt;d(x,y)&lt;\epsilon\} \subset X\setminus\overline{A}$. But then dist$(x,A)=\inf\{d(x,a):a\in A\}\ge \inf\{d(x,y):y\in B(x,\epsilon)\setminus\{x\}\}&gt;0$. This is a contradiction! Hence, $x\in \overline{A}$.      (&lt;=): Suppose $x\in \overline{A}$. If $x\in A^\circ$ (the interior of $A$) then $\inf\{d(x,a):a\in A\}=d(x,x)=0$.   If $x\not\in A^\circ$ then $\exists $ a sequence $(a_k)_k\subset A$ such that $a_k$ converges to $x$. Then, $\forall \epsilon &gt; 0, \exists N\in\mathbb{N}$ such that $k\ge N\implies d(a_k,x)&lt;\epsilon$.      So that dist$(x,A)=\inf\{d(x,a_k)\}=\lim\limits_{k\to\infty} d(x,a_n) = 0$.   Please let me know if my proof is rigorous / correct. I'm not completely sure, think it's better to check. How can I share a directory with an another user? Quantum mechanics scattering theory Oracle SQL Syntax: Quoted identifier Translating cooking terms between US / UK / AU / CA / NZ Probability that no two consecutive heads occur? A fair coin is tossed $10$ times. What is the probability that no two   consecutive tosses are heads?   Possibilities are (dont mind the number of terms):  $H TTTTTTH$, $HTHTHTHTHTHTHT$.  But except for those,  let $y(n)$ be the number of sequences that start with $T$  $T _$, there are two options, $T$ and $H$ so,  $y(n) = y(n - 1) + x(n-1) = y(n - 1) + y(n - 2)$  Let $x(n)$ be the number of sequences that start with $H$,   $H _$ the next option is only $T$ hence,  $x(n) = y(n - 1)$   The total number of sequences $F(n)$ is:  $$F(n) = y(n) + x(n) = 2y(n - 1) + y(n - 2)$$  We are after $F(10)$,  $$F(10) = 2y(9) + y(8)$$  $$F(3) = 2y(2) + y(1) = 1 + 4 = 5$$  $$F(4) = 2y(3) + y(2) = 6 + 2 = 8$$  But I'm not quite sure where this will take me though. How do I support scrolling and lock/freeze the header row of a pageBlockTable? How to read command line arguments of another process in C#? How can I obtain the command line arguments of another process?   Using static functions of the System.Diagnostics.Process class I can obtain a list of running processes, e.g. by name:  Process[] processList = Process.GetProcessesByName(processName);   However, there is no way to access the command line used to start this process. How would one do that? Views indicator inaccurate, shows one views on question with two close votes Two close votes and only one person has viewed the question?    How did this happen? Usage of :- (colon dash) in bash I'm having a problem setting up a vhost on Apache 2.4, using CentOS 6.3.  This question seems to have been answered several times on this forum, but none of the solutions work for me.  Basically, I set up a vhost with a particular document root. When I attempt to access the site, I get a permissions error. But I have no problem if I use a different root.  More specifically, if I set the root to be /volume1/web/xxx, I get a 503 because of a permission problem on index.html.  But if I set it to be /volume1/web, the index.html comes up without a problem.  The details:   I set the persmissions on volume1, web, and xxx to 755. I set the permissions on the index.html files to 777. I copy the index.html file to both /volume1/web and /volume1/web/xxx, so that they have identical index files with identical permissions.   In httpd.conf, I set the VirtualHost options so that I can easily switch the document root by changing 2 comment marks  I have the following lines in the conf file:  NameVirtualHost *:80  &lt;VirtualHost *:80&gt;     ServerName localhost     #DocumentRoot /volume1/web     DocumentRoot /volume1/web/xxx      #&lt;Directory /volume1/web&gt;     &lt;Directory /volume1/web/xxx&gt;       Options Indexes FollowSymLinks Includes ExecCGI       AllowOverride All       Order Allow,Deny       Allow from all     &lt;/Directory&gt;      ErrorLog logs/localhost-error_log     CustomLog logs/localhost-access_log common &lt;/VirtualHost&gt;   These lines contain all the suggestions that worked for other people with the same problem.  What I get when I enter localhost in my browser depends on the document root.   If the root is /volume1/web, the index.html page comes up. if the root is /volume1/web/xxx, then I get a 503 error, and the apache error log has this line:  [Thu Jul 19 17:17:52 2012] [error] [client ::1] (13)Permission denied: access to /index.html denied   I also tried adding an index.php file to the directory. I then got permission denied messages for both the php file and the html file.  I also tried setting the user : group to apache : apache on the directories and files. That didn't help.  I've done everything I can think of to fix the permissions, to no avail.  Does anyone have an idea about what's happening here?  Thanks. normal subgroups of Alternating group Klein's $4$ group, $\{1\}$ and $A_4$ are three normal subgroups of $A_4$. I want to know about any other normal subgroups of $A_4$. Do these exist? How to see python symbolic names of objects on cursor hover of menu items in Blender 2.8 in Blender 2.79 one could hover over a UI element and see the symbolic python name of said element. How would one accomplish the same with Blender >= 2.8? I have a basic doubt about the associativity of the cartesian product. Well, first wikipedia says that the cartesian product isn't associative, and there's a good argument for it: if $x\in E$, $y\in F$ and $z \in G$ the identity $((x,y), z)=(x,(y,z))$ would imply that $(x,y) =x$ and $(y,z) = z$ so that $((x,y),z)=(x,y,z)$ would mean nothing.  That's fine, I like this argument. However, in his book Calculus on Manifolds, Spivak says that the cartesian product is associative. He says: if $A \subset \mathbb{R}^m$, $B\subset \mathbb{R}^n$ and $C \subset \mathbb{R}^p$ then $(A\times B)\times C = A \times (B \times C)$, and both of these are denoted simply by $A \times B \times C$.  Well, this confuses me because Spivak is always very rigorous, so that he wouldn't state something that's not true in such way. Is Spivak or Wikipedia right ? Or Spivak's statement only works for subsets of euclidean spaces ?  Thanks in advance and sorry if this question is too basic. Minecraft Vanilla 1.9 crash with problematic frame ig8icd64.dll I go to the Minecraft menu and click on singleplayer to test out the 1.9 update. I made a new world (no mods), it said downloading terrain and then it crashes every time (I've tried about 20 times now).  Has anyone else experienced similar issues and know what the fix may be?  Here is the launcher log:  Completely ignored arguments: [--nativeLauncherVersion, 301] [00:35:12] [Client thread/INFO]: Setting user: Teddy_Cromwell [00:35:12] [Client thread/INFO]: (Session ID is &lt;censored&gt;) [00:35:14] [Client thread/INFO]: LWJGL Version: 2.9.4 [00:35:14] [Client thread/WARN]: Removed selected resource pack resources (no region and battle music).zip because it's no longer compatible [00:35:14] [Client thread/INFO]: Reloading ResourceManager: Default [00:35:15] [Sound Library Loader/INFO]: Starting up SoundSystem... [00:35:16] [Thread-5/INFO]: Initializing LWJGL OpenAL [00:35:16] [Thread-5/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org) [00:35:16] [Thread-5/INFO]: OpenAL initialized. [00:35:16] [Sound Library Loader/INFO]: Sound engine started [00:35:18] [Client thread/INFO]: Created: 1024x512 textures-atlas [00:35:26] [Server thread/INFO]: Starting integrated minecraft server version 1.9 [00:35:26] [Server thread/INFO]: Generating keypair [00:35:27] [Server thread/INFO]: Preparing start region for level 0 [00:35:28] [Server thread/INFO]: Preparing spawn area: 5% [00:35:29] [Server thread/INFO]: Preparing spawn area: 8% [00:35:30] [Server thread/INFO]: Preparing spawn area: 15% [00:35:31] [Server thread/INFO]: Preparing spawn area: 21% [00:35:32] [Server thread/INFO]: Preparing spawn area: 27% [00:35:33] [Server thread/INFO]: Preparing spawn area: 34% [00:35:34] [Server thread/INFO]: Preparing spawn area: 42% [00:35:35] [Server thread/INFO]: Preparing spawn area: 48% [00:35:36] [Server thread/INFO]: Preparing spawn area: 56% [00:35:37] [Server thread/INFO]: Preparing spawn area: 66% [00:35:38] [Server thread/INFO]: Preparing spawn area: 74% [00:35:39] [Server thread/INFO]: Preparing spawn area: 81% [00:35:40] [Server thread/INFO]: Preparing spawn area: 91% [00:35:41] [Server thread/INFO]: Preparing spawn area: 98% [00:35:42] [Server thread/INFO]: Teddy_Cromwell[local:E:6d7525a7] logged in with entity id 301 at (244.5, 69.0, 244.5) [00:35:42] [Server thread/INFO]: Teddy_Cromwell joined the game # # A fatal error has been detected by the Java Runtime Environment: # #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007fffcf6e6b37, pid=15456, tid=12424 # # JRE version: Java(TM) SE Runtime Environment (8.0_25-b18) (build 1.8.0_25-b18) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode windows-amd64 compressed oops) # Problematic frame: # C  [ig8icd64.dll+0x16b37] # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # An error report file with more information is saved as: # C:\Users\Connor\AppData\Roaming\.minecraft\hs_err_pid15456.log # # If you would like to submit a bug report, please visit: #   http://bugreport.sun.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release