Nvidia X server - cannot switch to GPU from my Intel, because of python import error

I had the same error. I fixed it by running sudo nvidia-settings instead of nvidia-settings. This adds the necessary privileges to launch the application.


Try switching GPU using terminal. It does not give an error then.

TO SWITCH TO NVIDIA GPU:

sudo prime-select nvidia

TO SWITCH TO INTEGRATED INTEL GPU:

sudo prime-select intel

So I finally fixed the problem. I had to install the latest nvidia drivers (367) and disable safe boot in UEFI. Suddenly it is working.