Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to have a clean python / ansible template not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
pascuol
n00b
n00b


Joined: 03 Dec 2006
Posts: 39

PostPosted: Fri Jan 14, 2022 3:59 pm    Post subject: How to have a clean python / ansible template not working Reply with quote

recently I broke my system :oops:

I manage to reemerge everything :D but since then I've weird issue, at the moment it's with ansible, template aren't working anymore 8O meaning variable in template file aren't replaced anymore.


I manage to resolved many of the issue I had by deleting some files in python :? and re-emerging python (e.g. certifi)


my question maybe is how can I be sure my python is nice and clean ? , because as exemple I had a thrown issue from ansible:
Code:
RuntimeError: 'certifi.dist-info' is not an alias to 'certifi_system_store.dist-info'. Please execute '/usr/bin/python3.9 -m certifi -v'.


Code:
# /usr/bin/python3.9 -m certifi -v
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.9/site-packages/certifi/__main__.py", line 14, in <module>
    _patched, _css_dist_info, _certifi_dist_info = _patch_dist_info()
  File "/usr/lib/python3.9/site-packages/certifi/_patch.py", line 31, in _patch_dist_info
    if os.path.samefile(css_dist.egg_info, certifi_dist.egg_info):
  File "/usr/lib/python3.9/genericpath.py", line 101, in samefile
    s2 = os.stat(f2)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType


even after re-emerge python :
Code:
 emerge python -ev ; emerge system -ev


then I deleted the files and folder /usr/lib/python3.9/site-packages/certifi* and then re-emerge python

no more errors thrown despite the fact no more certifi :lol:
Code:
# /usr/bin/python3.9 -m certifi -v
/usr/bin/python3.9: No module named certifi


It's like I have dirts everywhere for sure and it's making ansible not working properly, but how to clean the dirts ? :?:
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 2424

PostPosted: Fri Jan 14, 2022 6:56 pm    Post subject: Reply with quote

Maybe run
Code:

revdep-rebuild

your system still seems seriously defective.
What is the output of the above command?
I hope it will help you somehow.
Jist reemege
Code:

emerge -1va  certifi

and plz do not manually delete anything.
Ah and plz backup your system regularly.Maybe even daily.
_________________
:)
Back to top
View user's profile Send private message
pascuol
n00b
n00b


Joined: 03 Dec 2006
Posts: 39

PostPosted: Sat Jan 15, 2022 1:08 pm    Post subject: Reply with quote

Thanks for your reply


Code:
# revdep-rebuild
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.9/revdep-rebuild", line 32, in <module>
    from gentoolkit import errors
ModuleNotFoundError: No module named 'gentoolkit'
spectre / # emerge gentoolkit -v

 * IMPORTANT: 15 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-portage/gentoolkit-0.5.1-r1::gentoo  USE="-test" PYTHON_TARGETS="python3_9 (-pypy3) -python3_8 -python3_10" 3129 KiB

Total: 1 package (1 reinstall), Size of downloads: 3129 KiB



Code:
# revdep-rebuild
 * This is the new python coded version
 * Please report any bugs found using it.
 * The original revdep-rebuild script is installed as revdep-rebuild.sh
 * Please file bugs at: https://bugs.gentoo.org/
 * Collecting system binaries and libraries
 * Checking dynamic linking consistency

Your system is consistent



and I did emerge certifi back, and it's working ..
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum