Closed Bug 1590953 Opened 6 years ago Closed 6 years ago

moz-phab self-upgrade errors if installed in a user directory.

Categories

(Conduit :: moz-phab, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emilio, Unassigned)

References

Details

(Keywords: conduit-triaged)

Attachments

(1 file)

I installed moz-phab using pip install --user MozPhab.

moz-phab self-update errors out like:

Collecting MozPhab
  Downloading https://files.pythonhosted.org/packages/a0/c8/e14bd6bb2c8856fa3cb3ee41864a8b40fb532f5f1c3293ae1a5963c664a1/MozPhab-0.1.54.tar.gz (52kB)
     |████████████████████████████████| 61kB 2.8MB/s 
Requirement already satisfied, skipping upgrade: setuptools in /usr/lib/python3.7/site-packages (from MozPhab) (41.2.0)
Installing collected packages: MozPhab
  Running setup.py install for MozPhab ... error
    ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-o4_877b0/MozPhab/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-qri55yxo/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_scripts
    creating build
    creating build/scripts-3.7
    copying and adjusting moz-phab -> build/scripts-3.7
    changing mode of build/scripts-3.7/moz-phab from 644 to 755
    running install_egg_info
    running egg_info
    writing MozPhab.egg-info/PKG-INFO
    writing dependency_links to MozPhab.egg-info/dependency_links.txt
    writing requirements to MozPhab.egg-info/requires.txt
    writing top-level names to MozPhab.egg-info/top_level.txt
    reading manifest file 'MozPhab.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'MozPhab.egg-info/SOURCES.txt'
    error: [Errno 13] Permission denied: '/usr/local/lib/python3.7'
    ----------------------------------------
ERROR: Command "/usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-o4_877b0/MozPhab/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-qri55yxo/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-o4_877b0/MozPhab/
CommandError: command 'pip3' failed to complete successfully

So I had to pip install --upgrade --user MozPhab myself.

The site package should help here:

>>> import site
>>> site.getuserbase()
'/home/byron/.local'

and on macOS:

>>> import site
>>> site.getuserbase()
'/Users/byron/Library/Python/3.7'
Keywords: conduit-triaged
Priority: -- → P2

I don't understand - what is the 'site' package, and how does it help me get around this error? I have never really used pip.

Flags: needinfo?(glob)

(In reply to Jim Blandy :jimb from comment #2)

I don't understand - what is the 'site' package, and how does it help me get around this error? I have never really used pip.

Ah, I wasn't clear - that was a hint to help address the issue in code, not an end-user action.

Flags: needinfo?(glob)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED

I had this problem as well. Do I understand it right that if I manually update now once to 1.59, then future updates will work?

Well, I think there is another issue here. The patch here changed from using pip3 to pip, and I need to use pip3 because pip is python2 in my installation.

(In reply to Simon Giesecke [:sg] [he/him] from comment #8)

Well, I think there is another issue here. The patch here changed from using pip3 to pip, and I need to use pip3 because pip is python2 in my installation.

The patch changes it from the pip3 executable to the pip module, executed with the same python executable that started moz-phab. ie. /path/to/python3 -m pip ...

If you're still having problems please file a new bug with details.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: