System: Win 7 Pro x64; Tulip 4.2
I can successfully write Python code using the Tulip Python IDE. Now I am trying to write some Tulip modules in Python directly. I have updated the PATH and PYTHONPATH variables to include
C:\Program Files (x86)\Tulip\bin\python
and rebooted the machine.
According to the Poster at http://hal.archives-ouvertes.fr/docs/00/74/49/69/ANNEX/EuroSciPy2012-TulipPython-Poster.pdf, accessing the Tulip module should be straightforward. That poster states:
Tulip bindings can be used through the classical
Python shell (script and interactive mode)
and give access to all graph algorithms and
visualizations available in Tulip.
Importing, customizing and visualizing a net-
work can be done in a few lines of code, as
illustrated by the snippet below which creates
a visualization of the Python 2.7 library folder.
>>> from tulip import *
>>> from tulipgui import *
# Call the File System import plugin on the Python 2.7 library folder
>>> params == tlp.DataSet()
>>> params["dir::directory"] == "/usr/lib/python2.7"
>>> graph == tlp.importGraph("File System Directory", params)
# Set nodes labels to filenames
# Draw the graph
>>> graph.applyLayoutAlgorithm("Bubble Tree", graph["viewLayout"])
# Visualize the graph
>>> view == tlp.addNodeLinkDiagramView(graph)
>>> rp == view.getRenderingParameters()
I tried to import tulip both from the Python shell and in interactive mode in a cmd window with the same result -- DLL load failed: The specified module could not be found. I confirmed that tulip.pyd is indeed in the correct subdirectory, so I'm at a bit of a loss.
Any guidance/assistance would be very much appreciated. I suspect that I have not properly told Python where to look, but outside of the path parameters mentioned above, I don't know what else to set.
I have the same problem using tulip in eclipse.
The exact error message is:
'from tulip import *
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.'
Thanks in advance
I have an update on my problem. I use PyCharm as an IDE, and can not import tulip into it. I reported this to the support group at PyCharm, and they have concluded the following:
It seems that this library is not intended to be used outside of its main program.
You can file a feature request for Tulip support in PyCharm, since this library/tool
requires special handling.
Is it possible that something is missing from the pyd file that keeps it from working outside of Tulip?
Fwiw, below is what I get when I try to import the tulip file in the 2.7.2 interpreter. I printed out the PYTHONPATH first to confirm that it does indeed include the location of tulip.pyd.
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', 'C:\\Program Files (x86)\\Tulip\\bin\\python', 'C:\\Python27\\Lib\\idlelib', 'C:\\ C:\\Windows\\system32\\python27.zip', 'C:\\ C:\\Python27\\DLLs', 'C:\\ C:\\Python27\\lib', '
C:\ C:\Python27\lib\plat-win', 'C:\ C:\Python27\lib\lib-tk', 'C:\ C:\Python27', 'C:\ C:\Python27\lib\site-packages', 'C:\Windows\system32\python27.zip', 'C:\Pytho
n27\DLLs', 'C:\Python27\lib', 'C:\Python27\lib\plat-win', 'C:\Python27\lib\lib-tk', 'C:\Python27', 'C:\Python27\lib\site-packages', 'C:\Python27\lib\site-packages\
>>> import tulip
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
Any help/advice/assistance would be greatly appreciated.
Hello all -
I know I wrote the OP months ago, but I'm still stuck. I've updated to Tulip 4.3 and Python 2.7.5.
I've read (and reread) the instructions under the heading "Using the bindings from the Python Interpreter" at
but cannot get any interpreter to import the Tulip bindings. I've tried both PyCharm and IPython.
Has anyone been successful doing this? I'm at a dead end.
I realize I forgot to include the error message I get when trying to import Tulip. Perhaps this will be informative. Thanks.
ImportError Traceback (most recent call last)
<ipython-input-3-ddc20e9424a5> in <module>()
----> 1 import tulip
ImportError: DLL load failed: %1 is not a valid Win32 application.
I just tried to import the tulip module from a fresh Tulip 4.3 install
and it works fine for me (using classical Python shell, PyCharm or IPython).
There is only one issue with Python IDLE (module can be imported but it overrides the standard output so nothing is displayed after, fixed in the latest Tulip source code on sourceforge).
However the tulipogl and tulipgui module does not seem to work under windows (seems that they were linked against the wrong Python version, I don'k know why, I am not the person that builds the Tulip releases ...)
Be sure that you are using the 32 bits version of the Python interpreter. One another possible reason of your issue is that your PATH variable contains the location of some DLLs Tulip depends on (for instance zlib or Qt4) but compiled for a different architecture (typically 64 bits instead of 32 bits).
Try to issue the following commands in a cmd.exe
C:...> set PATH=C:/Python27/:C:/Program Files (x86)/tulip/bin:%PATH% (assuming C:/Python27/ is the 32bits Python install directory)
C:...> set PYTHONPATH=C:/Program Files (x86)/tulip/bin/python
from tulip import *
from tulip import *
from tulip import *
from tulip import *
If the module can be imported, it means that there is some DLL conflicts coming from the content of your PATH variable.
Hope that it will help,
I helped Monarchi and I helped him find that he was using the wrong word size for the interpreter; the libraries and his interpreter were different 32/64 bit widths.
Adam was correct wrt 64 vs 32 bit versions of Python (thanks for the time you spent with me on this, Adam), but his insight did not solve the problem. The confusion was my fault. I was trying to do too many things at once on too many computers and had inadvertently tried to import Tulip into 64-bit Anaconda on one of them. Adam pointed out to me that this simply wouldn't work. (Yes, I felt a bit foolish afterwards... I actually knew better than to do this.)
Just to be safe, I completely uninstalled Python, deleted all of the directories, etc., and then re-installed the 32-bit version of 2.7.5. I then went through the instructions Antoine posted (thank you, Antoine).
The result is the same as before: DLL load failed: The specified module could not be found.
As Antoine stated at the end of his post, perhaps some of the DLLs on which Tulip depends are from a different architecture. He listed two: zlib and Qt4. Is there a list of all of the dependencies somewhere, and can anyone tell me how I can determine whether the DLLs in question were compiled for 32-bit or 64-bit architecture?
Thank you all very much for your patience.
Hello again -
Following the advice I received from Antoine above and separately from Adam, I wrote a small PowerShell script and checked all of the dll and exe files in all of the subdirectories under Python27 and Tulip. All of them are 32-bit files.
Does anyone have any suggestions? (Short of building a fresh machine dedicated to Tulip. :-) )
Oh I thought you it was resolved. Jump on IRC and hang out in there. Ping me when can, and I'll jump in there again sometime.
I managed to get it working by copying all the dll files in bin to bin/python
Thanks for the tip, Olivier. I followed your suggestion, and the tulip module is now found by Python (specifically, PyCharm). The error I'm getting now is
the sip module implements API v8.0 but the tulip module requires API v9.0
I downloaded sip 4.15.3, assuming it would contain the latest API implementation. And following a suggestion Adam gave me in an IRC conversation I downloaded and installed MinGW so I could execute the make command. MinGW seems to have installed fine, but make fails when used with the makefile in the sip-4.15.3 directory.
Rather than pursue this approach any further, I thought I would download the latest version of PyQt for 2.7, which seems to be PyQt4-4.10.2-gpl-Py2.7-Qt4.8.4-x32, and install it. I assume that this would include the correct implementation of the API.
If you have any suggestions, I would be grateful to get them.
Again, thanks for the tip re copying the dll files!
I determined that I had PyQt4 4.8.1 installed, so I went ahead and installed PyQt4-4.10.2-gpl-Py2.7-Qt4.8.4-x32. The error changed to
the sip module implements API v10.0 but the tulip module requires API v9.0
so apparently the API implementations are not backward compatible or tulip is very picky.
My next step was to uninstall the 4.10.2 version and install the 4.9.4 version (PyQt-Py2.7-x86-gpl-4.9.4-1) hoping that this would have API I need. After this installation, I was back to the original error
the sip module implements API v8.0 to v8.1 but the tulip module requires API v9.0
At this point my question is - does anyone know which version of PyQt4 I should install in order to have the correct API version?
Thanks in advance for any assistance/advice.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.