error message recommending incorrect setting of PYTHONPATH

Bug #205230 reported by Kiri
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Martin Pool

Bug Description

An error message tells the user to set PYTHONPATH to contain the bzrlib directory. That value does not function. The correct setting of PYTHONPATH is so that it contains the directory containing the bzrlib directory.

To reproduce, extract a bzr archive. In this example, to /usr/local/Bazaar
Hard link the bzr to a bin directory in PATH. As in
$ ln /usr/local/Bazaar/bzr /usr/local/bin
Run a bzr command.

$ bzr init-repo
bzr: ERROR: Couldn't import bzrlib and dependencies.
Please check bzrlib is on your PYTHONPATH.

Traceback (most recent call last):
  File "/usr/local/bin/bzr", line 64, in ?
    import bzrlib
ImportError: No module named bzrlib

This error occurs even when PYTHONPATH is set to the bzrlib directory, as
export PYTHONPATH=/usr/local/Bazaar/bzrlib

Revision history for this message
Jakob (jakobsybren) wrote :

The PYTHONPATH should not be set to the actual bzrlib directory. Python looks for a file bzrlib.py OR a directory named bzrlib/ (usually containing a __init__.py) INSIDE the PYTHONPATH. Clearly it doesn't find such a thing. The following should work:
export PYTHONPATH=/usr/local/Bazaar

Revision history for this message
Martin Pool (mbp) wrote :

I've changed it to this::

    sys.stderr.write("bzr: ERROR: "
        "Couldn't import bzrlib and dependencies.\n"
        "Please check the directory containing bzrlib is on your PYTHONPATH.\n"
        "\n")

Is that clearer?

Changed in bzr:
assignee: nobody → mbp
importance: Undecided → Low
status: New → Confirmed
Martin Pool (mbp)
Changed in bzr:
status: Confirmed → Fix Committed
Revision history for this message
Kiri (kiri) wrote :

Yes.

Jelmer Vernooij (jelmer)
Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.