Steamworks-Py Setup on Windows 11
Steamworks-py is the only library currently available to connect Python-made games into Steam for achievements, workshop items, etc. However, it is not installed using pip, and setup is involved. This guide is for future meβand anyone elseβwho wants a working steamworks-py
setup.
π§ Requirements: Windows 11 Compilation
1. Install Visual Studio Build Tools
You'll need the proper terminal environment to compile. Run the following in PowerShell to install the tools:
Invoke-RestMethod -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe
Start-Process -FilePath vs_buildtools.exe -ArgumentList "--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "--add", "Microsoft.VisualStudio.Component.Windows10SDK.19041", "--norestart", "--passive", "--wait" -Wait -PassThru
Remove-Item vs_buildtools.exe
This will launch the Visual Studio installer and download required components. It takes time!
2. Get the steamworks-py
Repository
Clone or download the repository: - Steamworks-Py GitHub - Or download as ZIP if you're not planning to contribute
3. Get the Steam SDK
- Go to the Steamworks partner site
- Download the SDK (right sidebar)
4. Move Files Into Place
- Extract the Steam SDK
Copy the
steam
folder from:sdk/public/
into:
Steamworks-Py-master/library/sdk/
Copy
steam_api64.dll
andsteam_api64.lib
from:sdk/redistributable_bin/win64/
into:
Steamworks-Py-master/library/
5. Compile the DLL
Open the Developer Command Prompt for VS (from terminal dropdown in VS Code) and navigate to:
Steamworks-Py-master/library/
Then run:
cl /D_USRDLL /D_WINDLL SteamworksPy.cpp steam_api64.lib /link /DLL /OUT:SteamworksPy64.dll
You should now see SteamworksPy64.dll
in the library/
folder.
π¦ Turn It Into a Pip Installable Package
You'll create a package like this:
SteamworksWrapper/
βββ setup.py
βββ pyproject.toml
βββ MANIFEST.in
βββ src/
βββ steamworks/
βββ __init__.py
βββ util.py
βββ enums.py
βββ structs.py
βββ SteamworksPy64.dll
βββ steam_api64.dll
βββ steam_appid.txt
π Folder Setup
Create the structure above. Then copy:
- All
.dll
,.txt
, and.py
files intosrc/steamworks/
βοΈ setup.py
from setuptools import setup, find_packages
setup(
name="steamworks",
version="0.1.0",
packages=find_packages(where="src"),
package_dir={"": "src"},
include_package_data=True,
package_data={"steamworks": ["*.dll", "*.txt"]},
)
π pyproject.toml
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
π¦ MANIFEST.in
recursive-include src/steamworks *.dll
π₯ Install
With your game environment active (venv
), navigate to SteamworksWrapper/
and run:
pip install -e .
β Usage
from steamworks import STEAMWORKS
Everything should now "just work".
Comments
Log in to add a comment.