1

I want to use rasterio and rio-color plugin.

I used pip for installing rasterio and rio-color and afterwards when I want to run "rio", I see this:

 Traceback (most recent call last):
  File "/usr/local/bin/rio", line 7, in <module>
    from rio.manage import main
  File "/usr/local/lib/python2.7/dist-packages/rio/__init__.py", line 5, in <module>
    from .app import create_app
  File "/usr/local/lib/python2.7/dist-packages/rio/app.py", line 11, in <module>
    from rio.setup import configure_app
  File "/usr/local/lib/python2.7/dist-packages/rio/setup.py", line 10, in <module>
    from .core import db
  File "/usr/local/lib/python2.7/dist-packages/rio/core.py", line 14, in <module>
    from flask_user import UserManager
  File "/usr/local/lib/python2.7/dist-packages/flask_user/__init__.py", line 9, in <module>
    from flask_login import LoginManager, UserMixin as LoginUserMixin, make_secure_token
ImportError: cannot import name make_secure_token

What should I do?

  • Rio is part of rasterio therefore simply install rasterio – gene Mar 25 '17 at 19:48
  • @gene Ok, thank you. But then how can I reach this command line interface? How to run it? – J.Coo Mar 25 '17 at 20:16
2

as gene says, rio is part of rasterio, the python package, so it's a pip install

To set up in a python virtual env, run the following. I find I need to install numpy separately first, rather than trying to pull it in as a dependency of rasterio (if I just install rasterio, it complains it can't find the numpy header files)

mkdir /tmp/build
cd /tmp/build
pyvenv venv  # or venv venv, depending on python version
. ./venv/bin/activate
pip install numpy  # this can take a long time, so be patient
pip install rasterio
pip install rio-color
rio

If all goes well, you should get a usage string.

Using pip search shows the various plugins you can bring in if you need to:-

pip search rio-
rio-joydivision (0.0.1)  - Lines will tear us apart
rio-clip (0.0.2)         - Clip a geo-aware raster to the bounds of another.
rio-hist (0.3.0)         - Histogram matching plugin for rasterio
rio-toa (0.3.0)          - Top Of Atmosphere (TOA) calculations for Landsat 8
rio-mucho (0.2.2)        - Windowed multiprocessing wrapper for rasterio
rio-alpha (0.5.1)        - A replacement for pxm-alpha
rio-metasay (1.2.0)      - Skeleton of a Python package
rio-pansharpen (0.2.0)   - rio-pansharpen
rio-rgbify (0.3.0)       - Encode arbitrary bit depth rasters in psuedo base-256 as RGB
rio-cloudmask (0.2.0)    - Cloud masking plugin for rasterio
rio-merge-rgba (0.2.0)   - rio merge alternative optimized for RGBA
rio-color (0.4.0)        - Color correction plugin for rasterio
rio (0.3.2)              - RESTful event dispatcher based on celery.
rio-mbtiles (1.3.0)      - A Rasterio plugin command that exports MBTiles
rio-client (0.3.0)       - Client for Rio.
| improve this answer | |
  • thank you, steven. I updated my question with response when trying to run rio, do you know where the problem could be? – J.Coo Mar 27 '17 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.