mjordan / islandora_workbench

A command-line tool for managing content in an Islandora 2 repository
MIT License
26 stars 38 forks source link

Latest install fails with `error: attrs 21.2.0 is installed but attrs>=23.1.0 is required by {'cattrs'}` and config check too #753

Closed g7morris closed 4 months ago

g7morris commented 4 months ago

Hi @mjordan

Hope you are well. Just reporting the following that when I perform the install process on Ubuntu 22.04 LTS I get the following errors and issues.

output: (See last line for error)

running install
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
writing Islandora_Workbench.egg-info/PKG-INFO
writing dependency_links to Islandora_Workbench.egg-info/dependency_links.txt
writing requirements to Islandora_Workbench.egg-info/requires.txt
writing top-level names to Islandora_Workbench.egg-info/top_level.txt
reading manifest file 'Islandora_Workbench.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'Islandora_Workbench.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
warning: install_lib: 'build/lib' does not exist -- no Python modules to install

creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying Islandora_Workbench.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Islandora_Workbench.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Islandora_Workbench.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Islandora_Workbench.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Islandora_Workbench.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/Islandora_Workbench-0.1.dev0-py3.10.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing Islandora_Workbench-0.1.dev0-py3.10.egg
Removing /home/islandora/.local/lib/python3.10/site-packages/Islandora_Workbench-0.1.dev0-py3.10.egg
Copying Islandora_Workbench-0.1.dev0-py3.10.egg to /home/islandora/.local/lib/python3.10/site-packages
Islandora-Workbench 0.1.dev0 is already the active version in easy-install.pth

Installed /home/islandora/.local/lib/python3.10/site-packages/Islandora_Workbench-0.1.dev0-py3.10.egg
Processing dependencies for Islandora-Workbench==0.1.dev0
error: attrs 21.2.0 is installed but attrs>=23.1.0 is required by {'cattrs'}

Additionally I created a basic config.yml file as directed here

task: create
host: "https://placeholder.test.edu"
username: admin
password: placeholder

When I follow steps here and I run ./workbench --config config.yml --check

Traceback (most recent call last):
  File "/opt/islandora_workbench/./workbench", line 16, in <module>
    import requests_cache
  File "/home/islandora/.local/lib/python3.10/site-packages/requests_cache-1.2.0-py3.10.egg/requests_cache/__init__.py", line 7, in <module>
    from .backends import *
  File "/home/islandora/.local/lib/python3.10/site-packages/requests_cache-1.2.0-py3.10.egg/requests_cache/backends/__init__.py", line 8, in <module>
    from .base import BaseCache, BaseStorage, DictStorage
  File "/home/islandora/.local/lib/python3.10/site-packages/requests_cache-1.2.0-py3.10.egg/requests_cache/backends/base.py", line 28, in <module>
    from ..models import AnyRequest, CachedResponse
  File "/home/islandora/.local/lib/python3.10/site-packages/requests_cache-1.2.0-py3.10.egg/requests_cache/models/__init__.py", line 7, in <module>
    from .base import RichMixin
  File "/home/islandora/.local/lib/python3.10/site-packages/requests_cache-1.2.0-py3.10.egg/requests_cache/models/base.py", line 4, in <module>
    from attrs import Factory
ModuleNotFoundError: No module named 'attrs'

What do you recommend doing here?

Thank you kindly in advance. 😄

mjordan commented 4 months ago

Hi @g7morris is this Python 3.12?

g7morris commented 4 months ago

oops that would help. Sorry should have posted that Python 3.10.12 out of the box on a fresh Ubuntu 22.04 LTS install.

mjordan commented 4 months ago

OK, thanks. I'm afraid that searching Google, Luxxle, and DDG for python "is required by {'cattrs'}" all produce the dreaded 0 hits found response. cattrs is a real Python library but not finding any instances of that error is a bit disquieting. At any rate, I'll investigate.

mjordan commented 4 months ago

Coincidentally I also had a clean 22.04 box at hand and tried to update attrs like this:

sudo pip install attrs --user --force-reinstall -v "attrs>=23.1.0"

which appeared to be successful. Yet running python3 setup.py install --user to reinstall workbench continues to fail with error: attrs 21.2.0 is installed but attrs>=23.1.0 is required by {'cattrs'}.

I'll look into this more ~this evening~ over lunch.

mjordan commented 4 months ago

@g7morris try pip install attrs --user --no-cache-dir -I --force-reinstall -v "attrs>=23.1.0" (no sudo)

I was able to then run python3 setup.py install --user without error.

g7morris commented 4 months ago

Indeedy do @mjordan! That did the trick. Thank you very much! :)