pyahocorasick icon indicating copy to clipboard operation
pyahocorasick copied to clipboard

Rename module to avoid name clash [was: macos 10.14 C library not found]

Open egberts opened this issue 5 years ago • 8 comments

On macos 10.14 (High Sierra), performed basic install:

    brew install python           # Python3.7
    pip install pyahocorasick

And executing:

$ python3.7
Python 3.7.2 (default, Feb 12 2019, 08:15:36) 
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyahocorasick
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyahocorasick'
>>> 

Resulted in

    ModuleNotFoundError: No module named 'pyahocorasick'

Something about the FORCED_RPATH not being done in 'gcc option'

Noticed that pyahocorasick-installed C library in /usr/local/lib/python3.7/site-packages/pyahocorasick-1.4.0-py3.7-macosx-10.14-x86_64.egg/ahocorasick.cpython-37m-darwin.so, but no symbolic link in corresponding /usr/local/lib.

egberts avatar Mar 20 '19 20:03 egberts

Also it should be import ahocorasick (omit the py).

Dobatymo avatar Mar 21 '19 01:03 Dobatymo

@egberts has Dobatymo's comment helped you?

WojciechMula avatar Mar 22 '19 17:03 WojciechMula

PyCharm (JetBrain) Integrated Development Environment (IDE) is complaining that the Python package name 'pyahocorasick' does not match the module name 'ahocorasick'.

egberts avatar Mar 22 '19 22:03 egberts

Furthermore, there is a module name conflict with another Ahocorasick that has already been registered with PyPi.

If I read this correctly the PEP8 and PEP423, the 'import ahocorasick' would need to be changed to 'import pyahocorasick'.

https://pypi.org/project/ahocorasick/

egberts avatar Mar 22 '19 23:03 egberts

Fixed in PyCharm 2019.1

https://youtrack.jetbrains.com/issue/PY-32135

egberts avatar Mar 23 '19 00:03 egberts

If I read this correctly the PEP8 and PEP423, the 'import ahocorasick' would need to be changed to 'import pyahocorasick'.

@egberts Thanks, I haven't read the PEPs, but anyway the naming mismatch is counter-intuitive and should be sorted out. Since this fix breaks backward compatibility, I'll change the name in the 2.0.0 line.

WojciechMula avatar Mar 25 '19 09:03 WojciechMula

Close this issue and make another one to change the module name? Or leave this issue open?

egberts avatar Jun 07 '19 22:06 egberts

@egberts its is fine to keep this issue.

pombredanne avatar Feb 20 '22 11:02 pombredanne