Hướng dẫn dùng tulip svg python

  • Summary
  • Files
  • Reviews
  • Support
  • Wiki
  • Tickets ▾
    • Crash reports
    • Feature Requests
    • Bugs
  • News
  • Discussion
  • Code
  • Mailing Lists

Menu

Created: 2017-01-11

Updated: 2017-01-16

  • System: Windows 10 64x Home
    Tulip Version 4.10
    Anaconda 4.0.0 64bit [Python 2.7.12]

    Hello eyerbody,

    I'm trying to use the SVG export plugin in my code but I am unable to find it in the Python API.

    After importing tlp from tulip, tlp.getExportPluginsList[] returns only this list:
    ['GML Export', 'JSON Export', 'TLP Export', 'TLPB Export']

    Therefore, trying to run something like tlp.exportGraph['SVG Export', graph, outputFile, params] causes the following error:

    Exception: No plugin named SVG Export

    Any help is appreciated.

    Greetings,
    Nicolas

     

    Last edit: Nicolas Huber 2017-01-11

    • Hi Nicolas,

      As stated in the Tulip-Python documentation, the tulipgui module must be imported first before being able to call the SVG export plugin. This is due to the fact that plugin uses Qt in its implementation.

      Cheers

      Antoine

      • Thank you for your quick and helpful response. I completely overlooked this section of the documentation.

        Update:
        Sorry to bother you again but unfortunately trying to import tulipgui causes the following error:
        ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.
        Do you have an idea as to why that could happen? I'm using JetBrains PyCharm Community Edition 2016.2.3.

        • Hi Nicolas,

          I have just installed PyCharm in order to try to import the tulip modules [installed trough pip] and everything works fine. Did you modify some environment variables like PYTHONPATH or PATH ? It could be the cause of your issue.

          Cheers

          Antoine

          • Hi Antoine,

            yes I changed my systems path and local PATH environment variables after installing tulip. They both currently include:

            C:\Anaconda2

            C:\Anaconda2\Lib\site-packages

            C:\Anaconda2\Scripts

            C:\Anaconda2\DLLs

            C:\Anaconda2\Library\bin

            C:\Program Files\Tulip-4.10.0

            C:\Program Files\Tulip-4.10.0\bin\python\tulip

            C:\Program Files\Tulip-4.10.0\bin\python\tulipgui

            I did not create a seperate PYTHONPATH. Also, I just tried to import tulipgui in ipython in the command line and it worked perfectly fine.

            Greetings,
            Nicolas

             

            Last edit: Nicolas Huber 2017-01-14

            • Hi Nicolas,

              If I understand correctly, you are trying to import the Tulip-Python modules distributed with the Tulip software and not those you can get with the pip tool.

              In that case, you have to set the PYTHONPATH env variable to C:\Program Files\Tulip-4.10.0\bin\python\ [location of Tulip-Python modules] and add the following path to the PATH env variable C:\Program Files\Tulip-4.10.0\bin\ [location of the DLL dependencies of the Tulip-Python modules].

              Hope that it will help.

              Best regards,
              Antoine

              • Hi Antoine,

                I changed my env variables the way you suggested and it fixed my problem. Thank you so much for your detailed and patient support.

                Greetings,
                Nicolas

                Log in to post a comment.

                Chủ Đề