To force Maya 2022.4 to open with Python 3 instead of Python 2.7, you can set the environment variable "PYTHON_EXECUTABLE" in the maya.env file. Follow these steps to accomplish this:
Locate the maya.env file: The maya.env file contains environment variable settings for Maya. It should be placed in the Maya preferences directory. In this case, since you mentioned removing the user prefs and moving the Documents/maya folder to the desktop, navigate to the desktop folder where the "maya" folder is located. Inside that "maya" folder, there should be the maya.env file.
Edit the maya.env file: Open the maya.env file with a text editor (e.g., Notepad, Visual Studio Code, etc.).
Set the PYTHON_EXECUTABLE variable: Add the following line to the maya.env file to specify the Python 3 executable path:
javascript
PYTHON_EXECUTABLE = C:/path/to/your/python3.exe
Replace "C:/path/to/your/python3.exe" with the actual path to your Python 3 executable on your system.
Save the changes: Save the maya.env file after making the necessary changes.
Restart Maya: Close Maya if it's currently running, and then reopen it. Now, Maya 2022.4 should use Python 3 as the default Python interpreter.
After applying these steps, verify that the correct Python version is being used by executing the following line in Maya's Script Editor:
python
import sys print(sys.version)
It should display the version of Python 3 you specified in the maya.env file.
Keep in mind that if the PYTHON_EXECUTABLE variable is already defined in the maya.env file, make sure to update it to the correct path for Python 3. Also, double-check for any typos or errors in the path to the Python 3 executable.
By correctly setting the PYTHON_EXECUTABLE environment variable, you should be able to force Maya 2022.4 to open using Python 3 instead of Python 2.7 consistently, even without launching it through the command line.
Hope this will help you.