Skip to content

Setup bpy on Windows

Alexander Ritter edited this page Jun 15, 2022 · 1 revision

❗ All these commands need to be run when you are in the working directory of our project!
❗ Run these commands from cmd and NOT through Powershell.

  1. Download venv-blender-windows.zip from Dropbox (I precompiled bpy so you don't have to do it) and unzip it into a folder .venv-blender.
    The resulting file tree should look like that:
    grafik

  2. Because Windows acts strange for bpy (source), we can't install only to the virtual environment.
    You will need to move the 3.3 folder to your Python install location:

    • Find the install location of your Python (Usually, this is either C:\Program Files\Python310 or C:\Users\<Benutzername>\AppData\Local\Programs\Python\Python310)
    • Copy the 3.3 folder from the ZIP file into the folder containing your Python executable
  3. Create a python virtual environment and activate it:

    python -m venv .venv-blender
    .venv-blender\Scripts\activate.bat
    

    Your console should now display a prefix like this: grafik

  4. Install all necessary libraries by running:

    pip install -r requirements.txt
    
  5. You are finished!
    Keep in mind, always activate the virtual environment using .venv-blender\Scripts\activate.bat before running any script, otherwise bpy imports won't work.