~lioploum/offpunk-devel

6 3

ModuleNotFounderror on launch: cert_migration

Details
Message ID
<kdw7wqfg36gbzn3ctkbieuhkb3psratpm6gcvlpih4rf2kbsod@zvg5saukv66m>
DKIM signature
pass
Download raw message
Hey,

I don't know if it's specific to arch, but I tried launching the latest
offpunk version fetched from the main git branch. And was greeted by the
following error :


Traceback (most recent call last):
  File "/usr/bin/offpunk", line 5, in <module>
    from offpunk import main
  File "/usr/lib/python3.12/site-packages/offpunk.py", line 25, in <module>
    import netcache
  File "/usr/lib/python3.12/site-packages/netcache.py", line 14, in <module>
    import ansicat
  File "/usr/lib/python3.12/site-packages/ansicat.py", line 15, in <module>
    from offutils import run,term_width,is_local,looks_like_base64, looks_like_url
  File "/usr/lib/python3.12/site-packages/offutils.py", line 18, in <module>
    import cert_migration
ModuleNotFoundError: No module named 'cert_migration'

I don't know if it's related to Bert's recent work or not, but maybe
it's missing something in `requirements.txt` ?

I tried both the 'packaged' version in Arch User Repository and cloning
the project from sourcehut with the same result. Using `pip install -4
requirements.txt` does install some stuff, but the ModuleNotFoundError
still appears.

Cheers,

--
hubert
Details
Message ID
<171757532996.6.12970121112177260731.347484848@ploum.eu>
In-Reply-To
<kdw7wqfg36gbzn3ctkbieuhkb3psratpm6gcvlpih4rf2kbsod@zvg5saukv66m> (view parent)
DKIM signature
pass
Download raw message
On 24 jun 05 09:23, ray.hubert wrote:
>Hey,
>
>I don't know if it's specific to arch, but I tried launching the latest
>offpunk version fetched from the main git branch. And was greeted by the
>following error :
>
>
>Traceback (most recent call last):
>  File "/usr/bin/offpunk", line 5, in <module>
>    from offpunk import main
>  File "/usr/lib/python3.12/site-packages/offpunk.py", line 25, in <module>
>    import netcache
>  File "/usr/lib/python3.12/site-packages/netcache.py", line 14, in <module>
>    import ansicat
>  File "/usr/lib/python3.12/site-packages/ansicat.py", line 15, in <module>
>    from offutils import run,term_width,is_local,looks_like_base64, looks_like_url
>  File "/usr/lib/python3.12/site-packages/offutils.py", line 18, in <module>
>    import cert_migration
>ModuleNotFoundError: No module named 'cert_migration'
>
>I don't know if it's related to Bert's recent work or not, but maybe
>it's missing something in `requirements.txt` ?

Hey Hubert,

Thanks for the report. Bert forgot to add cert_migration to the 
pyproject.toml.  I pushed a fix.

Could you try the trunk and tell us if it solves it for you?



>
>I tried both the 'packaged' version in Arch User Repository and cloning
>the project from sourcehut with the same result. Using `pip install -4
>requirements.txt` does install some stuff, but the ModuleNotFoundError
>still appears.
>
>Cheers,
>
>--
>hubert



-- 
Ploum - Lionel Dricot
Blog: https://www.ploum.net
Livres: https://ploum.net/livres.html
Details
Message ID
<m5itndurthefluacd6tx3ni2c4szzvhceadgrezharkdhviec6@pf3ccrgqej7p>
In-Reply-To
<171757532996.6.12970121112177260731.347484848@ploum.eu> (view parent)
DKIM signature
pass
Download raw message
On 24/06/05 08:15AM, Ploum wrote:
> Hey Hubert,
> 
> Thanks for the report. Bert forgot to add cert_migration to the 
> pyproject.toml.  I pushed a fix.
> 
> Could you try the trunk and tell us if it solves it for you?


I tried from the latest (f4371f4) commit using the following commands:

$ source path/to/venv/bin/activate.fish
$ pip install -r requirements.txt
$ offpunk

pip reported no additionnal modules to install. I now have the following
error concerning lxml :

Traceback (most recent call last):
  File "/usr/bin/offpunk", line 5, in <module>
    from offpunk import main
  File "/usr/lib/python3.12/site-packages/offpunk.py", line 25, in <module>
    import netcache
  File "/usr/lib/python3.12/site-packages/netcache.py", line 14, in <module>
    import ansicat
  File "/usr/lib/python3.12/site-packages/ansicat.py", line 19, in <module>
    from readability import Document
  File "/usr/lib/python3.12/site-packages/readability/__init__.py", line 3, in <module>
    from .readability import Document
  File "/usr/lib/python3.12/site-packages/readability/readability.py", line 11, in <module>
    from .cleaners import clean_attributes
  File "/usr/lib/python3.12/site-packages/readability/cleaners.py", line 3, in <module>
    from lxml.html.clean import Cleaner
  File "/usr/lib/python3.12/site-packages/lxml/html/clean.py", line 18, in <module>
    raise ImportError(
ImportError: lxml.html.clean module is now a separate project lxml_html_clean.
Install lxml[html_clean] or lxml_html_clean directly.

Please let me know if I did something wrong !
Details
Message ID
<171757982559.13.14475293527346642271.347524579@ploum.eu>
In-Reply-To
<m5itndurthefluacd6tx3ni2c4szzvhceadgrezharkdhviec6@pf3ccrgqej7p> (view parent)
DKIM signature
pass
Download raw message
On 24 jun 05 10:27, ray.hubert wrote:
>On 24/06/05 08:15AM, Ploum wrote:
>I tried from the latest (f4371f4) commit using the following commands:
>
>$ source path/to/venv/bin/activate.fish
>$ pip install -r requirements.txt
>$ offpunk
>
>pip reported no additionnal modules to install. I now have the following
>error concerning lxml :
>
>Traceback (most recent call last):
>  File "/usr/bin/offpunk", line 5, in <module>
>    from offpunk import main
>  File "/usr/lib/python3.12/site-packages/offpunk.py", line 25, in <module>
>    import netcache
>  File "/usr/lib/python3.12/site-packages/netcache.py", line 14, in <module>
>    import ansicat
>  File "/usr/lib/python3.12/site-packages/ansicat.py", line 19, in <module>
>    from readability import Document
>  File "/usr/lib/python3.12/site-packages/readability/__init__.py", line 3, in <module>
>    from .readability import Document
>  File "/usr/lib/python3.12/site-packages/readability/readability.py", line 11, in <module>
>    from .cleaners import clean_attributes
>  File "/usr/lib/python3.12/site-packages/readability/cleaners.py", line 3, in <module>
>    from lxml.html.clean import Cleaner
>  File "/usr/lib/python3.12/site-packages/lxml/html/clean.py", line 18, in <module>
>    raise ImportError(
>ImportError: lxml.html.clean module is now a separate project lxml_html_clean.
>Install lxml[html_clean] or lxml_html_clean directly.
>
>Please let me know if I did something wrong !

You did fine and solved the first bug.

This is another bug: python-readability package has been broken in two 
packages and dependency has not always been kept between the two. This 
is also a problem under Ubuntu (it has been solved in Debian).

I’ve juste added lxml-html-clean to the requirements. I hope this does 
the trick.

Thanks for testing!


-- 
Ploum - Lionel Dricot
Blog: https://www.ploum.net
Livres: https://ploum.net/livres.html
Details
Message ID
<2wibczhyronusyvp7225g7lvuvkl3me42fkxixsrgb4kz3iqd5@eue7sxb6zgkv>
In-Reply-To
<171757982559.13.14475293527346642271.347524579@ploum.eu> (view parent)
DKIM signature
pass
Download raw message
On 24/06/05 09:30AM, Ploum wrote:
> You did fine and solved the first bug.
> 
> This is another bug: python-readability package has been broken in two 
> packages and dependency has not always been kept between the two. This 
> is also a problem under Ubuntu (it has been solved in Debian).
> 
> I’ve juste added lxml-html-clean to the requirements. I hope this does 
> the trick.
> 

Tested again from commit `469311b`, works like a charm after adding
`lxml-html-clean`. I also notified the packager (kseistrup) for the AUR
version so they can add it as a dependency.


> Thanks for testing!

Thanks for developping it !
Details
Message ID
<lf4ellg63lqvitoib3epdmcncgnkmxuseidkbn45jm3kdeults@ayun5rasn6nt>
In-Reply-To
<2wibczhyronusyvp7225g7lvuvkl3me42fkxixsrgb4kz3iqd5@eue7sxb6zgkv> (view parent)
DKIM signature
pass
Download raw message
ray.hubert wrote:

> works like a charm after adding `lxml-html-clean`. I also notified
> the packager (kseistrup) for the AUR version so they can add it as
> a dependency.

Yes, thank you so much for the notification.

In addition to adding `lxml-html-clean` I have made all importable python modules hard dependencies, and kept external programs like the clipboard stuff as optional dependencies, because even though offpunk is very liberal in its demands, the burden of sorting out inter-dependencies was placed on the shoulders of each individual user. This should now be a thing of the past.

If I may side-track the thread for a minute:

The pyperclip Python modules handles all the clipboard methods offpunk does, and then some (Qt and KDE clipboards), so if offpunk were using pyperclip we could drop the [optional] dependencies of xclip, xsel and wl-clipboard, and using it is as simple as `pyperclip.copy(f"{TEXT}")`.

 · https://github.com/asweigart/pyperclip
 · https://archlinux.org/packages/extra/any/python-pyperclip/

Cheers,

-- 
Kʟᴀᴜꜱ Aʟᴇxᴀɴᴅᴇʀ Sᴇɪꜱᴛʀᴜᴘ
https://kas.bio.link/ 🇩🇰
Details
Message ID
<171766607499.7.12478733377730295496.348417031@ploum.eu>
In-Reply-To
<lf4ellg63lqvitoib3epdmcncgnkmxuseidkbn45jm3kdeults@ayun5rasn6nt> (view parent)
DKIM signature
pass
Download raw message
On 24 jun 06 11:10, Klaus Alexander Seistrup wrote:
>ray.hubert wrote:
>
>> works like a charm after adding `lxml-html-clean`. I also notified
>> the packager (kseistrup) for the AUR version so they can add it as
>> a dependency.
>
>Yes, thank you so much for the notification.
>
>In addition to adding `lxml-html-clean` I have made all importable python modules hard dependencies, and kept external programs like the clipboard stuff as optional dependencies, because even though offpunk is very liberal in its demands, the burden of sorting out inter-dependencies was placed on the shoulders of each individual user. This should now be a thing of the past.

You are right that in trying to be as liberal as possible, we place the 
burden of dependencies on the user (while I’m myself guilty of doing 
only really lightweight testing without most dependencies).

At some point, it worths considering whether we want a dependency or not 
and make the choice.

What I personnaly like with the current approach is that the hard 
choices could be done by packagers. And it makes sense because a 
packager knows if a given dependency is widely available in his/her own 
distribution.

>
>If I may side-track the thread for a minute:
>
>The pyperclip Python modules handles all the clipboard methods offpunk does, and then some (Qt and KDE clipboards), so if offpunk were using pyperclip we could drop the [optional] dependencies of xclip, xsel and wl-clipboard, and using it is as simple as `pyperclip.copy(f"{TEXT}")`.
>
> · https://github.com/asweigart/pyperclip
> · https://archlinux.org/packages/extra/any/python-pyperclip/

That’s interesting. Thanks for sharingg it.

I’m really reluctant to add python libraries as dependencies as those 
tend to move a lot, to not always be packaged, etc. They may also 
themselves depends of others libraries (now or in further updates). 

I do really like the approach of using binary tools if they are found.

 From what I see, pyperclip is doing exactly what we are doing: using 
xclip, xsel or wl-clipboard. (I’m still wondering what is different 
between xsel and xclip!)

There’s also the question: is it broken for any user right now?

Will definitely keep an eye on this, the discussion is open.

Thanks!



>
>Cheers,
>
>--
>Kʟᴀᴜꜱ Aʟᴇxᴀɴᴅᴇʀ Sᴇɪꜱᴛʀᴜᴘ
>https://kas.bio.link/ 🇩🇰
>

-- 
Ploum - Lionel Dricot
Blog: https://www.ploum.net
Livres: https://ploum.net/livres.html
Reply to thread Export thread (mbox)