Commit f286236c21ab160f6775709728028e89cbe28f5b
1 parent
faa9b662
Exists in
dev
bugfix for Windows
Showing
1 changed file
with
8 additions
and
14 deletions
Show diff stats
install/install.py
... | ... | @@ -12,7 +12,7 @@ INSTALL_DB = True |
12 | 12 | venv = "venv_py3_pyros" |
13 | 13 | |
14 | 14 | # python = 'python3' |
15 | -python_global = os.path.split(sys.executable)[-1] | |
15 | +python = os.path.split(sys.executable)[-1] | |
16 | 16 | sql_database = "pyros" |
17 | 17 | sql_database_test = "pyros_test" |
18 | 18 | sql_user = "pyros" |
... | ... | @@ -28,18 +28,12 @@ venv_bin = '/bin/' |
28 | 28 | if (platform.system() == "Windows"): |
29 | 29 | REQUIREMENTS = 'REQUIREMENTS_WINDOWS.txt' |
30 | 30 | end_of_line = "\r\n\r\n" |
31 | - venv_bin = "\Scripts\" | |
32 | - #pip = '\Scripts\pip' # ----- seems non useful | |
31 | + venv_bin = '\\Scripts\\' | |
33 | 32 | #mysql_exe_path = "C:/Program Files (x86)/MySQL/MySQL Server 5.0/bin/" |
34 | 33 | #question = "Enter the path of the MySQL server if it is not the following name (" + mysql_exe_path + "): " |
35 | 34 | #res = input(question) |
36 | 35 | #if res!="": |
37 | 36 | # mysql_exe_path = res |
38 | -#pip = '/bin/pip' | |
39 | -''' | |
40 | -pip = venv_bin+'pip' | |
41 | -python = venv_bin+'python' | |
42 | -''' | |
43 | 37 | venv_pip = venv + venv_bin+'pip' |
44 | 38 | venv_python = venv + venv_bin+'python' |
45 | 39 | |
... | ... | @@ -196,7 +190,7 @@ def install_venv(venv:str): |
196 | 190 | # -------------------------------------------- |
197 | 191 | # --- Deleting if already exist then creating the venv |
198 | 192 | # -------------------------------------------- |
199 | - os.chdir("../private") | |
193 | + os.chdir("../private/") | |
200 | 194 | while True: |
201 | 195 | try: |
202 | 196 | if (os.path.isdir(venv)): |
... | ... | @@ -208,11 +202,11 @@ def install_venv(venv:str): |
208 | 202 | continue |
209 | 203 | |
210 | 204 | # -------------------------------------------- |
211 | - # --- Reinstall the virtual environment | |
205 | + # --- Reinstall the virtual environment (from ../private/) | |
212 | 206 | # -------------------------------------------- |
213 | 207 | |
214 | 208 | print(Colors.LOG_BLUE + "-----------------------------Creating venv " + venv + "-----------------------------"+end_of_line + Colors.END) |
215 | - os.system(python_global+" -m venv " + venv) | |
209 | + os.system(python+" -m venv " + venv) | |
216 | 210 | |
217 | 211 | print(Colors.LOG_BLUE + "-----------------------------Upgrade pip, wheel, and setuptools" + "-----------------------------"+end_of_line + Colors.END) |
218 | 212 | # Upgrade pip |
... | ... | @@ -254,7 +248,7 @@ def install_database(venv): |
254 | 248 | # -------------------------------------------- |
255 | 249 | # --- Default values for Linux |
256 | 250 | # -------------------------------------------- |
257 | - print(Colors.LOG_BLUE + "Python executable is " + python_global + Colors.END) | |
251 | + print(Colors.LOG_BLUE + "Python executable is " + python + Colors.END) | |
258 | 252 | ##if platform.dist()[0] == "centos": print("centos platform") |
259 | 253 | |
260 | 254 | # -------------------------------------------- |
... | ... | @@ -346,9 +340,9 @@ def install_database(venv): |
346 | 340 | print(Colors.LOG_BLUE + "\r\n\r\n-----------------------------Migrate : executing pyros.py init_database-----------------------------" + Colors.END) |
347 | 341 | #TODO: from venv !!! |
348 | 342 | try: |
349 | - os.system(python_global+" pyros.py init_database") | |
343 | + os.system(python+" pyros.py init_database") | |
350 | 344 | ''' |
351 | - process = subprocess.Popen(python_global + " pyros.py init_database" , shell=True) | |
345 | + process = subprocess.Popen(python + " pyros.py init_database" , shell=True) | |
352 | 346 | process.wait() |
353 | 347 | ''' |
354 | 348 | ... | ... |