안녕 모두,
저는 Application Builder를 사용하여 Python 통합으로 애플리케이션을 개발하고 있습니다. 이것을 추가 기능으로 컴파일하여 다른 사용자와 공유할 계획이지만 모든 사용자에 대해 Python 초기화를 올바르게 설정하는 방법이 필요합니다.
내가 애플리케이션을 실행한 방식은 나에게만 작동합니다(사용자 EstelleS1 및 내 환경, JMPPython 환경) :
appNS:PythonPathText = "C:\Users\EstelleS1\AppData\Local\Programs\Python\Python37\JMPPythonEnvironment\Scripts\python37.dll";
appNS:PythonSysPathText = {"",
"C:\\Users\\EstelleS1\\AppData\\Local\\Programs\\Python\\Python37\\JMPPythonEnvironment\\Scripts\\python37.zip",
"C:\\Users\\EstelleS1\\AppData\\Local\\Programs\\Python\\Python37\\DLLs",
"C:\\Users\\EstelleS1\\AppData\\Local\\Programs\\Python\\Python37\\lib",
"C:\\Users\\EstelleS1\\AppData\\Local\\Programs\\Python\\Python37",
"C:\\Users\\EstelleS1\\AppData\\Local\\Programs\\Python\\Python37\\JMPPythonEnvironment",
"C:\\Users\\EstelleS1\\AppData\\Local\\Programs\\Python\\Python37\\JMPPythonEnvironment\\lib\\site-packages"};
Python Init(
Path( PythonPathText ),
Python Sys Path( PythonSysPathText )
);(appNS는 내 애플리케이션 네임스페이스를 나타냄)
다른 사용자는 많은 관리자 권한을 갖게 되므로 새 사용자가 앱 런처의 버튼을 클릭하여 Python 경로 및 sys 경로 문자열이 포함된 텍스트 파일을 업로드하면 애플리케이션이 이를 가져오는 워크플로를 설정하려고 했습니다. 파일을 만들고 새 폴더에 복사본을 저장합니다(여기서 $DESKTOP은 모든 사용자의 컴퓨터에서 액세스 가능한 위치여야 함).
PythonPathButtonPress=Function({this},
// This function is called when the button is pressed
name = this << Get Button Name;
pickPythonPathFile = Pick File("Please select Python Path text file");
pickPythonSysPathFile = Pick File("Please select Python Sys Path text file");
PythonPathFile = Load Text File( pickPythonPathFile );
PythonSysPathFile = Load Text File( pickPythonSysPathFile );
PythonConfigFolder = ( "$DESKTOP/JMPPython Config/" );
NEWPythonPathFile = (PythonConfigFolder || "PythonPath.txt" );
NEWPythonSysPathFile = (PythonConfigFolder || "PythonSysPath.txt" );
PythonConfigDir = Create Directory( PythonConfigFolder );
Save Text File( NEWPythonPathFile, PythonPathFile );
Save Text File( NEWPythonSysPathFile, PythonSysPathFile );
);따라서 이 작업을 처음 수행한 후에는 사용자가 이후에 Python을 다시 구성하기 위해 버튼을 클릭할 필요가 없습니다. 그런 다음 추가 기능의 Python 통합 부분을 실행하면 응용 프로그램은 액세스 가능한 폴더 위치($DESKTOP 또는 더 나은 위치)에서 이러한 복사된 파일을 열기 위해 자동으로 검색합니다.
PythonPathFile = Convert File Path( "$DESKTOP\JMPPython Config\PythonPath.txt", search );
PythonSysPathFile = Convert File Path( "$DESKTOP\JMPPython Config\PythonSysPath.txt", search );
Try( appNS:PythonPathText = Load Text File( PythonPathFile ), New Window("Python Initialization Error", << Modal, Text Box("Need to configure Python first!") ); Throw() );
Try( appNS:PythonSysPathText = Load Text File( PythonSysPathFile ), New Window("Python Initialization Error", << Modal, Text Box("Need to configure Python first!") ); Throw() );
Python Init(
Path( PythonPathText ),
Python Sys Path( PythonSysPathText )
);그러나 이것은 작동하지 않았습니다. "지정된 모듈을 찾을 수 없습니다. 액세스 또는 평가에서 'Python Init' , Python Init/*###*/(Path( PythonPathText ), Python Sys Path( PythonSysPathText ))" 오류가 발생했습니다. 이 오류의 원인이나 해결 방법을 정확히 모르겠습니다.
누구든지이 문제에 대한 통찰력이나 더 나은 해결책을 줄 수 있다면 감사하겠습니다.