Open Cheeseboy8020 opened 2 years ago
(x86)/StarCraft II/Versions/Base86383/SC2_x64.exe maybe not able to execute 64 bit ?
I didn't have this exact problem but after tinkering a little I've found that lutris does a lot of the heavy lifting of configuring wine for running starcraft 2. I believe that python-sc2 only knows about the environment variables mentioned in the "wine and lutris" section of README.md file.
SC2PF=WineLinux
WINE="/home/aneesh/.local/share/lutris/runners/wine/lutris-5.0-x86_64/bin/wine"
SC2PATH="/home/aneesh/Games/battlenet/drive_c/Program Files (x86)/StarCraft II/"
But wine needs a lot more information to work for sc2. You can see for yourself by typing these commands in a terminal:
$ lutris --list-games
$ lutris lutris:rungameid/1 --output-script sc2.bash
You will find that this script sc2.bash
can run sc2 as if launched from the lutris gui. It creates several environment variables that tell wine how to run sc2. The way I think about this is that wine behaves as a Windows XP computer by default but if you configure it right it can look to sc2 like a Windows 10. The variables in my computer running Ubuntu 20.04 look like:
DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1="1"
SDL_VIDEO_FULLSCREEN_DISPLAY="off"
DRI_PRIME="1"
LD_LIBRARY_PATH="/home/aneesh/.local/share/lutris/runners/wine/lutris-5.0-x86_64/lib:/home/aneesh/.local/share/lutris/runners/wine/lutris-5.0-x86_64/lib64:/lib/x86_64-linux-gnu:/lib/i386-linux-gnu:/lib:/lib32:/lib/i386-linux-gnu/i686/sse2:/lib/i386-linux-gnu/sse2:/usr/lib/x86_64-linux-gnu/libfakeroot:/lib64:/lib64:/usr/lib:/usr/lib64:/usr/lib32:/usr/lib64:/usr/lib/i386-linux-gnu:/usr/lib/x86_64-linux-gnu:/home/aneesh/.local/share/lutris/runtime/Ubuntu-18.04-i686:/home/aneesh/.local/share/lutris/runtime/steam/i386/lib/i386-linux-gnu:/home/aneesh/.local/share/lutris/runtime/steam/i386/lib:/home/aneesh/.local/share/lutris/runtime/steam/i386/usr/lib/i386-linux-gnu:/home/aneesh/.local/share/lutris/runtime/steam/i386/usr/lib:/home/aneesh/.local/share/lutris/runtime/Ubuntu-18.04-x86_64:/home/aneesh/.local/share/lutris/runtime/steam/amd64/lib/x86_64-linux-gnu:/home/aneesh/.local/share/lutris/runtime/steam/amd64/lib:/home/aneesh/.local/share/lutris/runtime/steam/amd64/usr/lib/x86_64-linux-gnu:/home/aneesh/.local/share/lutris/runtime/steam/amd64/usr/lib:$LD_LIBRARY_PATH"
DXVK_CONFIG_FILE="/home/aneesh/Games/battlenet/dxvk.conf"
DXVK_STATE_CACHE_PATH="/home/aneesh/Games/battlenet"
STAGING_SHARED_MEMORY="1"
__GL_SHADER_DISK_CACHE="1"
__GL_SHADER_DISK_CACHE_PATH="/home/aneesh/Games/battlenet"
WINEDEBUG="-all"
WINEARCH="win64"
WINEPREFIX="/home/aneesh/Games/battlenet"
WINEESYNC="1"
WINEFSYNC="0"
DXVK_NVAPIHACK="0"
WINEDLLOVERRIDES="api-ms-win-crt-private-l1-1-0,ucrtbase=n,b;d3d12,nvapi,nvapi64,winemenubuilder="
WINE_LARGE_ADDRESS_AWARE="1"
TERM="xterm"
So what I did is create a .env
file with all these key-value pairs which are run automagically by vscode when you run an AI script. If running the script manually this also works:
$ set -a ; source .env ; set +a
$ python worker_rush.py
As I said earlier. This is probably not your exact problem but It seems that in your case python-sc2 is trying to run a different version/configuration of wine than lutris does. Hope this helps.
Edit: I think Diego nailed it. Probably an environment issue. (i.e. $WINE)
What did you type in the command line? Is there a link to the 'sample'? How do you launch Starcraft when it works, from command line (what command) or from GUI?
In the terminal you can echo $ENVIRONMENT_VARIABLE
e.g. echo $WINE
to see what your terminal has in that session and compare that to https://github.com/BurnySc2/python-sc2#wine-and-lutris
I don't have Lutris, but can get an Exec format error
if I try to run it as a script, not wine.
~/.wine/drive_c/Program Files (x86)/StarCraft II$ ./StarCraft\ II.exe
bash: ./StarCraft II.exe: cannot execute binary file: Exec format error
whereas
~/.wine/drive_c/Program Files (x86)/StarCraft II$ wine StarCraft\ II.exe
launches battlenet without error.
Closest I could come to reproducing the error message.
Ubunutu 23.10, Starcraft II via Lutris
So this error comes from being out of environment (that installed burnysc2), and then manually trying to fix dependencies, with '$ pip install sc2'. Which will download the wrong module.
Creating and activating virtual environment python3 -m venv /path/to/virtual_environment/
, source /virtual_environment/bin/activate
before
$ pip install --upgrade burnysc2
, seemed to fix it and put an sc2 folder into
/home/username/my_virtual_environment/lib/python3.11/site-packages/
But I get a warning if I'm not in virtual environment when I try to install burnysc2, so I must have been out of/in different virtual environment than when I installed burnysc2, causing me to pip install sc2
to attempt to run the worker_rush.py.
I installed starcraft via lutris. Running it with the battle.net launcher works fine. When I try to run the sample i get this error: