Following my previous post which was only offering leads, I did my own tests.
I present the results to you.
TL;DR: I haven't been able to force DaVinciResolve to use Python 3.6 on Windows when 3.12 is installed.Here is what I tried :
1) (pre-requisite) disable python alias- Press the "Windows" key, type "Settings", click on the Settings app. It opens.
- In searchbox "Find a setting", type "alias". Click "Manage app execution aliases"
- Disable every occurrence of "App installer" that refers to python.exe or python3.exe
2) (pre-requisite) delete python.exe cached by Windows- You must have followed the steps above
- Open a command prompt
as an administrator- Delete cached python.exe :
(don't forget to replace MY_USER_NAME with your own user name) - Code: Select all
del C:\Users\MY_USER_NAME\AppData\Local\Microsoft\WindowsApps\python.exe
- Make sure everything worked :
- Code: Select all
where python
The result must show the python installation from the PATH env variable.
3) Test your PATH- Open a regular command prompt (not administrator)
- Check if Python appears in the PATH env variable, one or several times. For example :
- Code: Select all
echo %PATH%
C:\Users\MY_USER_NAME\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\MY_USER_NAME\AppData\Local\Programs\Python\Python36\;C:\WINDOWS\system32;C:\WINDOWS;C:\Users\MY_USER_NAME\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\MY_USER_NAME\AppData\Local\Programs\Python\Python312\
There, in my system, you can see that it appears twice : Python 3.6 at the beginning and Python 3.12 at the end.
- Enter the following command to see which one the system picks up :
- Code: Select all
python --version
- It should be python 3.6 as it's the first one in PATH (Windows looks at them in order)
4) Run DaVinciResolve from the same terminal, check what python it found- That is to ensure that (hopefully) PATH will be the same for Resolve as it was for you a moment ago
- Open the Python console (
Workspace -> Console )
- Click "Py3"
- check what version Resolve picked up :
- Code: Select all
import platform
print(platform.python_version())
- you can also check where it was loaded from:
- Code: Select all
import sys
print(sys.path)
FAIL: It still displays python 3.12 despite 3.6 being before in the path.
5) Try to hide python 3.12 from DaVinci Resolve (you don't need to try, I tried for you):Obviously, don't forget to revert your changes after you're done!- This is merely a test to see if Resolve finds Python not by using the PATH but instead just by scanning the "python" folder.
- Go to this folder :
(don't forget to replace MY_USER_NAME with your own user name)
- Code: Select all
C:\Users\MY_USER_NAME\AppData\Local\Programs\Python
- Notice how it contains both python312 and python36
- Rename folder "python312" to ".python312"
- Run DaVinci Resolve
- Open the Python console (
Workspace -> Console )
- Click "Py3"
FAIL: It says "No installation of python was found".
It seems to confirm that it uses the PATH otherwise it would not explicitly look for Python 3.12, it would pick up on Python 3.6 which is present in the same folder.
6) Try to entirely remove Python 3.12 from the PATH (you don't need to try, I tried for you):Obviously, don't forget to revert your changes after you're done!- In step 3 we saw that Python can appear several times in the path
- This step is an attempt to test if maybe DaVinci Resolve executable scans the PATH variable and picks up on every pythons present there, but then keeps the wrong one (the latest one)
- As a quick test I entirely overwrote PATH in my terminal :
- Open terminal
(don't forget to replace MY_USER_NAME with your own user name) - Code: Select all
SET PATH=C:\Users\MY_USER_NAME\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\MY_USER_NAME\AppData\Local\Programs\Python\Python36\;C:\WINDOWS\system32;C:\WINDOWS;
- Run DaVinci Resolve from that terminal
- Open the Python console (
Workspace -> Console )
- Click "Py3"
FAIL: it still says that there's no python installed. It's still looking for python 3.12 (despite it not being in PATH) and fails to find it (because we hid it by renaming the folder)
Please note that if you "un-hide" python 3.12 binaries (by renaming the folder back) and then run this test again (i.e. only Python 3.6 in PATH, then start Resolve), you are now able to open the Console and click Py3.
Running the following Python commands demonstrate that even for DaVinci Resolve, only Python 3.6 is in PATH:
- Code: Select all
import os
print(os.environ["PATH"])
It reinforces the mystery of how it finds the Python executables.
7) Try to hide Python 3.12 by sabotaging py.exe and the registry
(you don't need to try, I tried for you)Obviously, don't forget to revert your changes after you're done!- Rename the Python launcher, which helps programs finding your Python installation :
- Code: Select all
ren C:\Windows\py.exe .py.exe
- Open the registry (regedit.exe) as the user who installed Python 3.12 (probably not admin)
- Go to
- Code: Select all
HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore
- There, rename subfolder 3.12 to whatever temporary bogus name.
- Start DaVinci Resolve
- Open the Python console (
Workspace -> Console )
- Click "Py3"
- Code: Select all
import sys
print(sys.path)
- Still 3.12. How???!!!????
8) With a Python virtual environment- Note that for this test I reverted everything before. Python 3.12 is installed and not hidden, and in the PATH. But I was hoping that the virtual env was the perfect solution.- Open a Powershell terminal
- Run this command (create virtual env with Python 3.6) :
- Code: Select all
C:\Users\YOUR_USER_NAME\AppData\Local\Programs\Python\Python36\python.exe -m venv venv
(more info
here )
- Run this command (activate virtual env)
- Code: Select all
venv\Scripts\activate
- Run Resolve from the virtual env (the & is for running it in a non-blocking way)
- Code: Select all
& 'C:\Program Files\Blackmagic Design\DaVinci Resolve\Resolve.exe'
- Open the Python console (
Workspace -> Console )
- Click "Py3"
- Code: Select all
import sys
print(sys.path)
- Still 3.12. How???!!!????
CONCLUSION:I'm at the end of my wits. I couldn't find how to force DaVinci Resolve to use a specific Python installation. If only I could find out how it lists the installed versions???