Monday, 17 September 2018

Using python with SVG - part 1

Trying to follow the instructions here:
https://jespermaag.github.io/blog/2018/gganatogram/
to help create some more tissues for gganatogram.

Unfortunately fail at first step:
Downloading SVG files using npm install --save anatomogram
This gave an error message...
Similar to this: https://github.com/npm/npm/issues/3190
I think I probably need to reinstall npm
Following this: https://stackoverflow.com/questions/11284634/upgrade-node-js-to-the-latest-version-on-mac-os

using Node -v gives a nice up todate version number v10.10.0

Try again with sudo npm install --save anatomogram
This has worked but gave warnings:
> styled-components@3.4.6 postinstall /Users/paulbrennan/Documents/anatomogram/node_modules/styled-components
> node ./scripts/postinstall.js || exit 0

Use styled-components at work? Consider supporting our development efforts at opencollective.com/styled-components
npm WARN saveError ENOENT: no such file or directory, open '/Users/paulbrennan/Documents/anatomogram/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/paulbrennan/Documents/anatomogram/package.json'
npm WARN anatomogram No description
npm WARN anatomogram No repository field.
npm WARN anatomogram No README data
npm WARN anatomogram No license field.

+ anatomogram@2.0.0
added 21 packages from 24 contributors, updated 1 package, moved 23 packages and audited 102 packages in 21.306s

found 0 vulnerabilities

Checked the file organisation and there are outline SVG files...

At the moment I can only find outlines not organs, etc...

Open PyCharm.
Cut and paste in code...

Hmm, check Python version and packages...
Pauls-MBP-2:anatomogram paulbrennan$ python --version

Python 2.7.10

Should probably update...
Maybe just do this:

Pauls-MBP-2:anatomogram paulbrennan$ python3


Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04) 

And gives:

>>> 

Test this:
>>> print("Hello world")
Hello world

Works.
Control D to exit (https://apple.stackexchange.com/questions/62164/how-do-i-exit-python-in-the-mountain-lion-terminal)

No comments:

Post a Comment