sbenten / d3MapRenderer

A python QGIS plugin to export of polygons, polylines and point vector layers from shapefiles to topojson for display within a web page using the d3 JavaScript library, with additional options of popup information via d3-tip, charts from c3.js and a legend.
http://maprenderer.org/d3/
MIT License
33 stars 3 forks source link

Cannot start plugin (OS X 10.10) #8

Open TomBor opened 9 years ago

TomBor commented 9 years ago

Unable to start plugin with QGIS 2.8.2, Node.js v0.12.7 and topojson on OS X Yosemite.

A popup dialog says

"This plugin requires an installation of node.js and the topojson package. Please ensure node.js is installed and then run: 'npm install -g topojson' See the pre-requisites section at http://maprenderer.org/d3/"

Log message in QGIS: 2 helper which topojson Terminal cmd "which topojson": /usr/local/bin/topojson

sbenten commented 9 years ago

Hmmm. Somewhat hampered by not having OS X, only Windows and Ubuntu (which both work).

The log message is actually an error whilst performing the python subprocess command: check_output(["which", "topojson"])

Some more digging required.

ghost commented 9 years ago

I am also getting the above error message on OS 10.10.5. All the prerequisite are installed, but this error is stopping me from running the plugin.

sbenten commented 9 years ago

Still waiting for a installation disk for OS X in order to setup a virtual machine with it on in order to test this. However, I suspect this is an environmental problem, where the user credentials QGIS is running under are different to those under which topojson has been installed. The plugin calls out to the external topojson program so the initial check for its installation is required (otherwise there will be other errors further down the line). I've released v0.9 of the plugin which incorporates some further log messages. It will not fix the problem, but if you could attach the messages that would be helpful.

ghost commented 9 years ago

I reinstalled and got the more verbose error message:

This plugin requires an installation of node.js and the topojson package. Please ensure node.js is installed and then run: 'npm install -g topojson' See the pre-requisites section at http://maprenderer.org/d3/

I confirmed that topojson is installed, but that didn't resolve the problem. Is there any other trouble shooting I can do?

sbenten commented 9 years ago

Yes, could you please look in the LogMessages. Open it in Qgis by going to (from memory) View > Panels > Log Messages. The plugin will write a more verbose set of messages in there, just select the lot and paste them into this issue. I'm half expecting there to be an error about a program not being installed. If so, it will be a problem with Qgis running under a different user account than where topojson is installed.

Thanks On 17 Sep 2015 5:46 pm, "rcrocker13" notifications@github.com wrote:

I reinstalled and got the more verbose error message:

This plugin requires an installation of node.js and the topojson package. Please ensure node.js is installed and then run: 'npm install -g topojson' See the pre-requisites section at http://maprenderer.org/d3/

I confirmed that topojson is installed, but that didn't resolve the problem. Is there any other trouble shooting I can do?

— Reply to this email directly or view it on GitHub https://github.com/sbenten/d3MapRenderer/issues/8#issuecomment-141144999 .

ghost commented 9 years ago

Here's what I see:

d3maprender_error

sbenten commented 9 years ago

Yes, that's consistent with the topojson package not being installed under the same user account that Qgis is running under. I'll do some more digging, however... On Ubuntu I have installed node.js and any packages such as topojson using the root user (needs the root user password) and haven't run into any problems, with the commands

sudo apt-get install nodejs
sudo apt-get install npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g topojson
sudo npm install -g http-server

Now the process to install Node.js on OSX will be different (and until I get a VM with OSX I can only guess at which one works) and various options exist on the web. Did you download and run the Node.js installer from the website, use any sudo commands during install, or use Homebrew to install it?

ghost commented 9 years ago

I used Homebrew and sudo to install all of the packages.

newsroomdev commented 9 years ago

Chiming in that this is an issue using the Node package installer as well as Homebrew. Just tried it out with both

node v4.1.0 npm v2.14.3

fooloomanzoo commented 8 years ago

Also happens in Windows for me (node 5.3)

sbenten commented 8 years ago

v0.10 adds GeoJson support, so the dependency on TopoJson has been removed, and allow for the production of d3 maps with no functional difference (only json file size differs). I'll add an internal conversion to TopoJson in the future, rather than relying on calling an external package as this has proved unreliable.