-
Bug
-
Resolution: Won't Do
-
Minor
-
None
-
3.9.17
-
None
-
MOODLE_39_STABLE
Running Moodle 3.9.17 on Windows, recently installed Python 3.7.9 and the moodlemlbackend 2.6.6 package, however attempting to select it results in the "run C:\Moodle\Install\Python\python -m moodlemlbackend.version from a CLI" message, and running the command returns "2.6.6". No further information provided by increasing log verbosity to debug.
Steps followed with comments:
set path=%path%;C:\Moodle\Install\Python\Scripts
rem ^ to quiet script path warnings
cd \Moodle\Install
rd /q /s Python
rem ^ to repeat
md Python
cd Python
powershell Invoke-WebRequest -uriĀ https://www.python.org/ftp/python/3.7.9/python-3.7.9-embed-amd64.zip -o python-3.7.9-embed-amd64.zip
powershell Expand-Archive python-3.7.9-embed-amd64.zip .
rem ^ using portable so that installation can occur by just copying files
powershell Invoke-WebRequest -uri https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
xcopy /e /y Lib\site-packages .
rd /q /s Lib
rem ^ packages that are left in Lib\site-packages throw "not found" errors even after setting path and pythonpath. Moving them to the current directory fixes the problem
python -m pip install distribute matplotlib setupext sklearn
rem ^ moodlemlbackend will throw errors if this is not done separately, perhaps due to Lib\site-packages problem
xcopy /e /y Lib\site-packages .
rd /q /s Lib
python -m pip install moodlemlbackend==2.6.*
xcopy /e /y Lib\site-packages .
rd /q /s Lib
python -m moodlemlbackend.version
rem ^ yields "2.6.6"