Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

returned non-zero exit status 1 #36

Open
jocago opened this issue Aug 15, 2019 · 7 comments
Open

returned non-zero exit status 1 #36

jocago opened this issue Aug 15, 2019 · 7 comments

Comments

@jocago
Copy link

jocago commented Aug 15, 2019

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.

@netotz
Copy link

netotz commented Aug 29, 2019

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.

@nk9
Copy link

nk9 commented Sep 1, 2019

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.

@dreamflasher
Copy link

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

@herrdiener
Copy link

herrdiener commented Dec 18, 2019

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.

@niccottrell
Copy link

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.

marticliment added a commit to marticliment/pipupgrade that referenced this issue Apr 17, 2021
@marticliment
Copy link

except PopenError as e:

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
Copy link

Pull request created: #99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants