Created
September 23, 2021 06:36
-
-
Save Gorgious56/11cc8f08d65635985e49fb7961a8bf5e to your computer and use it in GitHub Desktop.
Import pytest in blender local envionment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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