hashids-python icon indicating copy to clipboard operation
hashids-python copied to clipboard

ImportError: No module named hashids

Open greenstudiocorp opened this issue 7 years ago • 7 comments

hashids-python is not compatible with macOS (10.13.6). Please let me know how to fix it!

greenstudiocorp avatar Sep 20 '18 13:09 greenstudiocorp

What do you mean? In the sense that it's not on pypi? Does the pip install work correctly?

tstirrat15 avatar Dec 04 '18 02:12 tstirrat15

Same goes with me I can't import Hashids. pip was able to install the module correctly.

dalelicious avatar Feb 28 '19 13:02 dalelicious

Sorry for not answering earlier.

Is this still an issue @greenstudiocorp, @dalelicious?

If yes, please provide a repro – how are you installing hashids, and which python version are you using?

Thank you!

davidaurelio avatar Jul 14 '20 20:07 davidaurelio

Any updates?

GioPan04 avatar Jul 28 '20 11:07 GioPan04

Sorry for not answering earlier.

Is this still an issue @greenstudiocorp, @dalelicious?

If yes, please provide a repro – how are you installing hashids, and which python version are you using?

Thank you!

I'm using Python 3.7 on macOS Catalina. And installed hashids via pip install hashids (pip is installing in the python 3 modules dir btw)

GioPan04 avatar Jul 28 '20 11:07 GioPan04

This smells like a Mac OS issue rather than anything to do with Hashids. Assuming you're not using a virtualenv, then there are some funky things with Mac python packaging (at least, on my machine).

If you run pip --version what does it tell you? On my Mac, it says:

pip 9.0.2 from /Library/Python/2.7/site-packages/pip-9.0.2-py2.7.egg (python 2.7)

...which means that pip install ... (of anything) will end up "in" python2, not python3. In order to install into python3, I have to run pip3 install .... Indeed, I can verify if a library is installed in python2 or 3 with pip3 list and pip list.

This all gets much simpler inside a virtualenv - and saves having to make system-wide changes for crazy stuff like this. If you're not using one, you may want to try it, but it's not mandatory. If you are inside a virtualenv, then give us the output of a session like this:

pip --version
pip install Hashids
pip list

You could try the same with a different pip library (any that you want, maybe one you haven't used before - eg. awsume) and give us the same output for that.

coofercat avatar Sep 11 '20 11:09 coofercat

Hey There!

Got the same issue. In my case issue was linked to the python file name that was exactly hashids.py. I used this file to test/play with Hashids package. Python was confused by this. Just renamed it to hashids-test.py to get it working.

Thanks to @barys-matsiushyn !

Igor-Kuzenkov avatar Mar 30 '23 13:03 Igor-Kuzenkov