Saturday, July 3, 2021

Python 3.9 run Windows Server 2008 problem

According to https://www.python.org/downloads/windows/:
Python 3.9 cannot be used on Windows 7 or earlier.
But we had a server with Windows Server 2008 R2 installed 🤷 and while running a project with Python 3.9 on Windows Server 2008 R2, we encountered the following issue: 
python.exe run.py exited with -1073740777. It is Unknown Software Exception: 0xc0000417.
Failed process printed the next output:

D:\Jenkins\workspace\TEST>"D:\Jenkins\workspace\TEST\project\python.exe" run.py Python path configuration: PYTHONHOME = (not set) PYTHONPATH = (not set) program name = 'D:\Jenkins\workspace\TEST\project\python.exe' isolated = 0 environment = 1 user site = 1 import site = 1 sys._base_executable = '\xc5V\u3241Z' sys.base_prefix = '.' sys.base_exec_prefix = '.' sys.platlibdir = 'lib' sys.executable = '\xc5V\u3241Z' sys.prefix = '.' sys.exec_prefix = '.' sys.path = [ 'D:\\Jenkins\\workspace\\TEST\\project\\python39.zip', '.\\DLLs', '.\\lib', '', ]

The variables sys._base_executable and sys.executable are corrupted and filled with arbitrary data.

We had sitecustomize.py file, with sys.executable variable update to required python.exe, but the problems still reproduced.

The only solution helped:

It is required to set the next environment variables (in our case we set them in Jenkins):

set PYTHONPATH=%PYTHONPATH%;%WORKSPACE%\project

set PYTHONHOME=%PYTHONHOME%;%WORKSPACE%\project

set __PYVENV_LAUNCHER__=%WORKSPACE%\project\python.exe

1 comment:

  1. بالتوفيق تابعنا فان الحديث عن أهمية شركة تنظيف خزانات المياه في الامارات، يمكن القول إن الاستثمار في خدمات تنظيف الخزانات يُعتبر استثمارًا في الصحة العامة والراحة النفسية تابع شركه تنظيف خزانات المياه عجمان إذ تُقدم الشركات المتخصصة ضمانات للعميل بأن المياه المستخدمة في منزله صحية وآمنة، ما يُسهم في تعزيز مستوى الحياة اليومية. لذا، فإن اعتماد الأفراد على شركات محترفة في هذا المجال يُعد الخيار الأمثل لحماية أنفسهم وعائلاتهم من المخاطر الصحية المحتملة شارك شركة تنظيف خزانات المياه الشارقه

    ReplyDelete