dhmay / jamstats

Tools for making plots on roller derby scoreboard data and following live game data
https://jamstats.net
GNU General Public License v2.0
19 stars 2 forks source link

install problem with pip / pipx #175

Closed charlie-chaperon closed 7 months ago

charlie-chaperon commented 8 months ago

Although the dependency for attrdict has been removed in 1.4.3, I still get this error message when I try to install Jamstats via pipx:

PIP STDOUT

Collecting jamstats Using cached jamstats-1.4.3.tar.gz (44 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting pandas>=1.3.4 (from jamstats) Using cached pandas-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB) Collecting seaborn>=0.11.2 (from jamstats) Using cached seaborn-0.13.2-py3-none-any.whl.metadata (5.4 kB) Collecting flask>=2.2.2 (from jamstats) Using cached flask-3.0.2-py3-none-any.whl.metadata (3.6 kB) Collecting wxpython==4.2.0 (from jamstats) Using cached wxPython-4.2.0.tar.gz (71.0 MB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'error'

PIP STDERR

error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [8 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-k_tehdih/wxpython_1d4591d1bfdc4522b7791bac62ba1c46/setup.py", line 27, in from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName File "/tmp/pip-install-k_tehdih/wxpython_1d4591d1bfdc4522b7791bac62ba1c46/buildtools/config.py", line 30, in from attrdict import AttrDict ModuleNotFoundError: No module named 'attrdict' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

It seems that also wxpython is involved in the problem.

I tested this on 2 Linux Systems: Ubuntu 20.04 LTS Debian 12 both use Python 3.10

I tried pipx on both (because I don't use a lot of python and in theory it should reduce dependency issues) and pip on the Ubuntu system.

Expected behavior Jamstats 1.4.3 should be installed by pip / pipx

dhmay commented 8 months ago

Darn. I'll try raising the required version of wxpython, and this time I'll verify pip install on 3.10 before I hand it back to you to verify. I'll have to thoroughly test the GUI with a wxpython version change... will take me a while.

dhmay commented 8 months ago

After a bit of googling, it looks like wxpython 4.2.0 (which I've pinned in Jamstats) is known to have this problem, and a potential workaround is to run:

pip install attrdict3 pip install requests

before pip installing jamstats. You may have to uninstall attrdict, first, if you have that installed.

I'm going to see if I can unpin wxpython and get things working on a newer version, but in the meantime that might be a workaround.

dhmay commented 8 months ago

I uploaded version 1.4.4 to Pypi, with wxpython unpinned and requiring >=4.2.1. This should fix your problem with Python 3.10+, but I haven't verified that yet.

Related: in Issue #143 , someone wanted to run jamstats headless, and the GUI bits (including wxpython) were causing problems. So, I created a separate package called jamstats-nogui. If you don't need the GUI, you should be able to pip install that without having to take on wxpython, which is enormous. However, I haven't updated that package in a while, so it's still on 1.2.something. I'll try to take care of that soon.

dhmay commented 8 months ago

jamstats-nogui is now updated to version 1.4.4.

dhmay commented 8 months ago

Fixed, I believe. Version 1.4.5, now in Pypi (and therefore what you get if you type pip install jamstats or pip install jamstats-nogui) should now install and run successfully with pip. Please verify! If that looks good I'll make it the official latest release.

FYI, I'm pretty sure I had a problem preventing pip install from working for the last several months. No one brought it to my attention (until you! thank you!) because most people running Jamstats are using the Windows or Mac release binaries. If you have future trouble with pip and the binaries are an option, they are more likely to work than pip. Naturally, I want both to work, but because of the CRG dependency testing is difficult.

dhmay commented 8 months ago

Darn, there may be some issues with scoreboard connectivity in python 3.12. Reopening until I can nail that down.

dhmay commented 8 months ago

OK, @charlie-chaperon , I fixed the remaining issues with JamStats in Python 3.12. Version 3.4.6, now in Pypi, should install properly and work properly.

I wouldn't be surprised if there are a few cosmetic changes. Several packages needed upgrades along with the 3.12 upgrade.

Please check it out and let me know if it's working for you. Also, please let me know what kind of functionality you're using -- are you generating PDFs with plots of completed games, or using it for live game calling?

charlie-chaperon commented 8 months ago

Ok, I finally had the time to test on both of my systems. It got quite messy, so let's handle this step by step:

  1. jamstats-nogui finally worked. The install was successful. Both pip and pipx manage to install the package. However

work-around I edited the following 4 files in my install directory [this was installed using pipx which creates it's own virtual environment]

/home/user/.local/pipx/venvs/jamstats-nogui/lib/python3.10/site-packages/attrdict/ [this will be different for other users!]

by changing 'from collections import Mapping' into 'from collections.abc import Mapping'

suggestion The proposed solution was to either patch the code manually or revert to Python 3.9 This might work for a while but support for Python 3.9 will end sooner or later. It seemed to only affect attrdict which hasn't seen updates for years. Maybe you could make a fork for attrdict that contains the changes. You also wrote that installing attrdict3 before might help. Could you automate the install so that attrdict3 is used instead of attrdict?

$ jamstats-nogui --jsonfile STATS-2023-05-14_some_game.json

jamstats version unknown, by Damon May Failed to extract game status. Exception: single positional indexer is out-of-bounds Failed to open file STATS-2023-05-14_some_game.json: list index out of range

  1. jamstats still doesn't work, but for different reasons. I could not install it in either pip (Ubuntu 22.04 system) or pipx (Debian 12 system).

PIP STDERR

error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [132 lines of output] running bdistwheel running build WARNING: Building this way assumes that all generated files have been generated already. If that is not the case then use build.py directly to generate the source and perform the build stage. You can use --skip-build with the bdist* or install commands to avoid this message and the wxWidgets and Phoenix build steps in the future.

  "/home/user/.local/pipx/venvs/jamstats/bin/python" -u build.py build
  /tmp/pip-install-j6n3sdi9/wxpython_5d5d4b91c2c243c7bd4f076093a12e6e/build.py:43: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
    from distutils.dep_util import newer, newer_group
  Will build using: "/home/user/.local/pipx/venvs/jamstats/bin/python"
  3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
  Python's architecture is 64bit
  cfg.VERSION: 4.2.1

  Running command: build
  Running command: build_wx
  wxWidgets build options: ['--wxpython', '--unicode', '--gtk3']
  Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl']
  /tmp/pip-install-j6n3sdi9/wxpython_5d5d4b91c2c243c7bd4f076093a12e6e/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl
  checking build system type... x86_64-pc-linux-gnu
  checking host system type... x86_64-pc-linux-gnu
  checking for toolkit... gtk
  checking for gcc... gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for gcc option to accept ISO C89... none needed
  checking whether we are using the Intel C compiler... no
  checking how to run the C preprocessor... gcc -E
  checking for grep that handles long lines and -e... /usr/bin/grep
  checking for egrep... /usr/bin/grep -E
  checking whether gcc needs -traditional... no
  checking for g++... g++
  checking whether we are using the GNU C++ compiler... yes
  checking whether g++ accepts -g... yes
  checking whether we are using the Intel C++ compiler... no
  checking whether we are using the Sun C++ compiler... no
  checking for ar... ar
  checking for ANSI C header files... yes
  checking for sys/types.h... yes
  checking for sys/stat.h... yes
  checking for stdlib.h... yes
  checking for string.h... yes
  checking for memory.h... yes
  checking for strings.h... yes
  checking for inttypes.h... yes
  checking for stdint.h... yes
  checking for unistd.h... yes
  checking for langinfo.h... yes
  checking for wchar.h... yes
  checking for sys/select.h... yes
  checking for cxxabi.h... yes
  checking for an ANSI C-conforming const... yes
  checking for inline... inline
  checking size of short... 2
  checking size of void *... 8
  checking size of int... 4
  checking size of long... 8
  checking size of size_t... 8
  checking size of long long... 8
  checking size of wchar_t... 4
  checking for va_copy... yes
  checking for _FILE_OFFSET_BITS value needed for large files... 64
  checking if large file support is available... yes
  checking for _LARGEFILE_SOURCE value needed for large files... no
  checking whether byte ordering is bigendian... no
  checking for std::wstring in <string>... yes
  checking for std::istream... yes
  checking for std::ostream... yes
  checking for type_traits... yes
  checking for __sync_xxx_and_fetch builtins... yes
  checking for libraries directories... /usr/lib/x86_64-linux-gnu /usr/lib
  checking for cos... no
  checking for floor... no
  checking if floating point functions link without -lm... no
  checking for sin... yes
  checking for ceil... yes
  checking if floating point functions link with -lm... yes
  checking for strtoull... yes
  checking for pkg-config... no
  checking for LIBPCRE... checking whether pcre submodule exists... yes
  checking for zlib.h >= 1.1.4... yes
  checking for zlib.h... (cached) yes
  checking for deflate in -lz... yes
  checking for png.h > 0.90... no
  checking for png.h... (cached) no
  configure: WARNING: system png library not found or too old, will use built-in instead
  checking whether png.c file exists... yes
  checking for jpeglib.h... no
  configure: WARNING: system jpeg library not found, will use built-in instead
  checking whether jpeglib.h file exists... yes
  checking for jbg_dec_init in -ljbig... no
  checking for LIBTIFF... not found via pkg-config
  checking for tiffio.h... no
  configure: WARNING: system tiff library not found, will use built-in instead
  checking whether tiff.h file exists... yes
  checking for expat.h... yes
  checking if expat.h is valid C++ header... yes
  checking for XML_ParserCreate in -lexpat... yes
  checking for LIBCURL... not found
  checking for GTK+ version...
  checking for pkg-config... no
  checking for GTK+ - version >= 3.0.0... no
  *** A new enough version of pkg-config was not found.
  *** See http://pkgconfig.sourceforge.net
  configure: error:
  The development files for GTK+ were not found. For GTK+ 2, please
  ensure that pkg-config is in the path and that gtk+-2.0.pc is
  installed. For GTK+ 1.2 please check that gtk-config is in the path,
  and that the version is 1.2.3 or above. Also check that the
  libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
  --libs' are in the LD_LIBRARY_PATH or equivalent.

  Error running configure
  ERROR: failed building wxWidgets
  Traceback (most recent call last):
    File "/tmp/pip-install-j6n3sdi9/wxpython_5d5d4b91c2c243c7bd4f076093a12e6e/build.py", line 1563, in cmd_build_wx
      wxbuild.main(wxDir(), build_options)
    File "/tmp/pip-install-j6n3sdi9/wxpython_5d5d4b91c2c243c7bd4f076093a12e6e/buildtools/build_wxwidgets.py", line 379, in main
      exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
    File "/tmp/pip-install-j6n3sdi9/wxpython_5d5d4b91c2c243c7bd4f076093a12e6e/buildtools/build_wxwidgets.py", line 72, in exitIfError
      raise builder.BuildError(msg)
  buildtools.builder.BuildError: Error running configure
  Finished command: build_wx (0m20.459s)
  Finished command: build (0m20.459s)
  Command '"/home/user/.local/pipx/venvs/jamstats/bin/python" -u build.py build' failed with exit code 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for wxpython error: subprocess-exited-with-error


So the gtk developement files were missing but I could solve that pretty quick:
"sudo apt install libgtk-3-dev"

When I try to install jamstats now, the process gets stuck when building the wheels:

> $ pip install jamstats

> Defaulting to user installation because normal site-packages is not writeable
> Collecting jamstats
>   Using cached jamstats-1.4.6-py3-none-any.whl
> Collecting pandas>=2.2.0 (from jamstats)
>   Using cached pandas-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)
> Collecting seaborn>=0.13.2 (from jamstats)
>   Using cached seaborn-0.13.2-py3-none-any.whl.metadata (5.4 kB)
> Collecting flask>=3.0.2 (from jamstats)
>   Using cached flask-3.0.2-py3-none-any.whl.metadata (3.6 kB)
> Collecting eventlet>=0.35.1 (from jamstats)
>   Using cached eventlet-0.35.1-py3-none-any.whl.metadata (5.5 kB)
> Collecting websocket-client>=1.7.0 (from jamstats)
>   Using cached websocket_client-1.7.0-py3-none-any.whl.metadata (7.9 kB)
> Collecting Flask-SocketIO>=5.3.6 (from jamstats)
>   Using cached Flask_SocketIO-5.3.6-py3-none-any.whl.metadata (2.6 kB)
> Collecting python-engineio>=4.9.0 (from jamstats)
>   Using cached python_engineio-4.9.0-py3-none-any.whl.metadata (2.2 kB)
> Collecting gevent>=24.2.1 (from jamstats)
>   Using cached gevent-24.2.1-cp310-cp310-manylinux_2_28_x86_64.whl.metadata (13 kB)
> Collecting gevent-websocket>=0.10.1 (from jamstats)
>   Using cached gevent_websocket-0.10.1-py3-none-any.whl (22 kB)
> Collecting dnspython==2.2.1 (from jamstats)
>   Using cached dnspython-2.2.1-py3-none-any.whl (269 kB)
> Collecting urllib3==1.26.7 (from jamstats)
>   Using cached urllib3-1.26.7-py2.py3-none-any.whl (138 kB)
> Collecting wxpython>=4.2.1 (from jamstats)
>   Using cached wxPython-4.2.1.tar.gz (73.7 MB)
>   Preparing metadata (setup.py) ... done
> Collecting gooey>=1.0.8.1 (from jamstats)
>   Using cached Gooey-1.0.8.1-py2.py3-none-any.whl (680 kB)
> Collecting greenlet>=1.0 (from eventlet>=0.35.1->jamstats)
>   Using cached greenlet-3.0.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (3.8 kB)
> Collecting Werkzeug>=3.0.0 (from flask>=3.0.2->jamstats)
>   Using cached werkzeug-3.0.1-py3-none-any.whl.metadata (4.1 kB)
> Collecting Jinja2>=3.1.2 (from flask>=3.0.2->jamstats)
>   Using cached Jinja2-3.1.3-py3-none-any.whl.metadata (3.3 kB)
> Collecting itsdangerous>=2.1.2 (from flask>=3.0.2->jamstats)
>   Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB)
> Requirement already satisfied: click>=8.1.3 in ./.local/lib/python3.10/site-packages (from flask>=3.0.2->jamstats) (8.1.7)
> Collecting blinker>=1.6.2 (from flask>=3.0.2->jamstats)
>   Using cached blinker-1.7.0-py3-none-any.whl.metadata (1.9 kB)
> Collecting python-socketio>=5.0.2 (from Flask-SocketIO>=5.3.6->jamstats)
>   Using cached python_socketio-5.11.1-py3-none-any.whl.metadata (3.2 kB)
> Collecting zope.event (from gevent>=24.2.1->jamstats)
>   Using cached zope.event-5.0-py3-none-any.whl.metadata (4.4 kB)
> Collecting zope.interface (from gevent>=24.2.1->jamstats)
>   Using cached zope.interface-6.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (41 kB)
> Requirement already satisfied: Pillow>=4.3.0 in /usr/lib/python3/dist-packages (from gooey>=1.0.8.1->jamstats) (9.0.1)
> Requirement already satisfied: psutil>=5.4.2 in /usr/lib/python3/dist-packages (from gooey>=1.0.8.1->jamstats) (5.9.0)
> Collecting colored>=1.3.93 (from gooey>=1.0.8.1->jamstats)
>   Using cached colored-2.2.4-py3-none-any.whl.metadata (3.6 kB)
> Collecting pygtrie>=2.3.3 (from gooey>=1.0.8.1->jamstats)
>   Using cached pygtrie-2.5.0-py3-none-any.whl (25 kB)
> Collecting numpy<2,>=1.22.4 (from pandas>=2.2.0->jamstats)
>   Using cached numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
> Collecting python-dateutil>=2.8.2 (from pandas>=2.2.0->jamstats)
>   Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
> Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas>=2.2.0->jamstats) (2022.1)
> Collecting tzdata>=2022.7 (from pandas>=2.2.0->jamstats)
>   Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)
> Collecting simple-websocket>=0.10.0 (from python-engineio>=4.9.0->jamstats)
>   Using cached simple_websocket-1.0.0-py3-none-any.whl.metadata (1.3 kB)
> Requirement already satisfied: matplotlib!=3.6.1,>=3.4 in /usr/lib/python3/dist-packages (from seaborn>=0.13.2->jamstats) (3.5.1)
> Requirement already satisfied: six in /usr/lib/python3/dist-packages (from wxpython>=4.2.1->jamstats) (1.16.0)
> Collecting MarkupSafe>=2.0 (from Jinja2>=3.1.2->flask>=3.0.2->jamstats)
>   Using cached MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.0 kB)
> Collecting bidict>=0.21.0 (from python-socketio>=5.0.2->Flask-SocketIO>=5.3.6->jamstats)
>   Using cached bidict-0.23.1-py3-none-any.whl.metadata (8.7 kB)
> Collecting wsproto (from simple-websocket>=0.10.0->python-engineio>=4.9.0->jamstats)
>   Using cached wsproto-1.2.0-py3-none-any.whl (24 kB)
> Requirement already satisfied: setuptools in ./.local/lib/python3.10/site-packages (from zope.event->gevent>=24.2.1->jamstats) (69.0.3)
> Collecting h11<1,>=0.9.0 (from wsproto->simple-websocket>=0.10.0->python-engineio>=4.9.0->jamstats)
>   Using cached h11-0.14.0-py3-none-any.whl (58 kB)
> Using cached eventlet-0.35.1-py3-none-any.whl (359 kB)
> Using cached flask-3.0.2-py3-none-any.whl (101 kB)
> Using cached Flask_SocketIO-5.3.6-py3-none-any.whl (18 kB)
> Using cached gevent-24.2.1-cp310-cp310-manylinux_2_28_x86_64.whl (6.5 MB)
> Using cached pandas-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB)
> Using cached python_engineio-4.9.0-py3-none-any.whl (57 kB)
> Using cached seaborn-0.13.2-py3-none-any.whl (294 kB)
> Using cached websocket_client-1.7.0-py3-none-any.whl (58 kB)
> Using cached blinker-1.7.0-py3-none-any.whl (13 kB)
> Using cached colored-2.2.4-py3-none-any.whl (16 kB)
> Using cached greenlet-3.0.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (616 kB)
> Using cached Jinja2-3.1.3-py3-none-any.whl (133 kB)
> Using cached numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
> Using cached python_socketio-5.11.1-py3-none-any.whl (75 kB)
> Using cached simple_websocket-1.0.0-py3-none-any.whl (13 kB)
> Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)
> Using cached werkzeug-3.0.1-py3-none-any.whl (226 kB)
> Using cached zope.event-5.0-py3-none-any.whl (6.8 kB)
> Using cached zope.interface-6.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (247 kB)
> Using cached bidict-0.23.1-py3-none-any.whl (32 kB)
> Using cached MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
> Building wheels for collected packages: wxpython
>   Building wheel for wxpython (setup.py) ...

When I get here, my CPU is exhausted by 100% and I can see a lot of data traffic in /tmp
After 30 minutes without any real outcome, I canceled the process.

**question mark**
The problems with installing jamstats could be distribution related. I probably need to install other packages / dependencies in Debian/Ubuntu but I haven't found out more until now.
dhmay commented 8 months ago

Thank you for that deep dive!

I think it's likely that the issues with jamstats are distribution-related, and specifically related to wxpython. Assuming you don't really need wxpython (it's only for the GUI interface), let's focus on jamstats-nogui to get you up and running.

I'm surprised you're running into an attrdict dependency with jamstats-nogui version 3.4.6. As you can see, the setup.py file I use to build jamstats-nogui removes the dependencies on wxpython and also on attrdict. It's possible that something else is pulling in attrdict, but can you please check to make sure your version of jamstats-nogui is version 3.4.6?

As for jamstats-nogui not working, could you please rerun it with the --debug flag and let me know what you see?

dhmay commented 8 months ago

To be clearer: just now, I laid down a new Python 3.12.2 install, and I ran pip install jamstats-nogui, and pip list | grep attrd returns nothing. So, I don't think jamstats-nogui 3.4.6 has any dependency on attrdict, direct or indirect. Maybe try pip install --upgrade jamstats-nogui?

charlie-chaperon commented 8 months ago

Interesting, that might be the source of the problem!

package jamstats-nogui 1.2.1.5, installed using Python 3.10.12

  • jamstats-nogui

'pip install jamstats-nogui' obviously installs the old version, not the newer ones.

I have python 3.9, 3.10 and 3.11 installed on my system, but not 3.12. Could that cause the problem? I'll do research for more once I got the recent version of jamstats-nogui installed ;)

dhmay commented 8 months ago

I can also back off on the required version of Python, a bit. If 3.12 is too new, I could require 3.10 or 3.11.

I don't have any other known users getting Jamstats through pip (well, maybe one), so you get to choose! What's a good version of Python to require?

charlie-chaperon commented 8 months ago

Hi, I just checked the output when I try to install via pip and found something interesting:

$ pip3 install jamstats-nogui

Defaulting to user installation because normal site-packages is not writeable Collecting jamstats-nogui Downloading jamstats-nogui-1.4.6.tar.gz (39 kB) Preparing metadata (setup.py) ... done WARNING: Generating metadata for package jamstats-nogui produced metadata for project name jamstats. Fix your #egg=jamstats-nogui fragments. Discarding https://files.pythonhosted.org/packages/8a/9d/1105101c471810254b32bc7c60eee06e59bdbf700b9094768247c316a163/jamstats-nogui-1.4.6.tar.gz (from https://pypi.org/simple/jamstats-nogui/): Requested jamstats from https://files.pythonhosted.org/packages/8a/9d/1105101c471810254b32bc7c60eee06e59bdbf700b9094768247c316a163/jamstats-nogui-1.4.6.tar.gz has inconsistent name: expected 'jamstats-nogui', but metadata has 'jamstats' Downloading jamstats-nogui-1.4.5.tar.gz (39 kB) Preparing metadata (setup.py) ... done WARNING: Generating metadata for package jamstats-nogui produced metadata for project name jamstats. Fix your #egg=jamstats-nogui fragments. Discarding https://files.pythonhosted.org/packages/4e/ff/a24b8e9e79e52620ae18f6a6a7d3b59b817c238408ca9a8bc221c2276909/jamstats-nogui-1.4.5.tar.gz (from https://pypi.org/simple/jamstats-nogui/): Requested jamstats from https://files.pythonhosted.org/packages/4e/ff/a24b8e9e79e52620ae18f6a6a7d3b59b817c238408ca9a8bc221c2276909/jamstats-nogui-1.4.5.tar.gz has inconsistent name: expected 'jamstats-nogui', but metadata has 'jamstats' Downloading jamstats-nogui-1.4.4.tar.gz (31 kB) Preparing metadata (setup.py) ... done WARNING: Generating metadata for package jamstats-nogui produced metadata for project name jamstats. Fix your #egg=jamstats-nogui fragments. Discarding https://files.pythonhosted.org/packages/17/1e/0eb726befa3727deb7544c039910d2ddd007deb9b3c67201cf7d032a26cf/jamstats-nogui-1.4.4.tar.gz (from https://pypi.org/simple/jamstats-nogui/): Requested jamstats from https://files.pythonhosted.org/packages/17/1e/0eb726befa3727deb7544c039910d2ddd007deb9b3c67201cf7d032a26cf/jamstats-nogui-1.4.4.tar.gz has inconsistent name: expected 'jamstats-nogui', but metadata has 'jamstats' Downloading jamstats-nogui-1.2.1.5.tar.gz (39 kB) Preparing metadata (setup.py) ... done Collecting pandas>=1.3.4 (from jamstats-nogui) Downloading pandas-2.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB) Collecting seaborn>=0.11.2 (from jamstats-nogui) Using cached seaborn-0.13.2-py3-none-any.whl.metadata (5.4 kB) Collecting flask>=2.2.2 (from jamstats-nogui) Using cached flask-3.0.2-py3-none-any.whl.metadata (3.6 kB) Collecting attrdict>=2.0.1 (from jamstats-nogui) Using cached attrdict-2.0.1-py2.py3-none-any.whl (9.9 kB) Collecting websocket-client>=1.2.1 (from jamstats-nogui) Using cached websocket_client-1.7.0-py3-none-any.whl.metadata (7.9 kB) Collecting Flask-SocketIO>=5.3.2 (from jamstats-nogui) Using cached Flask_SocketIO-5.3.6-py3-none-any.whl.metadata (2.6 kB) Collecting python-engineio>=4.3.4 (from jamstats-nogui) Using cached python_engineio-4.9.0-py3-none-any.whl.metadata (2.2 kB) Collecting gevent>=22.10.2 (from jamstats-nogui) Using cached gevent-24.2.1-cp310-cp310-manylinux_2_28_x86_64.whl.metadata (13 kB) Collecting gevent-websocket>=0.10.1 (from jamstats-nogui) Using cached gevent_websocket-0.10.1-py3-none-any.whl (22 kB) Requirement already satisfied: six in /usr/lib/python3/dist-packages (from attrdict>=2.0.1->jamstats-nogui) (1.16.0) Collecting Werkzeug>=3.0.0 (from flask>=2.2.2->jamstats-nogui) Using cached werkzeug-3.0.1-py3-none-any.whl.metadata (4.1 kB) Collecting Jinja2>=3.1.2 (from flask>=2.2.2->jamstats-nogui) Using cached Jinja2-3.1.3-py3-none-any.whl.metadata (3.3 kB) Collecting itsdangerous>=2.1.2 (from flask>=2.2.2->jamstats-nogui) Downloading itsdangerous-2.1.2-py3-none-any.whl.metadata (2.9 kB) Requirement already satisfied: click>=8.1.3 in /home/user/.local/lib/python3.10/site-packages (from flask>=2.2.2->jamstats-nogui) (8.1.7) Collecting blinker>=1.6.2 (from flask>=2.2.2->jamstats-nogui) Using cached blinker-1.7.0-py3-none-any.whl.metadata (1.9 kB) Collecting python-socketio>=5.0.2 (from Flask-SocketIO>=5.3.2->jamstats-nogui) Using cached python_socketio-5.11.1-py3-none-any.whl.metadata (3.2 kB) Collecting zope.event (from gevent>=22.10.2->jamstats-nogui) Using cached zope.event-5.0-py3-none-any.whl.metadata (4.4 kB) Collecting zope.interface (from gevent>=22.10.2->jamstats-nogui) Using cached zope.interface-6.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (41 kB) Collecting greenlet>=2.0.0 (from gevent>=22.10.2->jamstats-nogui) Using cached greenlet-3.0.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (3.8 kB) Collecting numpy<2,>=1.22.4 (from pandas>=1.3.4->jamstats-nogui) Using cached numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB) Collecting python-dateutil>=2.8.2 (from pandas>=1.3.4->jamstats-nogui) Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB) Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas>=1.3.4->jamstats-nogui) (2022.1) Collecting tzdata>=2022.7 (from pandas>=1.3.4->jamstats-nogui) Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB) Collecting simple-websocket>=0.10.0 (from python-engineio>=4.3.4->jamstats-nogui) Using cached simple_websocket-1.0.0-py3-none-any.whl.metadata (1.3 kB) Requirement already satisfied: matplotlib!=3.6.1,>=3.4 in /usr/lib/python3/dist-packages (from seaborn>=0.11.2->jamstats-nogui) (3.5.1) Collecting MarkupSafe>=2.0 (from Jinja2>=3.1.2->flask>=2.2.2->jamstats-nogui) Using cached MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.0 kB) Collecting bidict>=0.21.0 (from python-socketio>=5.0.2->Flask-SocketIO>=5.3.2->jamstats-nogui) Using cached bidict-0.23.1-py3-none-any.whl.metadata (8.7 kB) Collecting wsproto (from simple-websocket>=0.10.0->python-engineio>=4.3.4->jamstats-nogui) Downloading wsproto-1.2.0-py3-none-any.whl.metadata (5.6 kB) Requirement already satisfied: setuptools in /home/user/.local/lib/python3.10/site-packages (from zope.event->gevent>=22.10.2->jamstats-nogui) (69.0.3) Collecting h11<1,>=0.9.0 (from wsproto->simple-websocket>=0.10.0->python-engineio>=4.3.4->jamstats-nogui) Downloading h11-0.14.0-py3-none-any.whl.metadata (8.2 kB) Using cached flask-3.0.2-py3-none-any.whl (101 kB) Using cached Flask_SocketIO-5.3.6-py3-none-any.whl (18 kB) Using cached gevent-24.2.1-cp310-cp310-manylinux_2_28_x86_64.whl (6.5 MB) Downloading pandas-2.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.0/13.0 MB 4.5 MB/s eta 0:00:00 Using cached python_engineio-4.9.0-py3-none-any.whl (57 kB) Using cached seaborn-0.13.2-py3-none-any.whl (294 kB) Using cached websocket_client-1.7.0-py3-none-any.whl (58 kB) Using cached blinker-1.7.0-py3-none-any.whl (13 kB) Using cached greenlet-3.0.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (616 kB) Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB) Using cached Jinja2-3.1.3-py3-none-any.whl (133 kB) Using cached numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB) Using cached python_socketio-5.11.1-py3-none-any.whl (75 kB) Using cached simple_websocket-1.0.0-py3-none-any.whl (13 kB) Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB) Using cached werkzeug-3.0.1-py3-none-any.whl (226 kB) Using cached zope.event-5.0-py3-none-any.whl (6.8 kB) Using cached zope.interface-6.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (247 kB) Using cached bidict-0.23.1-py3-none-any.whl (32 kB) Using cached MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB) Using cached wsproto-1.2.0-py3-none-any.whl (24 kB) Using cached h11-0.14.0-py3-none-any.whl (58 kB) Building wheels for collected packages: jamstats-nogui Building wheel for jamstats-nogui (setup.py) ... done Created wheel for jamstats-nogui: filename=jamstats_nogui-1.2.1.5-py3-none-any.whl size=42515 sha256=d3fad98a5c39eb2e16a4aa809b67ce99ed4b660ba8f3a9e88bd4ca75c6e1107c Stored in directory: /home/user/.cache/pip/wheels/18/bb/72/53a34ed80356dc550f213fe9e48fafc3c772b8558d3ae36921 Successfully built jamstats-nogui Installing collected packages: zope.interface, zope.event, websocket-client, tzdata, python-dateutil, numpy, MarkupSafe, itsdangerous, h11, greenlet, blinker, bidict, attrdict, wsproto, Werkzeug, pandas, Jinja2, gevent, simple-websocket, seaborn, gevent-websocket, flask, python-engineio, python-socketio, Flask-SocketIO, jamstats-nogui Successfully installed Flask-SocketIO-5.3.6 Jinja2-3.1.3 MarkupSafe-2.1.5 Werkzeug-3.0.1 attrdict-2.0.1 bidict-0.23.1 blinker-1.7.0 flask-3.0.2 gevent-24.2.1 gevent-websocket-0.10.1 greenlet-3.0.3 h11-0.14.0 itsdangerous-2.1.2 jamstats-nogui-1.2.1.5 numpy-1.26.4 pandas-2.2.1 python-dateutil-2.8.2 python-engineio-4.9.0 python-socketio-5.11.1 seaborn-0.13.2 simple-websocket-1.0.0 tzdata-2024.1 websocket-client-1.7.0 wsproto-1.2.0 zope.event-5.0 zope.interface-6.2

Have a look at these messages:

Requested jamstats from https://files.pythonhosted.org/packages/8a/9d/1105101c471810254b32bc7c60eee06e59bdbf700b9094768247c316a163/jamstats-nogui-1.4.6.tar.gz has inconsistent name: expected 'jamstats-nogui', but metadata has 'jamstats'

Pip doesn't install versions 1.4.6 , 1.4.5 or 1.4.4 because of this error. The newest version it can install is 1.2.1.5 Did the metadata for the new packages get messed up?

dhmay commented 8 months ago

I'm using pyenv to manage Python environments, and I just did the following:

pyenv virtualenv 3.10.0 310_noguitest

pyenv activate 310_noguitest

pip install jamstats-nogui`

I get a very different error than you get, but I suspect they're related:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. jamstats 1.4.6 requires gooey>=1.0.8.1, which is not installed. jamstats 1.4.6 requires wxpython>=4.2.1, which is not installed.

That's with pip version 21.2.3.

I think that managing two packages with the same codebase ('jamstats' and 'jamstats-nogui') is probably a terrible hack that worked in 3.7 but is not working in 3.10. I'll focus on getting the 'jamstats' package to work in 3.10, instead.

dhmay commented 8 months ago

I'm going to keep working on jamstats in Python 3.10+, because that needs to work eventually. But in the meantime could you just use pyenv or something to install 3.9, and then install jamstats there?

dhmay commented 8 months ago

I ran pipx install jamstats from a fresh 3.10.1 environment, successfully, and when I put the "bin/jamstats" script on my PATH I was able to run the jamstats command properly. So, I think the jamstats package should be working, except for the problems you're getting with building wxpython on your Linux distro that cause it to hang forever.

So, how about trying this:

  1. Install all of jamstats' dependencies except wxpython
    • you can find them in requirements.txt)
    • If you want a semi-automated way to do that, you could download that file and then pip install $(grep -ivE "wxpython" requirements.txt)
  2. pip install jamstats --no-deps

If that works, I can add those instructions to the jamstats readme and then get rid of the jamstats-nogui package. It's not super easy, but I think it's better than my bad hack of having two different packages.

charlie-chaperon commented 8 months ago

Good news first: I managed to install jamstats using your workaround. Generating a pdf from the json file did work.

What did not work: The webserver did not work because resources were missing and the jamstats version file couldn't be found.

I haven't got much time but I plan to do thorough testing next weekend. Hopefully I'll find out more. I might be that my python install is just messed up.

Please keep this ticket open until later.

dhmay commented 8 months ago

All right! We're getting there. I hope.

I can't reproduce the problem you described, so please paste the error messages here when you have a chance. If I can't fix it, I should at least be able to code defensively around it so that, if the version file isn't found, it will run without it.

dhmay commented 7 months ago

Hm, I was going to do some defensive coding to try to prevent any problems associated with trying to get the jamstats version, but it looks like I already did that. Everywhere I can find where the code is getting the jamstats version, it's using jamstats.util.resources.get_jamstats_version(), which puts everything in a try: except: block.

So, either I've missed somewhere where the version is being loaded another way, or the traceback.format_exc() in the except: block is raising some kind of error of its own... or the error is actually not with loading the version number.

Please try it again with the --debug flag and send the error, when you get a chance.

charlie-chaperon commented 7 months ago

Ok, let's start again with the things that worked:

  1. It turned out that the used CPU is just old and needs time. After 30-45 minutes of waiting for the compiling to finish, I got jamstats 1.4.6 installed via pip / pipx
  2. generating a pdf from a json file worked with the gui version

it does complain a little bit, but it works so far. gui log output:

jamstats version unknown, by Damon May Mode not specified. Inferred mode pdf Output filepath not provided. Using input filepath with extension .pdf instead of .json Writing PDF file... Using theme white /home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/data/game_data.py:277: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation. pdf_jammer_data = pd.concat([pdf_jammer_data, pdf_onlypivot_data]) /home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/data/game_data.py:277: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation. pdf_jammer_data = pd.concat([pdf_jammer_data, pdf_onlypivot_data]) Failed to load logo image from resources: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_logo.png' Wrote /home/charlie/Downloads/crg-game-Game_3.pdf

What did not work:

  1. Jamstats does not work with input from the scoreboard. When I open the webpage that is supposed to show the plots, I doesn't show any and it looks like it cannot access vital data.

from the gui log:

jamstats version unknown, by Damon May Connecting to server localhost, port 8000... Mode not specified. Inferred mode web Using theme white

Starting jamstats server... Point your browser to: http://localhost:8080

Opened connection. 2024-03-03 20:11:10,289 | jamstats.io.scoreboard_server_io | INFO: Opened connection. Failed to load version from resources: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt' Traceback (most recent call last): File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 41, in get_jamstats_version return get_resource("jamstats_version.txt").strip() File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 71, in get_resource contents = path.read_bytes() if is_binary else path.read_text() File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "/usr/lib/python3.10/pathlib.py", line 1119, in open return self._accessor.open(self, mode, buffering, encoding, errors, FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt'

Exception while rendering template: jamstats_gameplots.html EXC: Traceback (most recent call last): EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/web/statserver.py", line 296, in index EXC: return render_template("jamstats_gameplots.html", EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 149, in render_template EXC: template = app.jinja_env.get_or_select_template(template_name_or_list) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1081, in get_or_select_template EXC: return self.get_template(template_name_or_list, parent, globals) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template EXC: return self._load_template(name, globals) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template EXC: template = self.loader.load(self, name, self.make_globals(globals)) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/loaders.py", line 125, in load EXC: source, filename, uptodate = self.get_source(environment, name) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 65, in get_source EXC: return self._get_source_fast(environment, template) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 99, in _get_source_fast EXC: raise TemplateNotFound(template) EXC: jinja2.exceptions.TemplateNotFound: jamstats_gameplots.html Failed to load version from resources: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt' Traceback (most recent call last): File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/web/statserver.py", line 296, in index return render_template("jamstats_gameplots.html", File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 149, in render_template template = app.jinja_env.get_or_select_template(template_name_or_list) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1081, in get_or_select_template return self.get_template(template_name_or_list, parent, globals) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template return self._load_template(name, globals) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/loaders.py", line 125, in load source, filename, uptodate = self.get_source(environment, name) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 65, in get_source return self._get_source_fast(environment, template) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 99, in _get_source_fast raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: jamstats_gameplots.html

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 41, in get_jamstats_version return get_resource("jamstats_version.txt").strip() File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 71, in get_resource contents = path.read_bytes() if is_binary else path.read_text() File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "/usr/lib/python3.10/pathlib.py", line 1119, in open return self._accessor.open(self, mode, buffering, encoding, errors, FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt'

Failed to load logo image from resources: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_logo.png' Failed to load version from resources: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt' Traceback (most recent call last): File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 41, in get_jamstats_version return get_resource("jamstats_version.txt").strip() File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 71, in get_resource contents = path.read_bytes() if is_binary else path.read_text() File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "/usr/lib/python3.10/pathlib.py", line 1119, in open return self._accessor.open(self, mode, buffering, encoding, errors, FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt'

Exception while rendering template: jamstats_gameplots.html EXC: Traceback (most recent call last): EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/web/statserver.py", line 296, in index EXC: return render_template("jamstats_gameplots.html", EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 149, in render_template EXC: template = app.jinja_env.get_or_select_template(template_name_or_list) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1081, in get_or_select_template EXC: return self.get_template(template_name_or_list, parent, globals) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template EXC: return self._load_template(name, globals) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template EXC: template = self.loader.load(self, name, self.make_globals(globals)) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/loaders.py", line 125, in load EXC: source, filename, uptodate = self.get_source(environment, name) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 65, in get_source EXC: return self._get_source_fast(environment, template) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 99, in _get_source_fast EXC: raise TemplateNotFound(template) EXC: jinja2.exceptions.TemplateNotFound: jamstats_gameplots.html Failed to load version from resources: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt' Traceback (most recent call last): File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/web/statserver.py", line 296, in index return render_template("jamstats_gameplots.html", File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 149, in render_template template = app.jinja_env.get_or_select_template(template_name_or_list) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1081, in get_or_select_template return self.get_template(template_name_or_list, parent, globals) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template return self._load_template(name, globals) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/loaders.py", line 125, in load source, filename, uptodate = self.get_source(environment, name) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 65, in get_source return self._get_source_fast(environment, template) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 99, in _get_source_fast raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: jamstats_gameplots.html

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 41, in get_jamstats_version return get_resource("jamstats_version.txt").strip() File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 71, in get_resource contents = path.read_bytes() if is_binary else path.read_text() File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "/usr/lib/python3.10/pathlib.py", line 1119, in open return self._accessor.open(self, mode, buffering, encoding, errors, FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt'

Failed to load version from resources: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt' Traceback (most recent call last): File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 41, in get_jamstats_version return get_resource("jamstats_version.txt").strip() File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 71, in get_resource contents = path.read_bytes() if is_binary else path.read_text() File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "/usr/lib/python3.10/pathlib.py", line 1119, in open return self._accessor.open(self, mode, buffering, encoding, errors, FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt'

Exception while rendering template: jamstats_gameplots.html EXC: Traceback (most recent call last): EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/web/statserver.py", line 296, in index EXC: return render_template("jamstats_gameplots.html", EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 149, in render_template EXC: template = app.jinja_env.get_or_select_template(template_name_or_list) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1081, in get_or_select_template EXC: return self.get_template(template_name_or_list, parent, globals) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template EXC: return self._load_template(name, globals) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template EXC: template = self.loader.load(self, name, self.make_globals(globals)) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/loaders.py", line 125, in load EXC: source, filename, uptodate = self.get_source(environment, name) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 65, in get_source EXC: return self._get_source_fast(environment, template) EXC: File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 99, in _get_source_fast EXC: raise TemplateNotFound(template) EXC: jinja2.exceptions.TemplateNotFound: jamstats_gameplots.html Failed to load version from resources: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt' Traceback (most recent call last): File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/web/statserver.py", line 296, in index return render_template("jamstats_gameplots.html", File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 149, in render_template template = app.jinja_env.get_or_select_template(template_name_or_list) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1081, in get_or_select_template return self.get_template(template_name_or_list, parent, globals) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template return self._load_template(name, globals) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jinja2/loaders.py", line 125, in load source, filename, uptodate = self.get_source(environment, name) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 65, in get_source return self._get_source_fast(environment, template) File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/flask/templating.py", line 99, in _get_source_fast raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: jamstats_gameplots.html

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 41, in get_jamstats_version return get_resource("jamstats_version.txt").strip() File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 71, in get_resource contents = path.read_bytes() if is_binary else path.read_text() File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "/usr/lib/python3.10/pathlib.py", line 1119, in open return self._accessor.open(self, mode, buffering, encoding, errors, FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt'

  1. the nogui script from jamstats doesn't work at all. Wether I state a file or just start the script, I always get this error message:

$jamstats-nogui

Traceback (most recent call last): File "/home/charlie/.local/bin/jamstats-nogui", line 11, in from jamstats.plots import plot_together, jamplots, skaterplots, plot_util ImportError: cannot import name 'jamplots' from 'jamstats.plots' (/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/plots/init.py)

I am supposed to use the jamstats command with options instead of "jamstats-nogui", right? When I do so, it also generates a pdf file that looks OK, but I get error messages like mentioned above.

Additional tests Running jamstats with --debug gives a little more output at the start, the later error messages seem to be similar with the ones I posted above:

$ jamstats --debug --scoreboardserver localhost:8000

jamstats version unknown, by Damon May Enabling debug logging. Connecting to server localhost, port 8000... Mode not specified. Inferred mode web Using theme white

Starting jamstats server... Point your browser to: http://localhost:8080

Starting SocketIO Flask app... Adding game state listener to scoreboard client UpdateWebclientGameStateListener init Flask app started Opened connection. 2024-03-05 21:40:26,515 | jamstats.io.scoreboard_server_io | INFO: Opened connection. Sent registration message 2024-03-05 21:40:26,516 | jamstats.io.scoreboard_server_io | DEBUG: Sent registration message Replacing game_json_dict with message_dict 2024-03-05 21:40:26,517 | jamstats.io.scoreboard_server_io | DEBUG: Replacing game_json_dict with message_dict Setting game state dirty because WS.Client.RemoteAddress. Updating listeners. 2024-03-05 21:40:26,517 | jamstats.io.scoreboard_server_io | DEBUG: Setting game state dirty because WS.Client.RemoteAddress. Updating listeners. UpdateWebclientGameStateListener.on_game_state_changed Emitting game_state_changed game state missing scoreboard version. In hand: None 2024-03-05 21:40:26,517 | jamstats.io.scoreboard_server_io | DEBUG: game state missing scoreboard version. In hand: None Setting game state dirty because ScoreBoard.CurrentGame.Team(1).Skater(a5fdb474-d799-41d9-8b73-e1d2499fbdb3).PenaltyBox. Updating listeners. 2024-03-05 21:40:26,590 | jamstats.io.scoreboard_server_io | DEBUG: Setting game state dirty because ScoreBoard.CurrentGame.Team(1).Skater(a5fdb474-d799-41d9-8b73-e1d2499fbdb3).PenaltyBox. Updating listeners. UpdateWebclientGameStateListener.on_game_state_changed Emitting game_state_changed Index page requested Scoreboard server is localhost Scoreboard client already exists. Checking for new game data... Game state is dirty. Rebuilding game. load_json_derby_game start. JSON major version string: v2023 Loading game data JSON major version string: v2023 Found CRG version 2023 Found version 5. Checking for in-progress game... Found in-progress game. Stripping rows with 'Scoreboard.Game('. Before: 1361 keys Getting game date and time. Getting team jammer names and numbers. Extracting roster extract_roster begin Looking for teams in roster: Team(1), Team(2) Roster rows by team: team 1 300 2 300 Name: count, dtype: int64 pdf_roster columns: Index(['Id', 'Name', 'Pronouns', 'RosterNumber'], dtype='object', name='roster_key'). Before dropping nulls, length: 40 After dropping nulls, length: 40 Loaded roster. Skater count by team: team Roller Derby Karlsruhe 20 Bear City Roller Derby 20 Name: count, dtype: int64 Roster columns: Index(['Id', 'Name', 'Pronouns', 'RosterNumber', 'team'], dtype='object', name='roster_key') Extracting jam data Found 276 Period rows. Found 243 Jam rows. Found 1 jams. Jam simple fields: 2 Previous 3 WalltimeEnd 4 Readonly 5 Duration 6 PeriodClockDisplayEnd 7 Overtime 8 Number 9 PeriodClockElapsedStart 10 PeriodNumber 11 InjuryContinuation 12 Next 13 StarPass 14 Id 15 WalltimeStart 16 PeriodClockElapsedEnd Name: keychunk_3, dtype: object Jams summary rows: 1 Jams summary rows (without 0:00): 0 Jams: 0 teamjam rows, team 1: 114 teamjam simple fields: 6 LastScore 7 StarPass 8 NoPivot 9 Lost 10 Previous 11 Calloff 12 StarPassTrip 13 AfterSPScore 14 TotalScore 15 Number 16 Lead 17 CurrentTripNumber 18 Injury 19 JamScore 20 Next 21 OsOffset 22 DisplayLead 23 OsOffsetReason 24 CurrentTrip 25 NoInitial 26 Id 27 Readonly Name: keychunk_4, dtype: object teamjams pivoted rows: 1 After adding jammer info: 1 After adding pivot info: 1 Index(['AfterSPScore', 'Calloff', 'CurrentTrip', 'CurrentTripNumber', 'DisplayLead', 'Id', 'Injury', 'JamScore', 'LastScore', 'Lead', 'Lost', 'Next', 'NoInitial', 'NoPivot', 'Number', 'OsOffset', 'OsOffsetReason', 'Previous', 'Readonly', 'StarPass', 'StarPassTrip', 'TotalScore', 'prd_jam', 'jammer_id', 'jammer_name', 'Pronouns', 'jammer_number', 'team', 'pivot_id', 'pivot_name', 'pivot_number'], dtype='object') extract_team_perjam_skaters begin Before roster merge, team jam skater data: 5 After roster merge, team jam skater data: 5 Jam skater lists length: 1 After adding skaters/jam: 1 Parsing scoring trips... Loaded 1 scoring trips. After adding scoring trips: 1 Index(['AfterSPScore', 'Calloff', 'CurrentTrip', 'CurrentTripNumber', 'DisplayLead', 'Id', 'Injury', 'JamScore', 'LastScore', 'Lead', 'Lost', 'Next', 'NoInitial', 'NoPivot', 'Number', 'OsOffset', 'OsOffsetReason', 'Previous', 'Readonly', 'StarPass', 'StarPassTrip', 'TotalScore', 'prd_jam', 'jammer_id', 'jammer_name', 'Pronouns', 'jammer_number', 'team', 'pivot_id', 'pivot_name', 'pivot_number', 'Skaters', 'n_scoring_trips', 'first_scoring_pass_durations'], dtype='object') teamjam rows, team 2: 114 teamjam simple fields: 6 NoInitial 7 StarPass 8 NoPivot 9 Next 10 Number 11 OsOffset 12 Previous 13 Calloff 14 CurrentTripNumber 15 AfterSPScore 16 OsOffsetReason 17 Lost 18 Lead 19 StarPassTrip 20 TotalScore 21 Id 22 CurrentTrip 23 DisplayLead 24 LastScore 25 Injury 26 JamScore 27 Readonly Name: keychunk_4, dtype: object teamjams pivoted rows: 1 After adding jammer info: 1 After adding pivot info: 1 Index(['AfterSPScore', 'Calloff', 'CurrentTrip', 'CurrentTripNumber', 'DisplayLead', 'Id', 'Injury', 'JamScore', 'LastScore', 'Lead', 'Lost', 'Next', 'NoInitial', 'NoPivot', 'Number', 'OsOffset', 'OsOffsetReason', 'Previous', 'Readonly', 'StarPass', 'StarPassTrip', 'TotalScore', 'prd_jam', 'jammer_id', 'jammer_name', 'Pronouns', 'jammer_number', 'team', 'pivot_id', 'pivot_name', 'pivot_number'], dtype='object') extract_team_perjam_skaters begin Before roster merge, team jam skater data: 5 After roster merge, team jam skater data: 5 Jam skater lists length: 1 After adding skaters/jam: 1 Parsing scoring trips... Loaded 1 scoring trips. After adding scoring trips: 1 Index(['AfterSPScore', 'Calloff', 'CurrentTrip', 'CurrentTripNumber', 'DisplayLead', 'Id', 'Injury', 'JamScore', 'LastScore', 'Lead', 'Lost', 'Next', 'NoInitial', 'NoPivot', 'Number', 'OsOffset', 'OsOffsetReason', 'Previous', 'Readonly', 'StarPass', 'StarPassTrip', 'TotalScore', 'prd_jam', 'jammer_id', 'jammer_name', 'Pronouns', 'jammer_number', 'team', 'pivot_id', 'pivot_name', 'pivot_number', 'Skaters', 'n_scoring_trips', 'first_scoring_pass_durations'], dtype='object') After merging teamjams: 0 Made jams summary dataframe. Rows: 0 Extracting penalties extract_penalties begin Rows with Penalty(: 0 Before merging with roster: 0 After merging with roster: 0 build_penalty_code_name_map begin, version==2023 Built penalty code dataframe: 15 codes Extracted penalties: 0 rows. Could not load team colors. Team colors will be missing from plots. DerbyGame init Extracting game summary dict extract_game_summary_dict 1 Periods: 0 Jams: 0 Game duration: 0 seconds Calculating scores Handling team colors Failed to find teams in color definitions. Using default colors. Updated game data from server. About to render class <class 'jamstats.tables.jamstats_tables.BothTeamsRosterTable'> Failed to load version from resources: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt' Traceback (most recent call last): File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 41, in get_jamstats_version return get_resource("jamstats_version.txt").strip() File "/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/util/resources.py", line 71, in get_resource contents = path.read_bytes() if is_binary else path.read_text() File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "/usr/lib/python3.10/pathlib.py", line 1119, in open return self._accessor.open(self, mode, buffering, encoding, errors, FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/.local/pipx/venvs/jamstats/lib/python3.10/site-packages/jamstats/resources/jamstats_version.txt'

[see above, similar error messages appear here...]

this might help to find the issues, but I don't know how yet: Now that the compiling worked (after some patience), the jamstats version which is generated from source looks different, e.g. it got a version.txt that actually contains a version number.

dhmay commented 7 months ago

To your question, yes, you should use the jamstats command, not jamstats-nogui.

It seems like you've got a single issue causing all those messages, which is that Python is attempting to locate resource files and failing. If it was just the version file, that would be fine (which is why the pdf generation works). But it also needs to locate HTML templates in the same way, which is why the webserver fails.

So, I'll start Googling and see if I can figure out why that might be. In the meantime:

dhmay commented 7 months ago

Oh, one more question, could you run:

find /home/charlie/.local/pipx/venvs/jamstats -name jamstats_gameplots.html

It's possible that the file exists but Python is looking in the wrong location.

dhmay commented 7 months ago

I threw a hail mary, with version 1.4.7 (just pushed to pypi). I added a line to setup.py that explicitly makes the HTML template and the version .txt files available.

So, please check out the things I asked about above, and then try installing 1.4.7 and see if that takes care of it. 1.4.7 shouldn't take long to install, since you've already got wxpython.

charlie-chaperon commented 7 months ago

I checked the installation and didn't found the files in question:

However, I didn't finish the installation from source. I could try to install from source to have a comparison. I will run

pipx install git+https://github.com/dhmay/jamstats.git

and let you know if that works (as an alternative way to install). I don't know why the resources and templates aren't generated during the normal install.

The next things I'll test:

  1. upgrading to 1.4.7
  2. installing from source
dhmay commented 7 months ago

That sounds good. It might be that the resources aren't getting copied because I didn't put a directive in setup.py to copy them, which is what I tried in 1.4.7.

charlie-chaperon commented 7 months ago

There is good news and bad news. The bad news is: both attempts failed (there is a version.txt now but no gameplot templates.

The good news is: I think I finally found the root cause of all the trouble. When I upgrade jamstats (or tried to install from source) I got this error message:

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/ ERROR: Could not find a version that satisfies the requirement pip>=23.1 (from versions: none) ERROR: No matching distribution found for pip>=23.1 Failed to upgrade shared libraries Traceback (most recent call last): File "/home/charlie/.local/lib/python3.10/site-packages/pipx/shared_libs.py", line 119, in upgrade subprocess_post_check(upgrade_process) File "/home/charlie/.local/lib/python3.10/site-packages/pipx/util.py", line 205, in subprocess_post_check raise PipxError(f"{' '.join([str(x) for x in completed_process.args])!r} failed") pipx.util.PipxError: '/home/charlie/.local/pipx/shared/bin/python -m pip --no-input --disable-pip-version-check install -q --upgrade pip >= 23.1' failed WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/ ERROR: Could not find a version that satisfies the requirement pip>=23.1 (from versions: none) ERROR: No matching distribution found for pip>=23.1 Failed to upgrade shared libraries Traceback (most recent call last): File "/home/charlie/.local/lib/python3.10/site-packages/pipx/shared_libs.py", line 119, in upgrade subprocess_post_check(upgrade_process) File "/home/charlie/.local/lib/python3.10/site-packages/pipx/util.py", line 205, in subprocess_post_check raise PipxError(f"{' '.join([str(x) for x in completed_process.args])!r} failed") pipx.util.PipxError: '/home/charlie/.local/pipx/shared/bin/python -m pip --no-input --disable-pip-version-check install -q --upgrade pip >= 23.1' failed upgraded package jamstats from 1.4.6 to 1.4.7 (location: /home/charlie/.local/pipx/venvs/jamstats)

So the problem seems to be pip expecting ssl transport which fails ==> fail to upgrade / download libraries and resources. The new version is installed though, but not the templates.

What I found is that python is probably lacking some modules (ssl, ...)

I have pip version 24.0 installed. I upgraded it from within the virtual environment. You use a different version, right? If you ask me, this is a problem of how Debian/Ubuntu handle the python3 installation. There seem to be different fixes around, but all of them require quite some tinkering.

Maybe I should try to install a fresh system...

dhmay commented 7 months ago

It seems likely there's some problem with package handling on this particular installation. I did try one more thing, though. Since you said it finally copied the jamstats_version.txt file but not the .html templates, I tweaked the way I specified those templates, in version 1.4.8. If all else fails you can give that a try!

charlie-chaperon commented 7 months ago

I just installed a fresh Ubuntu 22.04.1 LTS on one of my laptops. Python 3.10.12 pip version 22.0.2 (from system packages)

I had to install a few additional packages and pipx:

Consider this my third testing system. I can also test this on my working laptop next week and let you know.

Results Jamstats 1.4.7 via pipx install git+https://github.com/dhmay/jamstats.git as well as jamstats 1.4.8 (directly) still don't work with the webserver.

I didn't get the error messages about SSL, but the installation via pipx is rather quiet, so I wouldn't confirm yet that this issue is done. I could test the direct installation with pip later. The problem seems to be still the same: Jamstats doesn't find the templates and they don't seem to be be created during installation.

Questions and suggestions Can you confirm that there is a pip / pipx installation that actually works? What are the specifics? (OS, python version, etc...) If I knew (some of) the required circumstances, I might find a way. Right now, it looks like there is a bigger problem among all of my systems or problems related to pipx. At least the SSL module seemed to be a common issue in various installs that I read of.

What I will test next

dhmay commented 7 months ago

I just made a new 3.10.1 virtualenv and pip installed jamstats, and I got the same behavior you got: jamstats_version.txt is there, but the html template isn't. So, now I've got something I can try to fix and verify on my end!

dhmay commented 7 months ago

I'm getting closer (1.4.10). I added a MANIFEST.in file to copy my resources into the installation, and they're successfully getting copied. However, jamstats still isn't finding jamstats_gameplots.html at runtime... it must be looking in the wrong directory. I hope to figure that out soon.

dhmay commented 7 months ago

OK, @charlie-chaperon , I think I've got it. Since the last version you tried, I've:

Please try again (version 1.4.11). And thank you for bearing with me with all these attempts at a fix!

charlie-chaperon commented 7 months ago

Yes! I just tried version 1.4.11 and now it runs on both of my systems, both install ways (directly from git or via PyPA). I get a web-interface that shows the data in real time.

tested OS:

  1. Debian Linux 12 (Bookworm)
  2. Ubuntu 22.04.1 LTS

both run Python 3.10.12

I used pipx instead of pip to install the packages. It creates a separate virtual environment for the containing packages.

not (yet) tested

additional notes for Debian and derived linux distributions I suggest to add a few lines of explanation in the manual, considering Debian based Linux.

Debian and Ubuntu don't install the following packages by default which you will need to build jamstats:

Use

sudo apt install libgtk-3-dev python3-pip python3-venv

to install.

How to install and manage pipx: https://github.com/pypa/pipx to install jamstats:

pipx install jamstats

you can update by:

pipx upgrade jamstats

When the program is compiled, you might notice high CPU usage, especially when using older hardware! It took my 10 year old laptop around 40 minutes to finish. If you want to use it with older laptops, bring some patience.


And finally, thank you too for going through this! There were several issues combined in this one and I'm glad I could take part in making this accessible.

dhmay commented 7 months ago

Thanks, @charlie-chaperon ! I updated the README as you suggested.

I'm closing this bug, but I would love to hear how it goes as you start to use JamStats! Log any bugs or enhancement requests you want, of course, but also if you could drop me a line (either in this issue, tagging me, or as a testimonial, after you've used it for a bit, and just let me know what you're using it for and what's been most helpful, I'd appreciate it!