How do I have my python script run with a specific version of python?

Bobby's Avatar

Bobby

02 Aug, 2018 01:55 PM

I'm having trouble finding documentation that specifically describes what's needed, but I suspect I'm missing some environment variables.

I have an on_finish command that looks like so:

- cmd: python .\pythonHelloWorld.py

It seems to currently default to using Python 2.7.15, but I would like to use Python 3.7, which looks like it's preinstalled:
https://www.appveyor.com/docs/build-environment/#python

What do I add to my appveyor.yml file to have that script run using my desired version of Python? I tried the following, didn't seem to work:

  environment:
    matrix:
      - PYTHON: "C:\\Python37"

  1. Support Staff 1 Posted by Owen McDonnell on 02 Aug, 2018 03:45 PM

    Owen McDonnell's Avatar

    Try adding - SET PATH=%PYTHON%;%PATH% somewhere before you call the python command.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac