Frage

Beim Versuch, Mercurial zu starten (hg) nach einem Neustart in meinem Ubuntu 9.10 Linux Box Ich habe folgende Meldung:

      abort: couldn't find mercurial libraries in [/usr/bin /usr/local/lib/python2.6/dist-packages/vipy-0.4-py2.6.egg /usr/local/lib/python2.6/dist-packages/nose-0.11.1-py2.6.egg /usr/local/lib/python2.6/dist-packages/rope-0.9.2-py2.6.egg /usr/local/lib/python2.6/dist-packages/Sphinx-0.6.3-py2.6.egg /usr/local/lib/python2.6/dist-packages/django_html-0.0.1-py2.6.egg /usr/local/lib/python2.6/dist-packages/html5lib-0.11.1-py2.6.egg /home/kenny /home/kenny/Projects/soclone-read-only /home/kenny/python/Django /home/kenny/python/pysmell /home/kenny/python/Django/ropemode /home/kenny/python/Django/rope /home/kenny/python/lib /usr/lib/python2.6 /usr/lib/python2.6/plat-linux2 /usr/lib/python2.6/lib-tk /usr/lib/python2.6/lib-old /usr/lib/python2.6/lib-dynload /usr/local/lib/python2.6/dist-packages]

      (check your install and PYTHONPATH)

Mysteriously andere Python-Programme nicht finden, ihre Module, einschließlich django-admin, bzr, aber überraschend den Python-Interpreter selbst startet.

Hier können Sie meine aktuellen sys.path finden:

  ['', '/usr/local/lib/python2.6/dist-packages/vipy-0.4-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/nose-0.11.1-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/rope-0.9.2-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/Sphinx-0.6.3-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/django_html-0.0.1-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/html5lib-0.11.1-py2.6.egg', '/home/kenny', '/home/kenny/Projects/soclone-read-only', '/home/kenny/python/Django', '/home/kenny/python/pysmell', '/home/kenny/python/Django/ropemode', '/home/kenny/python/Django/rope', '/home/kenny/python/lib', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/dist-packages']

Wer weiß, wie dieses Problem zu lösen?

Ich weiß, das keine Programmierung Frage in bestimmten, aber es nicht zulässt, mich zu programmieren, so dass ich bitte um Verständnis!

Vielen Dank im Voraus.

War es hilfreich?

Lösung

Versuchen Sie folgendes:

update-Python-Module -p

(vielleicht auf sudo müssen, dass ...) Quelle: http://hg.opensource.lshift.net/mercurial-server/rev/32dba1a70a54

Andere Tipps

Alle Seiten, die ich für diese gegoogelt habe sagen, dass Ihr PYTHONPATHis falsch eingestellt. Der Code, den Sie in Mercurial schlagen scheint dies zu sein:

try:
    from mercurial import demandimport; demandimport.enable()
except ImportError:
    import sys
    sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
                     ' '.join(sys.path))
    sys.stderr.write("(check your install and PYTHONPATH)\n")
    sys.exit(-1)

Also, wo auf Ihrem Rechner demandimport? Auf meiner Windows-Box ist es hier:

>>> from mercurial import demandimport
>>> demandimport.__file__
'C:\\Python26\\lib\\site-packages\\mercurial-1.4.1-py2.6-win32.egg\\mercurial\\demandimport.pyc'

Und das funktioniert, weil ich in meinem PYTHONPATH Mercurial haben:

>>> import sys
>>> for s in sys.path:
...     print s
...
# Other crud deleted...
C:\Python26\lib\site-packages\mercurial-1.4.1-py2.6-win32.egg
C:\Windows\system32\python26.zip
C:\Python26\DLLs
C:\Python26\lib
C:\Python26\lib\plat-win
C:\Python26\lib\lib-tk
C:\Python26
C:\Python26\lib\site-packages

Ihre PYTHONPATH nicht die Rede von Mercurial. Bei einer Vermutung, ich möchte hinzufügen, diese zu Ihrem PYTHONPATH:

/usr/local/lib/python2.6/site-packages

, und ich würde wieder installieren Mercurial von make. Dieser Rat hat gut funktioniert hier .

Edit: Und auf meinem Ubuntu 9.10 Box, ich habe diese Ergebnisse:

>>> import mercurial
>>> mercurial.__file__
'/usr/lib/pymodules/python2.6/mercurial/__init__.pyc'
>>> import sys
>>> for s in sys.path:
...     print s
...

/usr/local/lib/python2.6/dist-packages/pip-0.6.1-py2.6.egg
/usr/local/lib/python2.6/dist-packages/virtualenv-1.4.3-py2.6.egg
/usr/lib/python2.6
/usr/lib/python2.6/plat-linux2
/usr/lib/python2.6/lib-tk
/usr/lib/python2.6/lib-old
/usr/lib/python2.6/lib-dynload
/usr/lib/python2.6/dist-packages
/usr/lib/python2.6/dist-packages/PIL
/usr/lib/python2.6/dist-packages/gst-0.10
/usr/lib/pymodules/python2.6
/usr/lib/python2.6/dist-packages/gtk-2.0
/usr/lib/pymodules/python2.6/gtk-2.0
/usr/local/lib/python2.6/dist-packages
/usr/local/lib/python2.6/dist-packages/PIL

Und das macht ich denke, das Problem ist, dass dies für Dich fehlt. /usr/lib/pymodules/python2.6

Ist Mercurial in einer der Bibliothek Installationspfade (dist-packages oder site-packages) liegt Sie können das find Tool um es zu suchen?

Haben Sie Glück kleine Bibliotheken zu installieren und greifen Sie von Python auf dieser Maschine?

Danke für die Mühe zu allen von Ihnen.

Ich habe das Problem dank gelöst hughdbrown . hughdbrown, haben Sie machte mir klar, dass ich einen Tippfehler begangen, wenn dabei $ PYTHONPATH definieren; statt den Pfad Hinzufügen / usr / lib / pymodules / python2.6 , schrieb ich / usr / lib / pymodules / so Python nicht die Bibliotheken ... Allerdings importieren könnte, korrigierte ich es und ich ist froh, Mercurial und Co. zu sehen wieder funktionieren.

Das einzige Merkwürdige ist, warum es ... Nun verändert, werde ich ab jetzt zu wissen, was zu tun ist.

Sie könnten versuchen, die betroffenen Python-Programme mit aptitude neu zu installieren:

sudo aptitude reinstall mercurial
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top