Menu

Import tulip in Python

Help
2020-09-02
2020-09-09
  • Elektra Kypridemou

    Hello,

    I am trying to import tulip in Python on Win10, using VS Code, but I am getting an error.

    I have installed the module using 'pip install tulip-python'
    Then I added the <tulip_install_dir>/lib/tulip/python</tulip_install_dir> path in Path in the System Environment Properties

    When I try to run:
    import tulip
    I get the following error:

    File "C:.....\Tulip=5.4.0\lib\tulip\python\tulip\init.py", line 33, in <module>
    import _tulip # noqa
    ImportError: DLL load failed: The specified module could not be found.</module>

    Could you please help?

    PS: I have tried both Python 2.7.18 and Python 3.7.1 versions, both 64-bits

     

    Last edit: Elektra Kypridemou 2020-09-02
  • Elektra Kypridemou

    Hello again,

    I just read on another topic, that python 2.7 needs to be 32 bit.

    I just tried using python 2.7.18 32-bit, and I get the following message:

    File "C:.....\Tulip=5.4.0\lib\tulip\python\tulip\init.py", line 33, in <module>
    import _tulip # noqa
    ImportError: DLL load failed: %1 is not a valid Win32 application.</module>

    I have Tulip version 5.4.0, which says that has the addition of the Python 3.8 support, so it should be fine with python 3 as well..

    Thank you,
    Elektra

     

    Last edit: Elektra Kypridemou 2020-09-02
  • Elektra Kypridemou

    Dear Patrick,

    thank you so much for your reply! This explains a lot!
    Actually, what I ended up doing was uninstalling the Tulip software from my computer. This made the tulip-python package be successfully imported in Python. So if I want to install the software again, will I have to remove the paths from my environment variables, in order to keep the python module working?

    Also, I had to set up a virtual environment and install the tulip-python module only there. I avoid installing the tulip-python module in my basic pip environment, because otherwise it seems to have some conflicts with some other modules I am using, like matplotlib, scipy and numpy. So after installing the tulip-python, I had problems importing the above packages. My temporary solution was running the tulip-related part of the code in the virtual environment, but it would be better if I could run the whole code in the same environment. Do you have any tips for fixing this?

    Thank you very much for your support,
    Elektra

     

    Last edit: Elektra Kypridemou 2020-09-09

Log in to post a comment.