uv
is an extremely fast Python package and project manager for Python. Highly recommend that you use uv
.
winget install -e --id astral-sh.uv
winget install -e --id Git.Git
create a new python project using uv. We pin to python 3.11 because pyinsim9 wont run on anything newer than 3.11
uv init -p ==3.11.* my-insim-project
cd my-insim-project
A venv is a python virtual environment. It separates this project from everything else on your system to prevent package contamination.
uv venv
We're temporarily using a fork because the setup.py file is broken upstream... I'll try and raise a PR at some point.
uv add https://github.com/theangryangel/pyinsim9.git --branch=fix-setup
Put the following into main.py
import pyinsim9 as pyinsim
# Initialize the InSim system
insim = pyinsim.insim('127.0.0.1', 29999, Admin=b'123', IName=b'adsa')
print("Hello world")
# Send message 'Hello, InSim!' to the game
insim.sendm(b"Hello, InSim!")
# Start pyinsim.
pyinsim.run()
- Start up LFS, either with the argument
/insim=29999
or by typing/insim=29999
into a chat window. - Run
uv run main.py
- It should connect and then stay connected