@@ -187,7 +187,7 @@ export function getBundledPythonEnvironment() {
187187}
188188
189189export async function installRequiredPythonPackages ( mainWindow ) {
190- let requirementsFileName = process . platform === "darwin" ? "requirements_mac.txt" : "requirements .txt"
190+ let requirementsFileName = "merged_requirements .txt"
191191 if ( process . env . NODE_ENV === "production" ) {
192192 installPythonPackage ( mainWindow , pythonExecutablePath , null , path . join ( process . cwd ( ) , "resources" , "pythonEnv" , requirementsFileName ) )
193193 } else {
@@ -208,6 +208,12 @@ function comparePythonInstalledPackages(pythonPackages, requirements) {
208208 if ( pythonPackage . name === requirementName && pythonPackage . version === requirementVersion ) {
209209 found = true
210210 break
211+ } else if ( pythonPackage . name . replace ( '-' , '_' ) === requirementName && pythonPackage . version === requirementVersion ) {
212+ found = true
213+ break
214+ } else if ( pythonPackage . name . replace ( '_' , '-' ) === requirementName && pythonPackage . version === requirementVersion ) {
215+ found = true
216+ break
211217 }
212218 }
213219 if ( ! found ) {
@@ -360,9 +366,9 @@ export async function installBundledPythonExecutable(mainWindow) {
360366
361367 // Install the required python packages
362368 if ( process . env . NODE_ENV === "production" ) {
363- installPythonPackage ( mainWindow , pythonExecutablePath , null , path . join ( process . cwd ( ) , "resources" , "pythonEnv" , "requirements .txt" ) )
369+ installPythonPackage ( mainWindow , pythonExecutablePath , null , path . join ( process . cwd ( ) , "resources" , "pythonEnv" , "merged_requirements .txt" ) )
364370 } else {
365- installPythonPackage ( mainWindow , pythonExecutablePath , null , path . join ( process . cwd ( ) , "pythonEnv" , "requirements .txt" ) )
371+ installPythonPackage ( mainWindow , pythonExecutablePath , null , path . join ( process . cwd ( ) , "pythonEnv" , "merged_requirements .txt" ) )
366372 }
367373 let removeCommand = `rm ${ outputFileName } `
368374 let removePromise = exec ( removeCommand , { shell : "powershell.exe" } )
@@ -429,9 +435,9 @@ export async function installBundledPythonExecutable(mainWindow) {
429435 console . log ( "process.resourcesPath: " , process . resourcesPath )
430436 // Install the required python packages
431437 if ( process . env . NODE_ENV === "production" ) {
432- installPythonPackage ( mainWindow , pythonExecutablePath , null , path . join ( process . resourcesPath , "pythonEnv" , "requirements .txt" ) )
438+ installPythonPackage ( mainWindow , pythonExecutablePath , null , path . join ( process . resourcesPath , "pythonEnv" , "merged_requirements .txt" ) )
433439 } else {
434- installPythonPackage ( mainWindow , pythonExecutablePath , null , path . join ( process . cwd ( ) , "pythonEnv" , "requirements .txt" ) )
440+ installPythonPackage ( mainWindow , pythonExecutablePath , null , path . join ( process . cwd ( ) , "pythonEnv" , "merged_requirements .txt" ) )
435441 }
436442 }
437443 }
0 commit comments