On Wed, Feb 7, 2024 at 2:11 AM Frederic Muller <fred@cm17.com> wrote:
Hi!

Installed scrapy and just trying to start the tutorial gives me that:

scrapy startproject tutorial
[...]
/home/fred/.local/lib/python3.12/site-packages/parsel/csstranslator.py",
line 8, in <module>
     from cssselect.parser import Element, FunctionalPseudoElement,
PseudoElement
ImportError: cannot import name 'PseudoElement' from 'cssselect.parser'
(/usr/lib/python3.12/site-packages/cssselect/parser.py)
Traceback (most recent call last):
 
Any idea why it's not working?

Looks like https://stackoverflow.com/questions/77476433/importerror-cannot-import-name-pseudoelement-from-cssselect-parser
Fedora 39 has: python-cssselect-1.1.0-6  Have a look at the https://github.com/scrapy/scrapy/issues

You should give enough details so others can reproduce the issue: how did you install scrapy, which version of Fedora, scrapy, and python-cssselect do you have?

There are problems with the Fedora package:

Available Packages
Name         : python3-scrapy
Version      : 2.10.1
Release      : 1.fc39
Architecture : noarch
Size         : 659 k
Source       : python-scrapy-2.10.1-1.fc39.src.rpm
Repository   : fedora
Summary      : A high-level Python Screen Scraping framework
URL          : https://scrapy.org
License      : BSD
Description  : Scrapy is a fast high-level screen scraping and web crawling
             : framework, used to crawl websites and extract structured data
             : from their pages. It can be used for a wide range of purposes,
             : from data mining to monitoring and automated testing.

Here, on Fedora 39:

% doas dnf install python3-scrapy
doas (gnw3@imacf39) password:
Last metadata expiration check: 0:04:29 ago on Wed Feb  7 10:39:54 2024.
Error:
 Problem: conflicting requests
  - nothing provides (python3.12dist(twisted) < 23.8~~ with python3.12dist(twisted) >= 18.9) needed by python3-scrapy-2.10.1-1.fc39.noarch from fedora
(try to add '--skip-broken' to skip uninstallable packages)

twisted has https://nvd.nist.gov/vuln/detail/CVE-2023-46137 so

Many large Python systems have not been ported to python-3.12.  I've had success using
fedora's python-3.11 in a conda environment.  Anaconda python is also a way to run stuff that
still needs python 3.10 or 3.11.

--
George N. White III