scripts/install.py

branch
eric7
changeset 8501
7b5f10581c35
parent 8476
87c0b6e6e118
child 8522
4f263b89a293
equal deleted inserted replaced
8500:e7814dd19115 8501:7b5f10581c35
7 7
8 """ 8 """
9 Installation script for the eric IDE and all eric related tools. 9 Installation script for the eric IDE and all eric related tools.
10 """ 10 """
11 11
12 import sys 12 import compileall
13 import contextlib
14 import datetime
15 import fnmatch
16 import getpass
17 import glob
18 import io
19 import json
13 import os 20 import os
21 import py_compile
14 import re 22 import re
15 import compileall 23 import shlex
16 import py_compile
17 import glob
18 import shutil 24 import shutil
19 import fnmatch
20 import subprocess # secok 25 import subprocess # secok
21 import time 26 import time
22 import io 27 import sys
23 import json
24 import shlex
25 import datetime
26 import getpass
27 import contextlib
28 28
29 # Define the globals. 29 # Define the globals.
30 progName = None 30 progName = None
31 currDir = os.getcwd() 31 currDir = os.getcwd()
32 modDir = None 32 modDir = None
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

eric ide

mercurial