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

MacOS: Error: invalid option: --with-librsvg #33

Closed
EricCacciavillani opened this issue Feb 4, 2019 · 58 comments
Closed

MacOS: Error: invalid option: --with-librsvg #33

EricCacciavillani opened this issue Feb 4, 2019 · 58 comments
Milestone

Comments

@EricCacciavillani
Copy link

EricCacciavillani commented Feb 4, 2019

First off thank you for creating the dependency it looks incredible to use.
But sadly I cant seem to install graphiz. Following the instructions for issue #23 I am confused with what I am supposed to do:
1.) I have xcode-select installed
2.) I ran "sudo xcodebuild -license" from the command-line (I dont understand why...just to confirm I got it I guess.)
3.) I run "brew uninstall graphviz"
4.) then finally run "brew install graphviz --with-librsvg --with-pango" in command-line

Then I get the following error
Error: invalid option: --with-librsvg
image

Thank you in advance for any help.

@parrt
Copy link
Owner

parrt commented Feb 4, 2019

That's weird. What version of OS X and brew (brew --version)?

@EricCacciavillani
Copy link
Author

EricCacciavillani commented Feb 4, 2019

Homebrew 2.0.0 Homebrew/homebrew-core (git revision bf83; last commit 2019-02-04)

Some more context. (I don't see the options for what you specified...)
image

Also thanks for the help! Tried it with each one of the given options to see if I could get anything working...

@parrt
Copy link
Owner

parrt commented Feb 4, 2019

hmm... yeah,Those options for the libraries are on the package. when I asked for information I get the following:

$ brew info graphviz
graphviz: stable 2.40.1 (bottled), HEAD
Graph visualization software from AT&T and Bell Labs
https://www.graphviz.org/
/usr/local/Cellar/graphviz/2.40.1 (504 files, 11.3MB) *
  Built from source on 2018-12-06 at 14:22:07 with: --with-librsvg --with-pango
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/graphviz.rb
==> Dependencies
Build: pkg-config ✔
Required: gd ✔, gts ✘, libpng ✘, libtool ✔
==> Options

wow. I get the error myself now. wth?! something has changed. This page seems to show that the option is valid but it's not working anymore:

https://formulae.brew.sh/formula/graphviz

it doesn't like the pango one either. crap.

@parrt
Copy link
Owner

parrt commented Feb 4, 2019

well, crap. It appears they have removed the options. see here https://github.com/Homebrew/homebrew-core/blob/master/Formula/graphviz.rb

I can't even install it myself at the moment!!! damn!

@EricCacciavillani
Copy link
Author

Dude that sucks! I am really sorry to hear that...well in the meantime, I can just try running it on my ubuntu machine.

@parrt
Copy link
Owner

parrt commented Feb 4, 2019

no biggie :) So svg comes out of linux no problem?

@EricCacciavillani
Copy link
Author

EricCacciavillani commented Feb 4, 2019

image
Dude this is actually amazing...like seriously...

(I need to fix that legend tho. But it seems like I need to convert all floats to ints to get it to work)

@parrt
Copy link
Owner

parrt commented Feb 5, 2019

On my other mac, i see:

$ brew info graphviz
graphviz: stable 2.40.1 (bottled), HEAD
Graph visualization software from AT&T and Bell Labs
https://www.graphviz.org/
/usr/local/Cellar/graphviz/2.40.1 (526 files, 12.3MB) *
  Built from source on 2018-09-30 at 19:11:42 with: --with-app --with-pango --with-librsvg
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
==> Analytics
install: 22,513 (30 days), 67,031 (90 days), 267,583 (365 days)
install_on_request: 15,095 (30 days), 44,379 (90 days), 175,990 (365 days)
build_error: 0 (30 days)

Ok, so a diff of graphviz.rb shows they deleted these:

 option "with-app", "Build GraphViz.app (requires full XCode install)"
  option "with-gts", "Build with GNU GTS support (required by prism)"
  option "with-pango", "Build with Pango/Cairo for alternate PDF output"
...
  depends_on "gts" => :optional
  depends_on "librsvg" => :optional
  depends_on "pango" => :optional

Ok, so the bastards decided those options are bad universally as they require it to be built from source: Homebrew/homebrew-core#31510

@parrt
Copy link
Owner

parrt commented Feb 5, 2019

@EricCacciavillani glad it's kinda working. yeah, int only class targets.

@EricCacciavillani
Copy link
Author

I can work with that. I admit I want to work with floats at times for my data, but then again binning is a thing and provides less overall noise in the dataset. So this will work for a majority of my datasets and dts but not all;(like 95% of the time this will be awesome) which again is still fantastic

Thanks so much for your time. I will be suggesting this to other data scientists I know. (Most of em have a Ubuntu machine so this will work well for them. Hopefully, you find a way to fix the mac problem but it does seem like its going to be a living nightmare...like just why....)

@parrt
Copy link
Owner

parrt commented Feb 5, 2019

Ok, try this:

brew uninstall graphviz
brew upgrade pango librsvg

cd /tmp
wget https://graphviz.gitlab.io/pub/graphviz/stable/SOURCES/graphviz.tar.gz
tar xvfz graphviz.tar.gz
cd graphviz-2.40.1/

rm -rf /usr/local/lib/graphviz # in case old stuff is there
./configure --includedir=/usr/local/include/graphviz
make -j 8 # 8 threads
make install

@parrt parrt closed this as completed in e08daa7 Feb 5, 2019
@parrt
Copy link
Owner

parrt commented Feb 5, 2019

make sure it's using /usr/local/bin/dot not, for example, /Users/parrt/anaconda3/bin/dot

Try dot -Tsvg:cairo from command line.

@EricCacciavillani
Copy link
Author

EricCacciavillani commented Feb 5, 2019

I will give this a try in a tiny bit sorry was finishing up a presentation. Really sorry....also I am an idiot I thought you wanted the matrix to be ints only...thank god that isnt the case...I really need to sleep more...

dot -Tsvg:cairo isn't showing up....but I did everything else going to spin up a JuypterLab to see if this works...fingers crossed!

Again terribly sorry I got sidetracked that was incredibly rude to you.

@EricCacciavillani
Copy link
Author

EricCacciavillani commented Feb 5, 2019

Yeah no getting the following errors.....
image

image

So what do I need to put in my system paths for this then???

@parrt
Copy link
Owner

parrt commented Feb 5, 2019

Damn! is the date on that dot when you installed it? And no errors from make or make install?

@EricCacciavillani
Copy link
Author

Didn't look like any errors happened. I dont understand what you mean by the "date of that dot".

@parrt
Copy link
Owner

parrt commented Feb 5, 2019

meaning timestamp ls -l /usr/local/bin/dot. i found an old one that didn't get overwritten earlier.

@EricCacciavillani
Copy link
Author

image
Oh....

@parrt
Copy link
Owner

parrt commented Feb 5, 2019

dang it! if it builds, this really should work. grrr....does your configure help show this:

$ ./configure --help|grep svg
  --with-rsvg=yes         rsvg library
$ ./configure --help|grep cairo
  --with-pangocairo=yes   pangocairo library

@parrt parrt reopened this Feb 5, 2019
@EricCacciavillani
Copy link
Author

Nope errors
image

@parrt
Copy link
Owner

parrt commented Feb 5, 2019

the -- is confusing grep. can you gry just the svg and cairo bits with grep like I did? thanks!

@EricCacciavillani
Copy link
Author

image
this?

@parrt
Copy link
Owner

parrt commented Feb 5, 2019

yup. ok, soooo weird. ok, let me try on a few other macs and let you know. i've reopened :) thanks much for the help.

@EricCacciavillani
Copy link
Author

No problem I will keep revisiting for any updates.

@parrt
Copy link
Owner

parrt commented Feb 5, 2019

@EricCacciavillani Can you verify that it is linking to the correct dot with:

ls -l $(which dot)

It should be:

$ ls -l $(which dot)
-rwxr-xr-x  1 parrt  wheel  22920 Feb  5 09:02 /usr/local/bin/dot*

and NOT:

$ ls -l $(which dot)
lrwxr-xr-x  1 parrt  wheel  33 Feb  4 19:54 /usr/local/bin/dot@ -> ../Cellar/graphviz/2.40.1/bin/dot

@EricCacciavillani
Copy link
Author

image

@parrt
Copy link
Owner

parrt commented Feb 6, 2019

dang. I tried that sequence on a 3rd mac and it worked well.

How about doing a make uninstall from that build dir then make sure dot command says not found. Then do make install again (no need to clean and remake). Try dot -Tsvg:cairo again.

@EricCacciavillani
Copy link
Author

Np I'll live! I still got my Ubuntu machine! :3

@parrt
Copy link
Owner

parrt commented Feb 18, 2019

ok, cool. i'll close for now.

@parrt parrt closed this as completed Feb 18, 2019
@bminahan73
Copy link

I have this same issue.

@bminahan73
Copy link

have tried all of the steps posted here so far.

@bminahan73
Copy link

screen shot 2019-03-03 at 12 18 00 pm

@parrt
Copy link
Owner

parrt commented Mar 4, 2019

Have you tried what's on the home page?

brew uninstall graphviz
brew reinstall pango librsvg  # even if already there, please reinstall

cd /tmp
wget https://graphviz.gitlab.io/pub/graphviz/stable/SOURCES/graphviz.tar.gz
tar xvfz graphviz.tar.gz
cd graphviz-2.40.1/

rm -rf /usr/local/lib/graphviz # in case old stuff is there
# make sure to run ./configure after reinstalling pango, librsvg
./configure --includedir=/usr/local/include/graphviz
make -j 8 # 8 threads
make install

@pingwhistle
Copy link

I had to pass the --with-pangocairo=yes switch to the configure script. Without it, graphviz would compile without cairo support

./configure --includedir=/usr/local/include/graphviz --with-pangocairo=yes

@parrt
Copy link
Owner

parrt commented Mar 6, 2019

wow. really? Ok, I am adding to the readme. Thank you

@bminahan73
Copy link

@pingwhistle 's suggestion worked for me as well :D

@lutaev
Copy link

lutaev commented Mar 21, 2019

Hi there. I got the same error and I also tried all steps posted here. Here is my last actions:

brew uninstall graphviz  # it gives me an error No such keg: /usr/local/Cellar/graphviz

brew reinstall pango librsvg
cd /tmp
wget https://graphviz.gitlab.io/pub/graphviz/stable/SOURCES/graphviz.tar.gz
tar xvfz graphviz.tar.gz
cd graphviz-2.40.1/
rm -rf /usr/local/lib/graphviz
./configure --includedir=/usr/local/include/graphviz --with-pangocairo=yes
make -j 8 # 8 threads
make install

Then I run

dot -Tsvg:cairo

And got

Format: "svg:cairo" not recognized. Use one of: svg:svg:core

My mac data:
iMac (21.5-inch, Late 2012)
MacOS Mojave

Thanks.

@parrt
Copy link
Owner

parrt commented Mar 21, 2019

Thanks. we need to know WHICH dot is running though. What does which dot say?

@lutaev
Copy link

lutaev commented Mar 21, 2019

Thanks for attention. which dot says:

/usr/local/bin/dot

@parrt
Copy link
Owner

parrt commented Mar 21, 2019

Hmm...that's correct. does ls -l /usr/local/bin/dot show your installation date? and also try rm ~/anaconda3/bin/dot just to be sure.

@lutaev
Copy link

lutaev commented Mar 21, 2019

Command ls -l /usr/local/bin/dot says:

-rwxr-xr-x  1 mac  admin  22920 21 мар 18:18 /usr/local/bin/dot

and then rm ~/anaconda3/bin/dot:

rm: /Users/mac/anaconda3/bin/dot: No such file or directory

@parrt
Copy link
Owner

parrt commented Mar 21, 2019

Dang. I'm at a loss I'm afraid. :(

@likejazz
Copy link

likejazz commented Apr 3, 2019

Same problem here.

$  dot -Tsvg:cairo
Format: "svg:cairo" not recognized. Use one of: svg:svg:core
$ ls -al /usr/local/bin/dot
-rwxr-xr-x  1 kaonpark  admin  22976 Apr  3 21:46 /usr/local/bin/dot

I have encountered a suspicious message before:

$ ./configure --includedir=/usr/local/include/graphviz --with-pangocairo=yes
...
checking for PANGOCAIRO... no
...
  lasi:          No (missing pangocairo support)
  ming:          No (disabled by default - incomplete)
  pangocairo:    No (pangocairo library not available)
...

@breadplop
Copy link

I am also facing such an issue.
Running this:
./configure --includedir=/usr/local/include/graphviz --with-pangocairo=yes
I noticed that:

graphviz-2.40.1 will be compiled with the following:
...
...
plugin libraries:
  dot_layout:    Yes (always enabled)
  neato_layout:  Yes (always enabled)
  core:          Yes (always enabled)
  devil:         No (missing library)
  gd:            Yes
  gdiplus:       No (disabled by default - Windows only)
  gdk:           
  gdk_pixbuf:    No (gdk_pixbuf library not available)
  ghostscript:   No (missing Xrender)
  glitz:         No (disabled by default - incomplete)
  gtk:           No (gtk library not available)
  lasi:          No (missing pangocairo support)
  ming:          No (disabled by default - incomplete)
  pangocairo:    No (pangocairo library not available)
  poppler:       No (poppler library not available)
  quartz:        No (disabled by default - Mac only)
  rsvg:          No (rsvg library not available)
  visio:         No (disabled by default - experimental)
  webp:          No (disabled by default - experimental)
  xlib:          Yes

In particular: pangocairo: No (pangocairo library not available)

How can I get the pangocairo library?

Can't seem to find much information on the web, this seems like the most relevant and active thread around.

Hope we can resolve this issue soon!

@parrt
Copy link
Owner

parrt commented Apr 3, 2019

Hi. We have a potential solution but I haven't checked it yet: #36 Can you try it?

@gautamkarnik
Copy link
Contributor

gautamkarnik commented Apr 3, 2019

Hi all,

Hope this helps in some way.

It appears that svg:cairo is no longer supported on 10.14. I hear is what I did at home. I also tested on Windows 10:

brew uninstall graphviz
brew reinstall pango librsvg --build-from-source # even if already there, please reinstall
brew reinstall cairo --build-from-source
brew install graphviz --build-from-source

Then updated trees.py to only use dot -Tsvg, as per the pull request. This however, does not solve the original font calculation problems that cairo solved, so some minor tweaks to this branch are needed.

You can also see what I had to do on Windows 10:

  • If you are having issues with run command you can try copying the following files from: https://github.com/xflr6/graphviz/tree/master/graphviz.
  • Place them in the AppData\Local\Continuum\anaconda3\Lib\site-packages\graphviz\site-packages\graphviz folder.
  • Clean out the __pycache__ directory too.

@parrt
Copy link
Owner

parrt commented Apr 3, 2019

@lutaev @likejazz @breadplop are you folks on 10.13 or 10.14 os x?

@angelo-moreira
Copy link

@parrt I have the exact same issue I am running 10.14 followed the last pull request but no luck

@parrt
Copy link
Owner

parrt commented Apr 3, 2019

Rats! Maybe @gautamkarnik, who has 10.14, can figure this out.

@likejazz
Copy link

likejazz commented Apr 4, 2019

@parrt I used to OS X 10.14 and still failed to install graphviz. but I've tried #36 and it works now!

@parrt
Copy link
Owner

parrt commented Apr 4, 2019

Just got this working on a student's laptop. All i did was the preamble:

conda uninstall python-graphviz
conda uninstall graphviz
pip install dtreeviz

and then the os x instructions. works great on 10.13.

@parrt
Copy link
Owner

parrt commented May 26, 2019

Fixed by b655c62

@parrt parrt added this to the 0.4 milestone May 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants