Coder Social home page Coder Social logo

danstiner / heroku-buildpack-geoip-geolite2 Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 28.0 13 KB

unofficial Heroku buildpack for GeoLite2 free IP geolocation databases from MaxMind

Home Page: https://elements.heroku.com/buildpacks/danstiner/heroku-buildpack-geoip-geolite2

License: MIT License

Shell 100.00%

heroku-buildpack-geoip-geolite2's People

Contributors

danstiner avatar hugorodgerbrown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

heroku-buildpack-geoip-geolite2's Issues

geoIP2 unable to find the c extension

Just tried to use this on heroku with geoIP2 on a clean project. The end of the compilation shows that all 18 tests pass:

remote: All 18 tests passed
remote: ===================
remote: Making install in src
remote:  /bin/mkdir -p '/app/tmp/cache/geoip/libmaxminddb/dist/lib'
remote:  /bin/bash ../libtool   --mode=install /usr/bin/install -c   libmaxminddb.la '/app/tmp/cache/geoip/libmaxminddb/dist/lib'
remote: libtool: install: /usr/bin/install -c .libs/libmaxminddb.so.0.0.7 /app/tmp/cache/geoip/libmaxminddb/dist/lib/libmaxminddb.so.0.0.7
remote: libtool: install: (cd /app/tmp/cache/geoip/libmaxminddb/dist/lib && { ln -s -f libmaxminddb.so.0.0.7 libmaxminddb.so.0 || { rm -f libmaxminddb.so.0 && ln -s libmaxminddb.so.0.0.7 libmaxminddb.so.0; }; })
remote: libtool: install: (cd /app/tmp/cache/geoip/libmaxminddb/dist/lib && { ln -s -f libmaxminddb.so.0.0.7 libmaxminddb.so || { rm -f libmaxminddb.so && ln -s libmaxminddb.so.0.0.7 libmaxminddb.so; }; })
remote: libtool: install: /usr/bin/install -c .libs/libmaxminddb.lai /app/tmp/cache/geoip/libmaxminddb/dist/lib/libmaxminddb.la
remote: libtool: install: /usr/bin/install -c .libs/libmaxminddb.a /app/tmp/cache/geoip/libmaxminddb/dist/lib/libmaxminddb.a
remote: libtool: install: chmod 644 /app/tmp/cache/geoip/libmaxminddb/dist/lib/libmaxminddb.a
remote: libtool: install: ranlib /app/tmp/cache/geoip/libmaxminddb/dist/lib/libmaxminddb.a
remote: libtool: finish: PATH="/app/.heroku/python/bin:/usr/local/bin:/usr/bin:/bin:/tmp/codon/vendor/bin:/sbin" ldconfig -n /app/tmp/cache/geoip/libmaxminddb/dist/lib

However, trying to load it, i get:

>>> reader = maxminddb.open_database(f"{os.environ.get('GEOIP_GEOLITE2_PATH')}/{os.environ.get('GEOIP_GEOLITE2_CITY_FILENAME')}",mode=1)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/app/.heroku/python/lib/python3.6/site-packages/maxminddb/__init__.py", line 37, in open_database
    "MODE_MMAP_EXT requires the maxminddb.extension module to be available"
ValueError: MODE_MMAP_EXT requires the maxminddb.extension module to be available

Just to check, I went ahead and tried to import maxminddb.extension and checked if it was loaded:

>>> import maxminddb.extension
>>> dir(maxminddb)
['InvalidDatabaseError', 'MODE_AUTO', 'MODE_FD', 'MODE_FILE', 'MODE_MEMORY', 'MODE_MMAP', 'MODE_MMAP_EXT', 'Reader', '__author__', '__builtins__', '__cached__', '__copyright__', '__doc__', '__file__', '__license__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__title__', '__version__', 'compat', 'const', 'decoder', 'errors', 'extension', 'file', 'maxminddb', 'open_database', 'os', 'reader']
>>> 'maxminddb.extension' in sys.modules
True

Is there something special I need to do to let maxminddb know where the extension files are?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.