"ImportError: No module named mkdocs" but I can import it
Hello, I'm trying to switch an opensource project from setup(scripts=) to setup(entry_points=dict(console_scripts=)) to enable Windows support for its executable script. If you are feeling generous, you can download my changes and attempt to run them from this branch: https://github.com/edbrannin/mkdocs/tree/windows-runnable Zip version: https://github.com/edbrannin/mkdocs/archive/windows-runnable.zip When I run "python setup.py install", it installs the mkdocs module to lib/site-packages/mkdocs and I can import it from a Python shell, but when I run the "mkdocs" command I get this error: C:\>mkdocs Traceback (most recent call last): File "C:\Python27\Scripts\mkdocs-script.py", line 9, in <module> load_entry_point('mkdocs==0.9', 'console_scripts', 'mkdocs')() File "C:\Python27\lib\site-packages\distribute-0.6.34-py2.7.egg\pkg_resources.py", line 343, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "C:\Python27\lib\site-packages\distribute-0.6.34-py2.7.egg\pkg_resources.py", line 2307, in load_entry_point return ep.load() File "C:\Python27\lib\site-packages\distribute-0.6.34-py2.7.egg\pkg_resources.py", line 2013, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) ImportError: No module named mkdocs There are more details at this StackOverflow question: http://stackoverflow.com/q/24067318/25625 What am I doing wrong here? Thank you for reading this far, -Ed Brannin edbrannin@gmail.com cell: 585-261-0279 P.S. For the archives, the exact code revision I'm having trouble with is at https://github.com/edbrannin/mkdocs/tree/b924f2e09e511e8bda35465bc0e103a3401... P.P.S. I had tried to send this earlier, before I'd subscribed to the list. Sorry if both copies of this email eventually get delivered.
On 06 Jun 2014, at 21:30, edbrannin@gmail.com wrote:
When I run "python setup.py install", it installs the mkdocs module to lib/site-packages/mkdocs and I can import it from a Python shell, but when I run the "mkdocs" command I get this error:
C:\>mkdocs Traceback (most recent call last): File "C:\Python27\Scripts\mkdocs-script.py", line 9, in <module> load_entry_point('mkdocs==0.9', 'console_scripts', 'mkdocs')() File "C:\Python27\lib\site-packages\distribute-0.6.34-py2.7.egg\pkg_resources.py", line 343, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "C:\Python27\lib\site-packages\distribute-0.6.34-py2.7.egg\pkg_resources.py", line 2307, in load_entry_point return ep.load() File "C:\Python27\lib\site-packages\distribute-0.6.34-py2.7.egg\pkg_resources.py", line 2013, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) ImportError: No module named mkdocs
mkdocs/mkdocs is not a .py file. Try renaming that to mkdocs/mkdocs.py . Your import test did not try to import the exact same thing as the console script uses: that uses mkdocs.mkdocs.main_entry_point, and you only tried to import the upper mkdocs package. Wichert.
participants (2)
-
edbrannin@gmail.com
-
Wichert Akkerman