Skip to content

Python.NET

Jacob edited this page May 27, 2021 · 30 revisions

Python.NET

Installation

Installing NuGet Package Manager

  • Download the latest NuGetForUnity .unitypackage here
  • In Unity, go to Assets > Import Package > Custom Package, locate where you downloaded NuGetForUnity, and install it.
  • You should now see NuGet in the Unity menu bar.

Installing Python.NET

  • In Unity, go to NuGet > Manage NuGet Packages, select Show All Versions and Show Prerelease.
  • Search for pythonnet.
  • Install pythonnet Version 3.0.0-preview2021-05-03.

Installing Embedded Python

  • Download a version of embedded python. I used latest release for winx64
  • In Unity, create a new folder under Assets called StreamingAssets.
  • Extract the .zip of your downloaded Python into the StreamingAssets folder.
  • To enable pip, download get-pip.py and save it in the Python folder (Assets/StreamingAssets/python-3.9.5-embed-amd64)
    • Run get-pip.py in command line. First cd into Assets/StreamingAssets/python-3.9.5-embed-amd64, then execute

python.exe get-pip.py

  - Now you can install any module you want with
  - ```
python.exe -m pip install module-name

Clone this wiki locally