GithubHelp home page GithubHelp logo

Compatibility with OS X about cairosvg HOT 10 CLOSED

kozea avatar kozea commented on May 19, 2024
Compatibility with OS X

from cairosvg.

Comments (10)

liZe avatar liZe commented on May 19, 2024 2

Little late here, very annoying that a project doesn't download all it's dependencies. No excuses.

Helping nice people dealing with their own problems during my free time is my pleasure.

Pip can't install non-Python libraries, that's why it doesn't install Cairo. But you can deal with the whole deps tree by using a package manager such as Homebrew or Macports. You can package CairoSVG for MacOS as it's done by Linux users for many Linux distributions, that would be really helpful to many users (including future-yourself). I package CairoSVG for my Linux distribution (Gentoo), it's not really harder to package it for MacOS if you have a Mac at home.

I'm also interested in extra documentation about the installation steps on MacOS. As Cairo is generally installed on Linux, we don't have this extra step in the installation chatper of the documentation. I'm a Linux user and I unfortunately can't easily write a reliable documentation on MacOS and Windows. But the documentation page of the website is plain text that you can edit in a couple of minutes. I'll be really happy and grateful to merge your pull request.

You can turn hard feelings against me into smiles from future MacOS users. No excuses.

from cairosvg.

SimonSapin avatar SimonSapin commented on May 19, 2024

I don’t use OS X, but I’ve heard of people successfully using CairoSVG (and WeasyPrint) on OS X. How to install pycairo doesn’t really have its place in this issue tracker since it’s not a CairoSVG issue at all.

Additionally, "this solution didn't work" isn’t gonna get you very far. Please see http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

from cairosvg.

SimonSapin avatar SimonSapin commented on May 19, 2024

That said, it is apparently typical on OS X to have a couple of separate Python installs lying around. One shipped by Apple with the system, one installed by MacPorts, etc. Are you sure you’re using the same Python as the one pycairo was installed in?

from cairosvg.

GerardPaligot avatar GerardPaligot commented on May 19, 2024

I didn't say that CairoSVG didn't work, I said: I tried to use it, I got an error (cannot find import cairo) and I tried to install it in command line (sudo port install py27-cairo) but these solutions didn't work. I will not come here if I didn't make research on Google before. :)

If you would like more context : the project is a Django project which use virtualenv. So I control my environment (including python and its version) and I executed the command line above but the problem is always there.

Additionally, "this solution didn't work" isn’t gonna get you very far. Please see http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

I'm sorry if this issue isn't appropriate in the organisation of your project but this response isn't correct. I read this page on CairoSVG website and I didn't find a mailing list for my issue (there is a mail but this seems to be an email to one person).

from cairosvg.

SimonSapin avatar SimonSapin commented on May 19, 2024

Additionally, "this solution didn't work" isn’t gonna get you very far.

What I mean by this is that, without more information, I have no idea what doesn’t work or why. I am not looking at your screen. When asking for help like this, you need to provide as much information as possible. Do you see an error message? If so, what is it? (Copy/paste it entirely, with as much context as possible. Don’t paraphrase.) What exact steps did you follow to trigger it? Or do you get another kind of unexpected result? If so, what result exactly, what did you do to get it, and what did you expect instead?

The naming is a bit confusing, but Cairo, pycairo, and CairoSVG are three separate projects.

port install py27-cairo installs pycairo for the Python installed by Macports. CairoSVG is not pycairo, much less the Macports packaging of pycairo. So if this install fails (does it? do you get an error message?) that’s not something we can fix by changing CairoSVG’s code.

From "it cannot find import of cairo" I’m gonna guess that you’re seeing a ImportError: No module named 'cairo' error message. This probably means either that pycairo is not installed in the Python you’re using (perhaps because it’s a different Python install), or that you’re using virtualenv with --no-site-packages (which is now the default).

--no-site-packages hides from your virtualenv packages that are installed outside of it. port install py27-cairo installs outside of your virtualenv. If that’s what’s going on, you can re-create your virtualenv with --system-site-packages.

But again, none of this is sign of an issue in CairoSVG, and this is the CairoSVG issue tracker.

from cairosvg.

GerardPaligot avatar GerardPaligot commented on May 19, 2024

The naming is a bit confusing, but Cairo, pycairo, and CairoSVG are three separate projects.

Ok, I didn't know that. But CairoSVG seems to have a dependency to cairo and I got an error with this dependency. This is my stacktrace:

Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/management/base.py", line 284, in execute
    self.validate()
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/management/base.py", line 310, in validate
    num_errors = get_validation_errors(s, app)
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/management/validation.py", line 34, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/db/models/loading.py", line 196, in get_app_errors
    self._populate()
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/db/models/loading.py", line 78, in _populate
    self.load_app(app_name)
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load_app
    models = import_module('%s.models' % app_name)
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/debug_toolbar/models.py", line 9, in <module>
    dt_settings.patch_all()
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/debug_toolbar/settings.py", line 238, in patch_all
    patch_root_urlconf()
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/debug_toolbar/settings.py", line 226, in patch_root_urlconf
    reverse('djdt:render_panel')
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/urlresolvers.py", line 507, in reverse
    app_list = resolver.app_dict[ns]
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/urlresolvers.py", line 329, in app_dict
    self._populate()
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/urlresolvers.py", line 267, in _populate
    for pattern in reversed(self.url_patterns):
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/urlresolvers.py", line 365, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/core/urlresolvers.py", line 360, in urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/Gerard/Documents/workspace-django/zds-site/zds/urls.py", line 76, in <module>
    url(r'^tutoriels/', include('zds.tutorial.urls')),
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 26, in include
    urlconf_module = import_module(urlconf_module)
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/Gerard/Documents/workspace-django/zds-site/zds/tutorial/urls.py", line 5, in <module>
    from . import views
  File "/Users/Gerard/Documents/workspace-django/zds-site/zds/tutorial/views.py", line 23, in <module>
    import cairosvg
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/cairosvg/__init__.py", line 27, in <module>
    from . import surface
  File "/Users/Gerard/.virtualenvs/zdsenv/lib/python2.7/site-packages/cairosvg/surface/__init__.py", line 30, in <module>
    import cairo  # pycairo
ImportError: No module named cairo

So, my environment found CairoSVG but it didn't find a module named cairo in CairoSVG.

--no-site-packages hides from your virtualenv packages that are installed outside of it. port install py27-cairo installs outside of your virtualenv. If that’s what’s going on, you can re-create your virtualenv with --system-site-packages.

That is possible. Macports seems to install dependencies outside virtualenv, so in the python of my operating system and not in virtualenv. I'll try your proposition.

But again, none of this is sign of an issue in CairoSVG, and this is the CairoSVG issue tracker.

Yes, after our conversation, I agree and I'm sorry. We can close this issue if you judge necessary. :)

from cairosvg.

yamajik avatar yamajik commented on May 19, 2024

I have same issues, It's because the dependencies is too old, and your Mac is too new. that's it.
I am trying fixing it. and report solution here in next 5 hours.

from cairosvg.

liZe avatar liZe commented on May 19, 2024

@SquirrelMajik @GerardPaligot News about this ticket?

from cairosvg.

liZe avatar liZe commented on May 19, 2024

No news is good news

from cairosvg.

tpowell01 avatar tpowell01 commented on May 19, 2024

Little late here, very annoying that a project doesn't download all it's dependencies. No excuses.

from cairosvg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.