Skip to content

Instantly share code, notes, and snippets.

@Gorgious56
Created September 23, 2021 06:36
Show Gist options
  • Save Gorgious56/11cc8f08d65635985e49fb7961a8bf5e to your computer and use it in GitHub Desktop.
Save Gorgious56/11cc8f08d65635985e49fb7961a8bf5e to your computer and use it in GitHub Desktop.
Import pytest in blender local envionment
import subprocess
import sys
py_exec = sys.executable
# ensure pip is installed
subprocess.call([str(py_exec), "-m", "ensurepip", "--user" ])
# update pip
subprocess.call([str(py_exec), "-m", "pip", "install", "--upgrade", "pip" ])
# install packages
subprocess.call([str(py_exec),"-m", "pip", "install", f"--target={str(py_exec)[:-14]}" + "lib", "pytest"])
subprocess.call([str(py_exec),"-m", "pip", "install", f"--target={str(py_exec)[:-14]}" + "lib", "pytest-blender"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment