Note that there are some explanatory texts on larger screens.

plurals
  1. POPython script is loading modules from old Python installation
    primarykey
    data
    text
    <p>I'm executing sphinx-build to transform some rst files to html. But I get an error because the script it's trying to import modules from an old Python installation.</p> <p>My environment:</p> <ul> <li>Mac OS X 10.6.8 </li> <li>Python 2.7 installed from <a href="http://python.org/" rel="nofollow">Python official website</a></li> <li>Python 2.6 included in the system</li> </ul> <p>The command executed is:</p> <pre><code>sphinx-build -b html -d _build/doctrees . _build/html </code></pre> <p>And the error text is as follows</p> <pre><code>Traceback (most recent call last): File "/usr/local/bin/sphinx-build", line 5, in &lt;module&gt; from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 2556, in &lt;module&gt; """ File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 620, in require ``resolve()`` method. The `fallback` flag indicates whether we should File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 518, in resolve yield self.by_key[key] pkg_resources.DistributionNotFound: Jinja2&gt;=2.3 make: *** [html] Error 1 </code></pre> <p>I'm pretty sure I have Jinja 2.6 installed. The problem is it's installed for Python 2.7, and the sphinx-build.py script is, somehow, using the Python 2.6 modules directory (you can see the path to Python 2.6 directory in the error text).</p> <p>My doubt is: why is the script searching in that directory? Some facts</p> <ul> <li>I didn't define PYTHONPATH variable, and if I just load python interpreter and print sys.path, I get all the directories belonging to Python 2.7. Not a single mention to Python 2.6 directories. </li> <li>There isn't a .pth file including directories of Python 2.6 in my working directory</li> </ul> <p>So, what I'm missing? Why is Python 2.7 looking in directories of Python 2.6? </p> <p><strong>UPDATE</strong>: Looks like sphinx-build was built using Python2.6. I deleted it, but now I can't get it back. I've installed Sphinx and docutils, but sphinx-build is not installed :-(. Any clues?</p> <p>Many thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload