0

I am using a module called range-regex. It was pip installed. The functions inside this module use underscores, not hyphens.

In my code, I import it as follows:

from range_regex import bounded_regex_for_range

and pylint thinks that's just fine. I used it locally in a test without issue.

However, when I try to push to heroku:

from range_regex import bounded_regex_for_range 
remote: ImportError: No module named 'range_regex' 

I tried

import range-regex as range_regex

and pylint screamed bloody murder.

Is there a good workaround for this?

I saw the solution printed here pip: need to change name of package tensorflow-gpu to tensorflow but that won't work for me. This question How to install python package with a different name using PIP is closer to my situation, but there is no accepted answer and the only answer given is disputed. Push come to shove, I can fork it and fix it myself, since the maintainers haven't posted anything since 2014, including not responding to a pull request for a patch I submitted 5 months ago on a different issue.

Malik A. Rumi
  • 1,609
  • 4
  • 20
  • 32
  • You have to verify that the module `range_regex` is really installed in `site-packages`. Also add more details to your question — Python version, `pip install` command that you've tried… – phd Sep 11 '17 at 20:01
  • Have you install the `range_regex` in the heroku? – aircraft Sep 12 '17 at 03:51
  • @aircraft No, I was expecting that to happen through pip on Heroku like it did for all my other dependencies. – Malik A. Rumi Sep 12 '17 at 19:37
  • @phd Python 3.5.2, pip 9.0.1. Yes, it is in site-packages as range_regex, just as it is in pip freeze. But what it wasn't in was installed apps! – Malik A. Rumi Sep 12 '17 at 20:41

0 Answers0