188 Module function to set the values of globals that need more than a |
188 Module function to set the values of globals that need more than a |
189 simple assignment. |
189 simple assignment. |
190 """ |
190 """ |
191 global platBinDir, modDir, pyModDir, apisDir, platBinDirOld |
191 global platBinDir, modDir, pyModDir, apisDir, platBinDirOld |
192 |
192 |
193 try: |
193 import sysconfig |
194 import distutils.sysconfig |
|
195 except ImportError: |
|
196 print("Please install the 'distutils' package first.") |
|
197 exit(5) |
|
198 |
194 |
199 if sys.platform.startswith(("win", "cygwin")): |
195 if sys.platform.startswith(("win", "cygwin")): |
200 platBinDir = sys.exec_prefix |
196 platBinDir = sys.exec_prefix |
201 if platBinDir.endswith("\\"): |
197 if platBinDir.endswith("\\"): |
202 platBinDir = platBinDir[:-1] |
198 platBinDir = platBinDir[:-1] |
216 platBinDir != "/usr/local/bin" and |
212 platBinDir != "/usr/local/bin" and |
217 os.access("/usr/local/bin", os.W_OK) |
213 os.access("/usr/local/bin", os.W_OK) |
218 ): |
214 ): |
219 platBinDirOld = "/usr/local/bin" |
215 platBinDirOld = "/usr/local/bin" |
220 |
216 |
221 modDir = distutils.sysconfig.get_python_lib(True) |
217 modDir = sysconfig.get_path('platlib') |
222 pyModDir = modDir |
218 pyModDir = modDir |
223 |
219 |
224 pyqtDataDir = os.path.join(modDir, "PyQt6") |
220 pyqtDataDir = os.path.join(modDir, "PyQt6") |
225 if os.path.exists(os.path.join(pyqtDataDir, "qsci")): |
221 if os.path.exists(os.path.join(pyqtDataDir, "qsci")): |
226 # it's the installer |
222 # it's the installer |