raster-foundry / raster-foundry-python-client

A Python client for Raster Foundry.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows Install Doesn't Work

tgilcrest opened this issue · comments

Ran into an error trying to install ipyleaflet on Windows. npm is on my path and PowerShell can find npm when I call npm -v.

PS C:\Users\tgilcrest\Documents\03_rasterfoundry\raster-foundry-python-client> pip install -e git+https://github.com/azavea/ipyleaflet#egg=9cfd238
Obtaining 9cfd238 from git+https://github.com/azavea/ipyleaflet#egg=9cfd238
  Cloning https://github.com/azavea/ipyleaflet to c:\users\tgilcrest\documents\03_rasterfoundry\raster-foundry-python-cl
ient\src\9cfd238
    Complete output from command python setup.py egg_info:
    setup.py entered
    $PATH=C:\ProgramData\Anaconda3\Library\bin;C:\ProgramData\Anaconda3\Library\bin;C:\Program Files\Docker\Docker\Resou
rces\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:
\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Com
mon Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\
Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C
:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Git\cmd;C:\ProgramData\Anaconda3;C:\Pro
gramData\Anaconda3\Scripts;C:\ProgramData\Anaconda3\Library\bin;C:\ProgramData\Anaconda2;C:\ProgramData\Anaconda2\Script
s;C:\ProgramData\Anaconda2\Library\bin;C:\Program Files\OpenVPN\bin;C:\HashiCorp\Vagrant\bin;C:\Program Files\GDAL\;C:\P
rogram Files\nodejs\;C:\Users\tgilcrest\AppData\Local\atom\bin;C:\Users\tgilcrest\AppData\Local\Microsoft\WindowsApps;C:
\Program Files\Docker Toolbox;C:\Program Files\R\R-3.4.0;C:\Program Files\R\R-3.4.0\bin;C:\Program Files (x86)\Microsoft
 VS Code\bin;C:\Users\tgilcrest\AppData\Roaming\npm
    running egg_info
    running jsdeps
    `npm` unavailable.  If you're running this command using sudo, make sure `npm` is available to sudo
    rebuilding js and css failed
    missing files: ['C:\\Users\\tgilcrest\\Documents\\03_rasterfoundry\\raster-foundry-python-client\\src\\9cfd238\\ipyl
eaflet\\static\\extension.js', 'C:\\Users\\tgilcrest\\Documents\\03_rasterfoundry\\raster-foundry-python-client\\src\\9c
fd238\\ipyleaflet\\static\\index.js']
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\tgilcrest\Documents\03_rasterfoundry\raster-foundry-python-client\src\9cfd238\setup.py", line 167,
in <module>
        setup(**setup_args)
      File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\tgilcrest\Documents\03_rasterfoundry\raster-foundry-python-client\src\9cfd238\setup.py", line 48, i
n run
        raise e
      File "C:\Users\tgilcrest\Documents\03_rasterfoundry\raster-foundry-python-client\src\9cfd238\setup.py", line 41, i
n run
        self.distribution.run_command('jsdeps')
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\tgilcrest\Documents\03_rasterfoundry\raster-foundry-python-client\src\9cfd238\setup.py", line 112,
in run
        raise ValueError(msg)
    ValueError: Missing file: C:\Users\tgilcrest\Documents\03_rasterfoundry\raster-foundry-python-client\src\9cfd238\ipy
leaflet\static\extension.js
    npm is required to build a development version of widgetsnbextension

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\tgilcrest\Documents\03_rasterfoundry\raster-foun
dry-python-client\src\9cfd238\

I put together a little docker container that seems like it should work --

docker pull jisantuc/rf-client or build the following really simple dockerfile from the root of this repo

FROM jupyter/minimal-notebook

COPY . /opt/rf

WORKDIR /opt/rf
RUN pip install . &&\
  pip install git+https://github.com/azavea/ipyleaflet#egg=0.4.0.1 && \
  jupyter nbextension enable --py --sys-prefix widgetsnbextension && \
  jupyter nbextension install --py --symlink --sys-prefix ipyleaflet && \
  jupyter nbextension enable --py --sys-prefix ipyleaflet

If this seems like a better strategy than tracing down installation problems, I can open a PR

Now it does! Fixed in #25