Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when executing tm.py #37

Closed
sushi2k opened this issue Mar 30, 2019 · 11 comments
Closed

Error when executing tm.py #37

sushi2k opened this issue Mar 30, 2019 · 11 comments

Comments

@sushi2k
Copy link

sushi2k commented Mar 30, 2019

Hi all,

thanks for sharing this nice tool. I just wanted to explore the sample but getting an error

➜  pytm git:(master) ✗ ./tm.py --dfd | dot -Tpng -o sample1.png
2019-03-31 07:24:45.271 dot[27759:12821403] +[__NSCFConstantString length]: unrecognized selector sent to class 0x7fff95b4a8c0
2019-03-31 07:24:45.272 dot[27759:12821403] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[__NSCFConstantString length]: unrecognized selector sent to class 0x7fff95b4a8c0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff3df1743d __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff69e25720 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff3df941a5 __CFExceptionProem + 0
	3   CoreFoundation                      0x00007fff3deb6ad0 ___forwarding___ + 1486
	4   CoreFoundation                      0x00007fff3deb6478 _CF_forwarding_prep_0 + 120
	5   CoreFoundation                      0x00007fff3de47f54 CFStringCompareWithOptionsAndLocale + 72
	6   ImageIO                             0x00007fff409b5367 _ZN17IIO_ReaderHandler15readerForUTTypeEPK10__CFString + 53
	7   ImageIO                             0x00007fff4098d527 _ZN14IIOImageSource14extractOptionsEP13IIODictionary + 183
	8   ImageIO                             0x00007fff409ba2e6 _ZN14IIOImageSourceC2EP14CGDataProviderP13IIODictionary + 72
	9   ImageIO                             0x00007fff409ba1bb CGImageSourceCreateWithDataProvider + 172
	10  libgvplugin_quartz.6.dylib          0x0000000107cfcc54 quartz_loadimage_quartz + 224
	11  libgvc.6.dylib                      0x0000000107c59781 gvloadimage + 269
	12  libgvc.6.dylib                      0x0000000107c587e0 gvrender_usershape + 955
	13  libgvc.6.dylib                      0x0000000107c8662e poly_gencode + 2129
	14  libgvc.6.dylib                      0x0000000107c92b7b emit_node + 1030
	15  libgvc.6.dylib                      0x0000000107c91805 emit_graph + 4769
	16  libgvc.6.dylib                      0x0000000107c96d0d gvRenderJobs + 4911
	17  dot                                 0x0000000107c4fd62 main + 697
	18  libdyld.dylib                       0x00007fff6aef3085 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    27758 done       ./tm.py --dfd |
       27759 abort      dot -Tpng -o sample1.png

I installed graphviz via brew, using macOS 10.14 and Python 3.7.3.

@shambho
Copy link
Contributor

shambho commented Mar 31, 2019

@sushi2k This looks like an error in graphviz package Sven. Can you try reinstalling graphviz with the following command and let me know if it works?

brew install graphviz --with-pango

Reference: y13i/sgviz#10

@sushi2k
Copy link
Author

sushi2k commented Mar 31, 2019

Thanks. But when executing this I only got an error (same happens with "install", I also removed it and tried to reinstall again, I executed brew update and also brew cleanup)

$ brew reinstall graphviz --with-pango
Usage: brew reinstall [options] formula

Uninstall and then install formula (with existing and any appended install
options).

Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will be run for the
reinstalled formulae or, every 30 days, for all formulae.

    -d, --debug                      If brewing fails, open an interactive
                                     debugging session with access to IRB or a
                                     shell inside the temporary build directory
    -s, --build-from-source          Compile formula from source even if a
                                     bottle is available.
        --force-bottle               Install from a bottle if it exists for the
                                     current or newest version of macOS, even if
                                     it would not normally be used for
                                     installation.
        --keep-tmp                   Don't delete the temporary files created
                                     during installation.
    -f, --force                      Install without checking for previously
                                     installed keg-only or non-migrated
                                     versions.
    -v, --verbose                    Print the verification and postinstall
                                     steps.
        --display-times              Print install times for each formula at the
                                     end of the run.
    -h, --help                       Show this message.
Error: invalid option: --with-pango

I was installing now pango and librsvg also via brew but no change.

$ brew install pango librsvg

Seems --with-pango is no longer supported in the formula of graphviz. BurntSushi/erd#48

Any idea how to get it work?

@shambho
Copy link
Contributor

shambho commented Apr 1, 2019

hmm, I don't have a Mac to test what you're seeing unfortunately. @izar how did you install Graphviz on your machine?

@izar
Copy link
Owner

izar commented Apr 1, 2019

Are you using Quartz?

I am running on 10.14.4 too, no Quartz.

graphviz: stable 2.40.1 (bottled), HEAD
Graph visualization software from AT&T and Bell Labs
https://www.graphviz.org/
/usr/local/Cellar/graphviz/HEAD-3cd810d (532 files, 12.2MB) *
Built from source on 2019-01-11 at 13:31:46 with: --with-app --with-gts --with-pango
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/graphviz.rb
==> Dependencies
Build: pkg-config ✔
Required: gd ✔, gts ✔, libpng ✔, libtool ✔
==> Options
--HEAD
Install HEAD version

@sushi2k
Copy link
Author

sushi2k commented Apr 2, 2019

So I had Xquartz installed and removed it as described here: https://gist.github.com/pwnsdx/d127873e24cef159d4d603accaf37ee4

I reinstalled now graphviz via brew but still same error. I can also not install it with the flags as mentioned by you, as I just get an error as they are not part of the formula anymore (see also BurntSushi/erd#48)

➜  pytm git:(master) ✗ brew reinstall graphviz --with-app --with-gts --with-pango
Usage: brew reinstall [options] formula

Uninstall and then install formula (with existing and any appended install
options).

Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will be run for the
reinstalled formulae or, every 30 days, for all formulae.

    -d, --debug                      If brewing fails, open an interactive
                                     debugging session with access to IRB or a
                                     shell inside the temporary build directory
    -s, --build-from-source          Compile formula from source even if a
                                     bottle is available.
        --force-bottle               Install from a bottle if it exists for the
                                     current or newest version of macOS, even if
                                     it would not normally be used for
                                     installation.
        --keep-tmp                   Don't delete the temporary files created
                                     during installation.
    -f, --force                      Install without checking for previously
                                     installed keg-only or non-migrated
                                     versions.
    -v, --verbose                    Print the verification and postinstall
                                     steps.
        --display-times              Print install times for each formula at the
                                     end of the run.
    -h, --help                       Show this message.
Error: invalid option: --with-app

@izar
Copy link
Owner

izar commented Apr 2, 2019

I'm sorry, but that's the extent of my knowledge regarding graphviz installation on a Mac. Did you try installing with no flags, just play brew install graphviz ?

@sushi2k
Copy link
Author

sushi2k commented Apr 2, 2019

yes, that's the only way how I can install it, but then I am getting this error

➜  pytm git:(master) ✗ ./tm.py --dfd | dot -Tpng -o sample1.png
2019-04-03 07:22:18.988 dot[8301:55469] +[__NSCFConstantString length]: unrecognized selector sent to class 0x7fff837a48c0
2019-04-03 07:22:18.988 dot[8301:55469] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[__NSCFConstantString length]: unrecognized selector sent to class 0x7fff837a48c0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff2bb7143d __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff57a83720 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff2bbee1a5 __CFExceptionProem + 0
	3   CoreFoundation                      0x00007fff2bb10ad0 ___forwarding___ + 1486
	4   CoreFoundation                      0x00007fff2bb10478 _CF_forwarding_prep_0 + 120
	5   CoreFoundation                      0x00007fff2baa1f54 CFStringCompareWithOptionsAndLocale + 72
	6   ImageIO                             0x00007fff2e60f367 _ZN17IIO_ReaderHandler15readerForUTTypeEPK10__CFString + 53
	7   ImageIO                             0x00007fff2e5e7527 _ZN14IIOImageSource14extractOptionsEP13IIODictionary + 183
	8   ImageIO                             0x00007fff2e6142e6 _ZN14IIOImageSourceC2EP14CGDataProviderP13IIODictionary + 72
	9   ImageIO                             0x00007fff2e6141bb CGImageSourceCreateWithDataProvider + 172
	10  libgvplugin_quartz.6.dylib          0x000000010accec54 quartz_loadimage_quartz + 224
	11  libgvc.6.dylib                      0x000000010ac0c781 gvloadimage + 269
	12  libgvc.6.dylib                      0x000000010ac0b7e0 gvrender_usershape + 955
	13  libgvc.6.dylib                      0x000000010ac3962e poly_gencode + 2129
	14  libgvc.6.dylib                      0x000000010ac45b7b emit_node + 1030
	15  libgvc.6.dylib                      0x000000010ac44805 emit_graph + 4769
	16  libgvc.6.dylib                      0x000000010ac49d0d gvRenderJobs + 4911
	17  dot                                 0x000000010ac04d62 main + 697
	18  libdyld.dylib                       0x00007fff58b51085 start + 1
	19  ???                                 0x0000000000000004 0x0 + 4
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    8300 done       ./tm.py --dfd |
       8301 abort      dot -Tpng -o sample1.png

@izar
Copy link
Owner

izar commented Apr 2, 2019

Yep - sorry, but it appears to be a graphviz problem. Not sure what to tell you here.

@sushi2k
Copy link
Author

sushi2k commented Apr 2, 2019

Thanks for your help. Once i figure it out, I will share it here

@anshumanbh
Copy link

@sushi2k @shambho This fixed it for me:
parrt/dtreeviz#33 (comment)

@sushi2k
Copy link
Author

sushi2k commented Apr 7, 2019

Awesome. Thanks @anshumanbh that worked :-)

@sushi2k sushi2k closed this as completed Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants