Closed danlipsa closed 7 years ago
@danlipsa I'm trying to test it, but apparently the build of VTK on our conda channel doesn't have VTKWeb installed.
Traceback (most recent call last):
File "server.py", line 35, in <module>
from vtk.web import protocols, server
File "/Users/fries2/anaconda/envs/vtkwebjs/lib/python2.7/site-packages/vtk/web/protocols.py", line 9, in <module>
from vtkWebCorePython import vtkWebApplication, vtkWebInteractionEvent
ImportError: No module named vtkWebCorePython
# packages in environment at /Users/fries2/anaconda/envs/vtkwebjs:
#
cloog 0.18.0 0
nodejs 4.5.0 0 conda-forge
curl 7.49.0 1
freetype 2.5.5 1
gmp 5.1.2 6
isl 0.12.2 1
jbig 2.1 0
jpeg 8d 2
libpng 1.6.17 0
libtiff 4.0.6 2
mpc 1.0.1 0
mpfr 3.1.2 0
numpy 1.9.2 py27_2
openssl 1.0.2j 0
pip 8.1.2 py27_0
python 2.7.12 1
readline 6.2 2
setuptools 27.2.0 py27_0
sqlite 3.13.0 0
tk 8.5.18 0
cdat_info 2.6.1 UVCDAT uvcdat
cdms2 2.6.1 UVCDAT uvcdat
cdtime 2.6.1 UVCDAT uvcdat
cdutil 2.6 UVCDAT uvcdat
clapack 3.2.1 UVCDAT uvcdat
distarray 2.6 UVCDAT uvcdat
dv3d 2.6 UVCDAT uvcdat
esmf ESMF_6_3_0rp1_ESMP_01 UVCDAT uvcdat
ffmpeg 2.7.0 UVCDAT uvcdat
g2clib 1.4.0b UVCDAT uvcdat
genutil 2.6 UVCDAT uvcdat
gfortran 4.9.3 1 uvcdat
hdf5 1.8.16 UVCDAT uvcdat
jasper 1.900.1 UVCDAT uvcdat
lapack 3.4.2 UVCDAT uvcdat
libcdms 2.6.1 UVCDAT uvcdat
libcf 1.0.beta11 UVCDAT uvcdat
libdrs_c 1.0.1 UVCDAT uvcdat
libdrs_f 1.0.1 UVCDAT uvcdat
libnetcdf 4.3.3.1 UVCDAT uvcdat
ossuuid 1.6.2 UVCDAT uvcdat
proj4 4.9.2 UVCDAT uvcdat
regrid2 2.6.1 UVCDAT uvcdat
udunits2 2.2.17 UVCDAT uvcdat
unidata 2.6 UVCDAT uvcdat
vcs 2.6 UVCDAT uvcdat
vcsaddons 2.6 UVCDAT uvcdat
vtk 7.1.0.2.6 uvcdat_master uvcdat
x264 20151006.2245 UVCDAT uvcdat
yasm 1.2.0 UVCDAT uvcdat
wheel 0.29.0 py27_0
xz 5.2.2 0
zlib 1.2.8 3
@chaosphere2112 for now get the recipe from UV-CDAT/conda-recipes and turn webvtk on.
@chaosphere2112 @doutriaux1 Sorry for the delay, I was off yesterday. vtkweb is aleady there. I am using the latest uvcdat repo with the latest vcs repo installed on top. Try launching the server like that:
PYTHONPATH=/home/danlipsa/anaconda2/envs/2.6-42-g24f85dc/lib/python2.7/site-packages/vtk /home/danlipsa/anaconda2/envs/2.6-42-g24f85dc/bin/vtkpython server/server.py -p 9000
Make sure you replace my conda dir with yours.
Setting the PYTHONPATH should be unnecessary if you are running with vtkpython
rather than just python
.
Had not heard of vtkpython
. I'll give that a shot.
@jbeezley Nope, that doesn't work at all:
$ vtkpython
vtk version 7.1.0
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
I'm going to give the manual pythonpath a try.
@chaosphere2112 @jbeezley Note, I am using vtkpython as well. Not sure why this needs the PYTHONPATH as well. It may be a conda thing.
That's probably a problem with the vtk build in conda then. vtkpython
is intended to add all necessary paths (LD_LIBRARY_PATH
and PYTHONPATH
) automatically.
So, the process as I believe I have interpreted:
npm install
npm run demo &
PYTHONPATH=/path/to/my/env/blahblahblah/vtk python server/server.py -p 9000
(which appears to correctly set up python for vtkweb)at which point I open http://localhost:8080/demo
in my browser, and nothing happens; console says ReferenceError: $ is not defined
with a link to line 98 of demo.js.
@jbeezley Do you know what this error is?
That sort of error would seem to indicate there was an error thrown while loading the main bundle. There was no error before that point? Was ../dist/vcs.js
served by the dev server?
@chaosphere2112 I think you are missing the 'npm run build' step.
$ npm run build
> vcs-js@0.1.0 build /Users/fries2/Projects/vcs-js
> webpack --progress --colors
Hash: e51d31b561d0a51489da
Version: webpack 1.13.2
Time: 40ms
ERROR in Entry module not found: Error: Cannot resolve module 'babel' in /Users/fries2/Projects/vcs-js
$ npm install -g babel
npm WARN deprecated babel@6.5.2: Babel's CLI commands have been moved from the babel package to the babel-cli package
/Users/fries2/anaconda/envs/vtkwebjs/bin/babel -> /Users/fries2/anaconda/envs/vtkwebjs/lib/node_modules/babel/cli.js
/Users/fries2/anaconda/envs/vtkwebjs/bin/babel-external-helpers -> /Users/fries2/anaconda/envs/vtkwebjs/lib/node_modules/babel/cli.js
/Users/fries2/anaconda/envs/vtkwebjs/bin/babel-node -> /Users/fries2/anaconda/envs/vtkwebjs/lib/node_modules/babel/cli.js
/Users/fries2/anaconda/envs/vtkwebjs/lib
└── babel@6.5.2
You don't want a global install of babel, and npm run build
should be unnecessary because we are using webpack-dev-server
. In any case, babel should be installed through the usual npm install
. My first guess is that you are using an older version of npm. I would try npm install -g npm@3
, delete node_modules
, and try again.
The errors I mentioned:
ERROR in ./src/session.js
/Users/fries2/Projects/vcs-js/src/session.js
33:37 error Unexpected parentheses around single function argument having a body with no curly braces arrow-parens
38:15 error Unexpected parentheses around single function argument having a body with no curly braces arrow-parens
40:40 error Unexpected parentheses around single function argument having a body with no curly braces arrow-parens
87:15 error Unexpected parentheses around single function argument having a body with no curly braces arrow-parens
✖ 4 problems (4 errors, 0 warnings)
ERROR in ./src/file.js
/Users/fries2/Projects/vcs-js/src/file.js
11:15 error Unexpected parentheses around single function argument having a body with no curly braces arrow-parens
✖ 1 problem (1 error, 0 warnings)
ERROR in ./src/vtkweb/index.js
/Users/fries2/Projects/vcs-js/src/vtkweb/index.js
32:57 error Unary operator '++' used no-plusplus
40:58 error Unary operator '++' used no-plusplus
✖ 2 problems (2 errors, 0 warnings)
@chaosphere2112 Searching for no-plusplus says to replace ++ with += which is fine. I think you have a newer version of eslint.
@danlipsa I'm running v3.7.1, apparently.
@chaosphere2112 I have 3.3.1. This is downloaded by npm install I think, so it should be a way to fix the version.
@danlipsa, if you run npm update
, it will update all of your local packages to the most recent version. What happened here is eslint was updated in kw-web-suite, which pulled in some minor rule changes. You can try pinning the version of kw-web-suite to prevent that from happening in the future.
Thanks @jbeezley. @chaosphere2112 Do you want me to update the PR and fix the errors with the new lint?
@danlipsa Please; once you do, I'll merge and get started on my work.
@chaosphere2112 Done.
:+1: Thanks!
@aashish24 @doutriaux1 @chaosphere2112 @mattben @jbeezley Please review.
vcs-js is back to the old master capabilities with the new vtkweb frontend and ES6 - thanks to Jon for starting this. Outstanding issues: