Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named hashids #27

Open
greenstudiocorp opened this issue Sep 20, 2018 · 7 comments
Open

ImportError: No module named hashids #27

greenstudiocorp opened this issue Sep 20, 2018 · 7 comments

Comments

@greenstudiocorp
Copy link

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

@tstirrat15
Copy link

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

@dalelicious
Copy link

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

@davidaurelio
Copy link
Owner

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!

@GioPan04
Copy link

Any updates?

@GioPan04
Copy link

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)

@coofercat
Copy link

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.

@Igor-Kuzenkov
Copy link

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants