pipupgrade icon indicating copy to clipboard operation
pipupgrade copied to clipboard

returned non-zero exit status 1

Open jocago opened this issue 5 years ago • 7 comments

Ran pipupgrade --latest

Python 3.6 on macOS 10.14.6 (18G87)

Traceback (most recent call last): File "/anaconda3/bin/pipupgrade", line 10, in sys.exit(main()) File "/anaconda3/lib/python3.6/site-packages/pipupgrade/cli/init.py", line 14, in wrapper return fn(**params) File "/anaconda3/lib/python3.6/site-packages/pipupgrade/commands/init.py", line 260, in command _pip.call("install", package.name, pip_exec = package.source, user = user, quiet = not verbose, no_cache_dir = True, upgrade = True) File "/anaconda3/lib/python3.6/site-packages/pipupgrade/_pip.py", line 69, in call return popen(*params, output = True) File "/anaconda3/lib/python3.6/site-packages/pipupgrade/util/system.py", line 70, in popen raise sp.CalledProcessError(code, command) subprocess.CalledProcessError: Command '/anaconda3/bin/pip install normality --quiet --no-cache-dir --upgrade' returned non-zero exit status 1.

jocago avatar Aug 15 '19 16:08 jocago

Same for Windows 10, python 3 64 bits

C:\WINDOWS\system32>pipupgrade

[0;93mChecking...[0m
Traceback (most recent call last):
  File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python37\Scripts\pipupgrade.exe\__main__.py", line 9, in <module>
  File "c:\program files\python37\lib\site-packages\pipupgrade\cli\__init__.py", line 14, in wrapper
    return fn(**params)
  File "c:\program files\python37\lib\site-packages\pipupgrade\commands\__init__.py", line 178, in command
    format = "json", pip_exec = pip_)
  File "c:\program files\python37\lib\site-packages\pipupgrade\_pip.py", line 69, in call
    return popen(*params, output = True)
  File "c:\program files\python37\lib\site-packages\pipupgrade\util\system.py", line 70, in popen
    raise sp.CalledProcessError(code, command)
subprocess.CalledProcessError: Command 'C:\Program Files\Python37\Scripts\pip.exe list --outdated --format json' returned non-zero exit status 1.

netotz avatar Aug 29 '19 00:08 netotz

Similar issue for me. MacOS 10.14.6. It started out OK, but then died when trying to update GDAL.

Source: Installed Distributions (/usr/local/bin/pip2)

Name             Current Version Latest Version Home Page                                  
---------------- --------------- -------------- -------------------------------------------
arrow            0.13.1          0.14.6         https://arrow.readthedocs.io               
certifi          2019.3.9        2019.6.16      https://certifi.io/                        
Flask            1.0.2           1.1.1          https://palletsprojects.com/p/flask/       
Flask-SQLAlchemy 2.3.2           2.4.0          https://github.com/pallets/flask-sqlalchemy
futures          3.2.0           3.3.0          https://github.com/agronholm/pythonfutures 
GDAL             2.4.0           3.0.1          http://www.gdal.org                        
Jinja2           2.10            2.10.1         http://jinja.pocoo.org/                    
pip              19.2.2          19.2.3         https://pip.pypa.io/                       
poyo             0.4.2           0.5.0          https://github.com/hackebrot/poyo          
requests         2.21.0          2.22.0         http://python-requests.org                 
setuptools       40.8.0          41.2.0         https://github.com/pypa/setuptools         
SQLAlchemy       1.3.0           1.3.8          http://www.sqlalchemy.org                  
urllib3          1.24.1          1.25.3         https://urllib3.readthedocs.io/            
Werkzeug         0.14.1          0.15.5         https://palletsprojects.com/p/werkzeug/    
wheel            0.33.1          0.33.6         https://github.com/pypa/wheel              
whichcraft       0.5.2           0.6.0          https://github.com/pydanny/whichcraft      

Do you wish to update 16 packages? [Y/n/q]: Y
Updating 1 of 16 packages: arrow
Updating 2 of 16 packages: certifi
Updating 3 of 16 packages: Flask
Updating 4 of 16 packages: Flask-SQLAlchemy
Updating 5 of 16 packages: futures
Updating 6 of 16 packages: GDAL
Traceback (most recent call last):
  File "/Users/nick/Projects/islington-planning/venv/bin/pipupgrade", line 10, in <module>
    sys.exit(main())
  File "/Users/nick/Projects/islington-planning/venv/lib/python3.7/site-packages/pipupgrade/cli/__init__.py", line 14, in wrapper
    return fn(**params)
  File "/Users/nick/Projects/islington-planning/venv/lib/python3.7/site-packages/pipupgrade/commands/__init__.py", line 260, in command
    _pip.call("install", package.name, pip_exec = package.source, user = user, quiet = not verbose, no_cache_dir = True, upgrade = True)
  File "/Users/nick/Projects/islington-planning/venv/lib/python3.7/site-packages/pipupgrade/_pip.py", line 69, in call
    return popen(*params, output = True)
  File "/Users/nick/Projects/islington-planning/venv/lib/python3.7/site-packages/pipupgrade/util/system.py", line 70, in popen
    raise sp.CalledProcessError(code, command)
subprocess.CalledProcessError: Command '/usr/local/bin/pip2 install GDAL --quiet --no-cache-dir --upgrade' returned non-zero exit status 1.

nk9 avatar Sep 01 '19 14:09 nk9

Ubuntu 19.04, with pip3 in anaconda.

Updating 5 of 24 packages: ruamel-yaml
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/multiprocessing/pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "/opt/conda/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/opt/conda/lib/python3.7/site-packages/pipupgrade/commands/helper.py", line 196, in update_registry
    _pip.call("install", package.name, pip_exec = package.source, user = user, quiet = not verbose, no_cache_dir = True, upgrade = True)
  File "/opt/conda/lib/python3.7/site-packages/pipupgrade/_pip.py", line 73, in call
    return popen(*params, output = output)
  File "/opt/conda/lib/python3.7/site-packages/pipupgrade/util/system.py", line 70, in popen
    raise sp.CalledProcessError(code, command)
subprocess.CalledProcessError: Command '/opt/conda/bin/pip install ruamel-yaml --no-cache-dir --upgrade' returned non-zero exit status 1.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/bin//pipupgrade", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.7/site-packages/pipupgrade/cli/__init__.py", line 14, in wrapper
    return fn(**params)
  File "/opt/conda/lib/python3.7/site-packages/pipupgrade/commands/__init__.py", line 131, in command
    registries
  File "/opt/conda/lib/python3.7/multiprocessing/pool.py", line 268, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/opt/conda/lib/python3.7/multiprocessing/pool.py", line 657, in get
    raise self._value
subprocess.CalledProcessError: Command '/opt/conda/bin/pip install ruamel-yaml --no-cache-dir --upgrade' returned non-zero exit status 1.

This should be improved in the following way:

  • provide the actual error
  • don't fail on upgrade error, but continue with the next package

dreamflasher avatar Nov 08 '19 14:11 dreamflasher

This should be improved in the following way:

  • provide the actual error
  • don't fail on upgrade error, but continue with the next package

@jocago, I suggest adding this to the issue text. This is the desired behaviour. A switch --skip-failures is not needed since the current behaviour (upgrade the packages that happen to be treated before the problematic one, but not the ones after) can be assumed to never be useful or currently relied on.

herrdiener avatar Dec 18 '19 14:12 herrdiener

I'm running pipupgrade 1.5.2 and get a similar error:

Updating 1 of 142 packages: appscript
Updating 2 of 20 packages: idna
Updating 3 of 20 packages: kiwisolver
Updating 4 of 20 packages: macholib
Updating 5 of 20 packages: matplotlib
Updating 6 of 20 packages: mtools
Updating 7 of 20 packages: numpy
Updating 8 of 20 packages: pip
Updating 9 of 20 packages: psutil
Updating 10 of 20 packages: pyelftools
Updating 11 of 20 packages: pymongo
Updating 12 of 20 packages: pyparsing
Updating 13 of 20 packages: python-dateutil
Updating 14 of 20 packages: PyYAML
Updating 15 of 20 packages: requests
Updating 16 of 20 packages: setuptools
Updating 17 of 20 packages: six
Updating 18 of 20 packages: tornado
Updating 19 of 20 packages: urllib3
Updating 20 of 20 packages: wheel
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/Users/nic/anaconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "/Users/nic/anaconda3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/Users/nic/anaconda3/lib/python3.7/site-packages/pipupgrade/commands/helper.py", line 196, in update_registry
    _pip.call("install", package.name, pip_exec = package.source, user = user, quiet = not verbose, no_cache_dir = True, upgrade = True)
  File "/Users/nic/anaconda3/lib/python3.7/site-packages/pipupgrade/_pip.py", line 73, in call
    return popen(*params, output = output)
  File "/Users/nic/anaconda3/lib/python3.7/site-packages/pipupgrade/util/system.py", line 70, in popen
    raise sp.CalledProcessError(code, command)
subprocess.CalledProcessError: Command '/Users/nic/anaconda3/bin/pip install appscript --no-cache-dir --upgrade' returned non-zero exit status 1.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/nic/anaconda3/bin/pipupgrade", line 10, in <module>
    sys.exit(main())
  File "/Users/nic/anaconda3/lib/python3.7/site-packages/pipupgrade/cli/__init__.py", line 14, in wrapper
    return fn(**params)
  File "/Users/nic/anaconda3/lib/python3.7/site-packages/pipupgrade/commands/__init__.py", line 131, in command
    registries
  File "/Users/nic/anaconda3/lib/python3.7/multiprocessing/pool.py", line 268, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/Users/nic/anaconda3/lib/python3.7/multiprocessing/pool.py", line 657, in get
    raise self._value
subprocess.CalledProcessError: Command '/Users/nic/anaconda3/bin/pip install appscript --no-cache-dir --upgrade' returned non-zero exit status 1.

niccottrell avatar Jan 06 '20 11:01 niccottrell

https://github.com/achillesrasquinha/pipupgrade/blob/392ead70df830802a8eeb04cf21bab3f883e9a2d/src/pipupgrade/commands/helper.py#L307

This happens because on line 308 on the file /src/pipupgrade/commands/helper.py an exception is raised if subprocess.Popen returns non-0 value. So, the solution would be adding something like:

except PopenError as e: 
    if(type(e) == subprocess.CalledProcessError):
        print(f"Non-zero value returned by pip while updating {package.name}")
    elif raise_err:
        raise

I'll create a pull request (If I find how).

marticliment avatar Apr 17 '21 13:04 marticliment

Pull request created: #99

marticliment avatar Apr 17 '21 14:04 marticliment