From: Dirk v. O. IR l. <la...@ix...> - 2009-04-15 15:09:27
|
Hi All, I updated my markdown (from an old version, when I was still running python 2.5 and mac 10.4) to the latest 2.0 release. But I ran into a problem when I tried to 'import markdown' from the interpreter: ImportError: cannot import name COMMAND_LINE_LOGGING_LEVEL After a long hard search (my knowledge and understanding of how python modules, init files and the pythonpath work is rather limited), I found the culprit cause: The installer (which runs through 'easy_install markdown', or through 'sudo python setup.py install'), installs a command line version of markdown, called markdown.py in the bin. On my mac it installs this command line version markdown.py in / Library/Frameworks/Python.framework/Versions/2.6/bin On a freebsd machine it installs in in /usr/local/bin The problem is that this bin directory is present in my sys.path as well as in my $PATH The latter is obviously on purpose: the command line executable should be on my $PATH to be able to run it in the command line. However, since that bin is also included in python's sys.path, my guess is that every attempt to 'import markdown' or 'from markdown import ...' will import that command line version, and not the __init__.py in the site-packages/markdown/ (I don't know why or how I could prevent this the inclusion of this bin in my sys.path) My quick fix was to rename that command line version into something else or to move the markdown.py to somewhere where it can be found on the $PATH, but not in sys.path. Just to report my findings. And maybe somebody could improve the installer, explain me what I was doing wrong or update the installation documentation. best dirk -- ----------------------------- Dirk van Oosterbosch de Wittenstraat 225 1052 AT Amsterdam the Netherlands http://labs.ixopusada.com ----------------------------- -- |