iustin / pyxattr

A python module for accessing filesystem Extended Attributes
https://pyxattr.k1024.org/
GNU Lesser General Public License v2.1
30 stars 15 forks source link

library name collision: xattr and pyxattr = `import xattr`? #49

Open pjotrek-b opened 2 months ago

pjotrek-b commented 2 months ago

xattr and pyxattr both import as xattr... :confused:

I'm using pyxattr as module in my code, but in order to do so, I need to pip uninstall xattr first - which then breaks the xattr command (OS: Xubuntu 20.04) :cry:

Is there a way to have both pip packages installed, but import them differently? I was honestly surprised that I install "pyxattr" and then not just simply import "pyxattr" :wink:

Grateful for any advice!

(Here's a copy of the error message the broken xattr throws after making place for pyxattr, in case someone searches for it:)

Traceback (most recent call last): File "/usr/bin/xattr", line 11, in load_entry_point('xattr==0.9.6', 'console_scripts', 'xattr')() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load return self.resolve() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve module = import(self.module_name, fromlist=['name'], level=0) ModuleNotFoundError: No module named 'xattr.tool'; 'xattr' is not a package