Matoking / protontricks

A wrapper that does winetricks things for Proton enabled games, requires Winetricks.
GNU General Public License v3.0
1.66k stars 36 forks source link

Ubuntu 20.04: Protontricks failed to install #53

Closed legluondunet closed 4 years ago

legluondunet commented 4 years ago

Hello,

I follow your guide, install necessary packages, but when I try to install Protontricks I obtained this message:

$ pipx install --spec git+https://github.com/Matoking/protontricks.git protontricks
usage: pipx [-h] [--version] {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall-all,list,run,runpip,ensurepath,completions} ...
pipx: error: unrecognized arguments: --spec protontricks

If I launch PRotontricks version installed before I upgraded to Ubuntu 20.04:

$ protontricks
Traceback (most recent call last):
  File "/home/legluondunet/.local/bin/protontricks", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'

My Python 3 version:

$ python3 --version Python 3.8.2

Thank you for your help.

Matoking commented 4 years ago

pipx syntax seems to have changed in the newer versions of pipx, so the following should work instead:

pipx install git+https://github.com/Matoking/protontricks.git

If you already have protontricks installed, you'll need to use the --force parameter, which pipx should suggest if it's necessary:

pipx install --force git+https://github.com/Matoking/protontricks.git

I've updated the instructions in README with this change.


If you're still getting the pkg_resources error after the steps above, try uninstalling protontricks and then reinstalling:

pipx uninstall protontricks
pipx install git+https://github.com/Matoking/protontricks.git
legluondunet commented 4 years ago

this doesn't seem to work:

$ pipx install --force git+https://github.com/Matoking/protontricks.git
Traceback (most recent call last):
  File "/home/legluondunet/.local/bin/pipx", line 8, in <module>
    sys.exit(cli())
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/main.py", line 590, in cli
    return run_pipx_command(parsed_pipx_args)
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/main.py", line 162, in run_pipx_command
    return commands.install(
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/commands/commands.py", line 38, in install
    package_name = _package_name_from_spec(
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/commands/commands.py", line 100, in _package_name_from_spec
    package_name = venv.install_package_no_deps(
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/venv.py", line 218, in install_package_no_deps
    old_package_set = self.list_installed_packages()
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/venv.py", line 300, in list_installed_packages
    pip_list = json.loads(cmd_run.stdout.strip())
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
$ pipx uninstall protontricks
uninstalled protontricks! ✨ 🌟 ✨
$ pipx uninstall protontricks
Nothing to uninstall for protontricks 😴
⚠️  Note: '/usr/local/bin/protontricks' still exists on your system and is on your PATH
legluondunet@tipingouin-home:~$ pipx install git+https://github.com/Matoking/protontricks.git
Traceback (most recent call last):
  File "/home/legluondunet/.local/bin/pipx", line 8, in <module>
    sys.exit(cli())
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/main.py", line 590, in cli
    return run_pipx_command(parsed_pipx_args)
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/main.py", line 162, in run_pipx_command
    return commands.install(
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/commands/commands.py", line 38, in install
    package_name = _package_name_from_spec(
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/commands/commands.py", line 100, in _package_name_from_spec
    package_name = venv.install_package_no_deps(
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/venv.py", line 218, in install_package_no_deps
    old_package_set = self.list_installed_packages()
  File "/home/legluondunet/.local/lib/python3.8/site-packages/pipx/venv.py", line 300, in list_installed_packages
    pip_list = json.loads(cmd_run.stdout.strip())
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
legluondunet commented 4 years ago

I found the problem, I don't know why but I had protontricks, pipx and older python3 components installed in two different paths:

Matoking commented 4 years ago

You can also try uninstalling pipx and removing the ~/.local/pipx directory, and then reinstalling pipx and protontricks. The aforementioned directory contains symlinks to different Python files that could cause issues if they're no longer valid after the Ubuntu 20.04 upgrade.

legluondunet commented 4 years ago

my system is now cleaned, protontricks is now installed and "surprise" I still need --spec with pipx from official Ubuntu 20.04:

legluondunet@tipingouin-home:~$ pipx install --spec git+https://github.com/Matoking/protontricks.git protontricks
  ERROR: Command errored out with exit status 1:ing/protontricks.git#egg=protontricks'   
   command: /home/legluondunet/.local/pipx/venvs/protontricks/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vyg3x9mp/protontricks/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vyg3x9mp/protontricks/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-0hajl3ym
       cwd: /tmp/pip-install-vyg3x9mp/protontricks/
  Complete output (7 lines):
  WARNING: The wheel package is not available.
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for protontricks
  installed package protontricks 1.4.2.dev3+g9809712, Python 3.8.2                       
  These binaries are now globally available
    - protontricks
done! ✨ 🌟 ✨

and there is a problem with a wheel?

legluondunet commented 4 years ago
$ bdist_wheel
bdist_wheel : can not find command
Matoking commented 4 years ago

Did you try removing the ~/.local/pipx directory and reinstalling pipx? pipx should take care of installing wheel for you and the fact it complains about the missing package means something is still wrong.

legluondunet commented 4 years ago

Ok, I reinstall wheel python3 package: sudo apt-get install python3-wheel --reinstall

and now the error message gone.

Everything works like it should now, thank you very much for your help.

(and don't forget to specify --spec again for Ubuntu users)

legluondunet commented 4 years ago

The issue was not protontricks related but Ubuntu related: after upgrading Ubuntu 19.04 to 20.04, the local python3/pipx located in my home was obsolete. And more than that I use one time this line in sudo and another time in simple user: pipx install --spec git+https://github.com/Matoking/protontricks.git protontricks so I had two obsolete python3/pipx/protontricks directories, one in /home/legluondunet/.local/bin and another in /usr/local/bin.

What a mess! Once again thank you for your help.