simons-public / protonfixes

A module for applying fixes at runtime to unsupported games with Steam Proton without changing game installation files
https://simons-public.github.io/protonfixes/
Other
232 stars 117 forks source link

`module '__main__' has no attribute 'env'` #161

Closed bmaupin closed 3 years ago

bmaupin commented 3 years ago

I have a very basic fix I'm trying to test locally:

from protonfixes import util

def main():
    util.protontricks('icodecs')

I installed protonfixes using sudo pip3 install protonfixes, then ran ./install_protonfixes in the scripts directory of this repo, and I see that import protonfixes was added to the end of ~/.local/share/Steam/steamapps/common/Proton\ 5.0/user_settings.py

In the logs, I see this error:

ProtonFixes[21182] INFO: Using local protonfix for "realMyst" (63600)
ProtonFixes[21182] INFO: Applying fixes for realMyst
ProtonFixes[21182] INFO: Checking if winetricks icodecs is installed
ProtonFixes[21182] INFO: Installing winetricks icodecs
Proton: ************************************************
Proton: THERE IS AN ERROR IN YOUR user_settings.py FILE:
Proton: module '__main__' has no attribute 'env'
Proton: ************************************************

Since the only change to user_settings.py is the addition of import protonfixes, I'm guessing that's where the error is coming from? But it's hard to debug due to #160.

Thanks!

mrjackv commented 3 years ago

I suspect that this together with #160 is due to the last release of protonfixes on pypi being really old (~3 years ago), there have been 160 commits since that have fixed a lot of things. If you want to give it a shot I would suggest to run

sudo pip3 uninstall -y protonfixes
pip3 install git+https://github.com/simons-public/protonfixes

(The sudo is intentionally missing from the second command, unless you have multiple accounts on your machine it is much cleaner to do a user install than a system install) The second command will install the latest development version of protonfixes, which should work without a hitch

bmaupin commented 3 years ago

Oh great, thanks I'll give it a shot!

I wonder if it would be worth updating the README with that information? That might be easier than trying to keep the package updated in pypi. I wouldn't mind submitting a PR if it would be accepted.

simons-public commented 3 years ago

Yeah I've been much too busy lately to keep the PyPI package updated. I went ahead and updated the readme, thanks for the recommendation, and thanks mrjackv for figuring it out.

bmaupin commented 3 years ago

That worked, thanks!