Gaarv / kadenze-dl

Small application to download Kadenze (https://www.kadenze.com) videos for courses you enrolled in
MIT License
50 stars 16 forks source link

Problem installing requirements #27

Closed mkohlhaas closed 2 years ago

mkohlhaas commented 2 years ago

When installing requirements I get following error regarding greenlet:

Defaulting to user installation because normal site-packages is not writeable
Processing /home/schmidh/Gitrepos/kadenze-dl
  Preparing metadata (setup.py) ... done
Requirement already satisfied: PyYAML==5.4.1 in /home/schmidh/.local/lib/python3.10/site-packages (from kadenze-dl==1.0) (5.4.1)
Collecting requests==2.25.1
  Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
Requirement already satisfied: python-slugify==4.0.1 in /home/schmidh/.local/lib/python3.10/site-packages (from kadenze-dl==1.0) (4.0.1)
Collecting playwright==1.9.1
  Using cached playwright-1.9.1-py3-none-manylinux1_x86_64.whl (58.6 MB)
Collecting greenlet==1.0.0
  Using cached greenlet-1.0.0.tar.gz (84 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: typing-extensions in /usr/lib/python3.10/site-packages (from playwright==1.9.1->kadenze-dl==1.0) (4.2.0)
Requirement already satisfied: pyee>=8.0.1 in /home/schmidh/.local/lib/python3.10/site-packages (from playwright==1.9.1->kadenze-dl==1.0) (9.0.4)
Requirement already satisfied: text-unidecode>=1.3 in /home/schmidh/.local/lib/python3.10/site-packages (from python-slugify==4.0.1->kadenze-dl==1.0) (1.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.10/site-packages (from requests==2.25.1->kadenze-dl==1.0) (1.26.7)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/lib/python3.10/site-packages (from requests==2.25.1->kadenze-dl==1.0) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in /home/schmidh/.local/lib/python3.10/site-packages (from requests==2.25.1->kadenze-dl==1.0) (2.10)
Collecting certifi>=2017.4.17
  Using cached certifi-2022.5.18.1-py3-none-any.whl (155 kB)
Using legacy 'setup.py install' for kadenze-dl, since package 'wheel' is not installed.
Using legacy 'setup.py install' for greenlet, since package 'wheel' is not installed.
Installing collected packages: greenlet, certifi, requests, playwright, kadenze-dl
  Attempting uninstall: greenlet
    Found existing installation: greenlet 1.1.2
    Uninstalling greenlet-1.1.2:
      Successfully uninstalled greenlet-1.1.2
  Running setup.py install for greenlet ... error
  error: subprocess-exited-with-error

  × Running setup.py install for greenlet did not run successfully.
  │ exit code: 1
  ╰─> [87 lines of output]
      running install
      /usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/greenlet
      copying src/greenlet/__init__.py -> build/lib.linux-x86_64-3.10/greenlet
      creating build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_weakref.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_version.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_tracing.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_throw.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_stack_saved.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_leaks.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_greenlet.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_generator_nested.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_generator.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_gc.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_extension_interface.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_cpp.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/test_contextvars.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/__init__.py -> build/lib.linux-x86_64-3.10/greenlet/tests
      running egg_info
      writing src/greenlet.egg-info/PKG-INFO
      writing dependency_links to src/greenlet.egg-info/dependency_links.txt
      writing requirements to src/greenlet.egg-info/requires.txt
      writing top-level names to src/greenlet.egg-info/top_level.txt
      reading manifest file 'src/greenlet.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      no previously-included directories found matching 'docs/_build'
      warning: no files found matching '*.py' under directory 'appveyor'
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files matching '*.pyd' found anywhere in distribution
      warning: no previously-included files matching '*.so' found anywhere in distribution
      warning: no previously-included files matching '.coverage' found anywhere in distribution
      adding license file 'LICENSE'
      adding license file 'LICENSE.PSF'
      adding license file 'AUTHORS'
      writing manifest file 'src/greenlet.egg-info/SOURCES.txt'
      copying src/greenlet/greenlet.c -> build/lib.linux-x86_64-3.10/greenlet
      copying src/greenlet/greenlet.h -> build/lib.linux-x86_64-3.10/greenlet
      copying src/greenlet/slp_platformselect.h -> build/lib.linux-x86_64-3.10/greenlet
      creating build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/setup_switch_x64_masm.cmd -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_aarch64_gcc.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_alpha_unix.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_amd64_unix.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_arm32_gcc.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_arm32_ios.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_csky_gcc.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_m68k_gcc.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_mips_unix.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_ppc64_aix.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_ppc64_linux.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_ppc_aix.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_ppc_linux.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_ppc_macosx.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_ppc_unix.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_riscv_unix.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_s390_unix.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_sparc_sun_gcc.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_x32_unix.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_x64_masm.asm -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_x64_masm.obj -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_x64_msvc.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_x86_msvc.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/platform/switch_x86_unix.h -> build/lib.linux-x86_64-3.10/greenlet/platform
      copying src/greenlet/tests/_test_extension.c -> build/lib.linux-x86_64-3.10/greenlet/tests
      copying src/greenlet/tests/_test_extension_cpp.cpp -> build/lib.linux-x86_64-3.10/greenlet/tests
      running build_ext
      building 'greenlet._greenlet' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/src
      creating build/temp.linux-x86_64-3.10/src/greenlet
      x86_64-unknown-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe -g -fdebug-prefix-map=/builddir/Python-3.10.4=. -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe -g -fdebug-prefix-map=/builddir/Python-3.10.4=. -fPIC -I/usr/include/python3.10 -c src/greenlet/greenlet.c -o build/temp.linux-x86_64-3.10/src/greenlet/greenlet.o
      src/greenlet/greenlet.c: In function 'g_calltrace':
      src/greenlet/greenlet.c:570:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'use_tracing'; did you mean 'tracing'?
        570 |     tstate->use_tracing = 0;
            |             ^~~~~~~~~~~
            |             tracing
      src/greenlet/greenlet.c:573:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'use_tracing'; did you mean 'tracing'?
        573 |     tstate->use_tracing =
            |             ^~~~~~~~~~~
            |             tracing
      error: command '/usr/bin/x86_64-unknown-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  WARNING: No metadata found in /home/schmidh/.local/lib/python3.10/site-packages
  Rolling back uninstall of greenlet
  Moving to /home/schmidh/.local/include/python3.10/greenlet/
   from /home/schmidh/.local/include/python3.10/~reenlet
  Moving to /home/schmidh/.local/lib/python3.10/site-packages/greenlet-1.1.2.dist-info/
   from /home/schmidh/.local/lib/python3.10/site-packages/~reenlet-1.1.2.dist-info
  Moving to /home/schmidh/.local/lib/python3.10/site-packages/greenlet/
   from /home/schmidh/.local/lib/python3.10/site-packages/~reenlet
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> greenlet

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

Thanks.

Gaarv commented 2 years ago

I noticed that also, it's somewhat caused by Greenlet when using Python 3.10. I think I managed to install it with conda using conda install -c conda-forge greenlet but I need to restest this.

Because I'm working on another issue, I'm sticking to 3.8 for now but I will look into it.

Also, I'm thinking about making a Docker and binary version for the app rather than having to bother with a virtual env, which doesn't totally avoid those issues.

Gaarv commented 2 years ago

Upgrading requirements to playwright==1.22.0 fix the issue, since this more recent version depends on greenlet-1.1.2 which works fine on Python 3.10. I'm testing this and will update code & reqs as needed.

mkohlhaas commented 2 years ago

Thanks a lot Gaarv! I am just using Anaconda as a workaround and it works like a charm!

Gaarv commented 2 years ago

I updated the dependencies and it seems that everything is back in order with latest playwright.

Thanks for reporting the issue :)

Definitely putting a Docker + binary on the todo list.