The script needs to be executed with the Python-executable of the environment you want to list packages for. You can make the script work in multiple python ...