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

_pip install_ broken beyond normal repair by Jupyter Notebook Extensions (AttributeError: _DistInfoDistribution__dep_map) #5839

Open
mirekphd opened this Issue Oct 1, 2018 · 17 comments

Comments

Projects
None yet
6 participants
@mirekphd
Copy link

mirekphd commented Oct 1, 2018

Environment

OS: Ubuntu 16.04 (nvidia/cuda:8.0-cudnn6-devel)

Python version: 3.6.5

Conda version:
conda 4.5.10

Pip version:
pip 18.0

Description
Pip install stopped working during docker build of a complex docker container (based on Kaggle/docker-python) and it cannot be repaired by simple methods such as reinstalling / downgrading with pip itself, with conda or a Miniconda script, unless you change the default installation location (/opt/conda) to an alternative folder when using Minconda script to re-install pip (effectively moving all subsequent libraries installs with pip to a separate location). Note that pip uninstall still works (and can be used to remove pip - apparently not effectively enough).

Expected behavior
pip install should be working even in these conditions, i.e. . pip install scipy should succeed regardless of the complexity of the installation.

How to Reproduce
I managed to make it reproducible by providing a functional but only partially completed docker container produced by docker build just before the error occured (I verified that it is reproducible on two different servers).

The bug can be reproduced by executing pip install in bash in this archived docker image that captures this bug (no login requried):

docker pull mirekphd/tst-ml-gpu-py36-cuda8-failing:001766c55ca8
docker run -it --rm --name test -u 0 mirekphd/tst-ml-gpu-py36-cuda8-failing:001766c55ca8 bash
pip install scipy

Possible causes
The last completed operation during build and hence the possible culprit was Jupyter Notebook (or Notebook Extensions) installation with conda (the only installer that makes Jupyter Notebook Extensions work in Jupyter Notebook - pip installation made earlier did not suffice). When I moved Jupyter (Notebook, Lab and Notebook Extensions) installation to the end of the build process (i.e. after all other libraries), the build completed and all libraries can be loaded (from a single standard location in /opt/conda). However, Jupyter section was once again the last one to succeed with pip install, and pip still gets broken, raising the same error (which can be even considered a feature not a bug as it helps maintain library / ML models reproducibility:). I also notice that the same error is raised by pip show and pipdeptree (e.g. !pipdeptree --reverse --packages xgboost) but not by pip freeze.

An intial workaround
A complex but universal workaround I found was to change the pip installation location into an alternative folder when using Miniconda script to re-install pip.

Dockerfile excerpt that repairs this issue and allows the build to succeed:

# ARG MINICONDA_VER=4.5.4 # (same as defined above)
# ARG PIP_VER=18.0 # (same as defined above)
# define alternative pip location
ENV PIP_RESCUE_FOLDER=/tmp/opt/conda

RUN mkdir -p ${PIP_RESCUE_FOLDER} && cd ${PIP_RESCUE_FOLDER} && \
	# download Miniconda installation script including pip binary
	wget https://repo.continuum.io/miniconda/Miniconda3-${MINICONDA_VER}-Linux-x86_64.sh && \
	# note we install pip (and entire Miniconda) in the secondary location by specifying the "prefix folder",
	# using parameter -p (hence PREFIX=/tmp/opt/conda and not /opt/conda as it is usually done)
	/bin/bash Miniconda3-${MINICONDA_VER}-Linux-x86_64.sh -f -b -p ${PIP_RESCUE_FOLDER} && \
	# /tmp/opt/conda/bin/pip --version
	# pip 10.0.1 from /tmp/opt/conda/lib/python3.6/site-packages/pip (python 3.6)
	# update secondary pip to the desired version
	/tmp/opt/conda/bin/pip install --upgrade pip==${PIP_VER} && \
	# overwrite pip in primary location with the one just installed into secondary one
	cp /tmp/opt/conda/bin/pip /opt/conda/bin && \
	cp -R /tmp/opt/conda/lib/python3.6/site-packages/pip /opt/conda/lib/python3.6/site-packages

# to make the libraries installed by secondary pip (into the pip rescue folder) work in python
# we need to add this secondary bin folder to PATH
ENV PATH=$PIP_RESCUE_FOLDER/bin:$PATH
# to verify it works:
# $python
# >>> import openshift as oc
# >>> oc
# <module 'openshift' from '/tmp/opt/conda/lib/python3.6/site-packages/openshift/__init__.py'>

Output

The expected error message is:

root@2dba6ccb6b94:/# pip install scipy --no-cache-dir
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Requirement already satisfied: numpy>=1.8.2 in /opt/conda/lib/python3.6/site-packages (from scipy) (1.15.2)
Exception:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in _dep_map
    return self.__dep_map
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2663, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1632, in parseString
    raise exc
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1622, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3183, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2949, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'; extra '"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 141, in main
    status = self.run(options, args)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 330, in run
    self._warn_about_conflicts(to_install)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 456, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 98, in check_install_conflicts
    package_set = create_package_set_from_installed()
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 41, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2607, in requires
    dm = self._dep_map
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2871, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2881, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in parse_requirements
    yield Requirement(line)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2951, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'; extra '"
root@2dba6ccb6b94:/# 

@mirekphd mirekphd changed the title _pip install_ broken beyond normal repair (AttributeError: _DistInfoDistribution__dep_map) _pip install_ broken beyond normal repair by Jupyter Notebook or its Extensions (AttributeError: _DistInfoDistribution__dep_map) Oct 1, 2018

@mirekphd

This comment has been minimized.

Copy link
Author

mirekphd commented Oct 1, 2018

The culprit that broke pip install was not Jupyter Notebook itself (already installed successfully using pip earlier in the build sequence), but its Extensions / Configurator installed with conda (!) in the versions specified below:

# Jupyter notebook extensions
# caution: Jupyter notebook has to be pinned, because Jupyter notebook extensions 
# not always work with latest versions of notebook
# pin Jupyter Notebook
ARG NB_VER=5.6.0                    
# pin Jupyter notebook extensions
ARG NB_EXT_VER=0.5.0
# pin Jupyter notebook extensions configurator
ARG NB_EXT_CFG_VER=0.4.0

# caution: jupyter notebook extensions do not work unless installed with conda (pip does not suffice)
RUN conda install -c conda-forge notebook=${NB_VER} \ 
jupyter_contrib_nbextensions=${NB_EXT_VER} \ 
jupyter_nbextensions_configurator=${NB_EXT_CFG_VER} 

Note that not installing these extensions (which prevents pip from breaking down) is not the same as simply uninstalling them (which does not work - if these extensions are installed even once, pip gets broken beyond repair). If that breakage happened outside boundaries of an isolated container environment, it would be pretty serious.

@mirekphd mirekphd changed the title _pip install_ broken beyond normal repair by Jupyter Notebook or its Extensions (AttributeError: _DistInfoDistribution__dep_map) _pip install_ broken beyond normal repair by Jupyter Notebook Extensions (AttributeError: _DistInfoDistribution__dep_map) Oct 1, 2018

@takluyver

This comment has been minimized.

Copy link
Member

takluyver commented Oct 2, 2018

It looks like #3704 fixed a similar issue for pip freeze, but this error is coming from the new functionality that checks all installed packages on every pip install. I think a similar try/except is needed around this line:

package_set[name] = PackageDetails(dist.version, dist.requires())

I'd also say that the whole check operation should be try/excepted, because bugs in that shouldn't cause pip install to blow up. I think this would be the relevant line:

package_set, _dep_info = check_install_conflicts(to_install)

I think it's a bug in Flit causing at least some of these problems - sorry about that, and hopefully I've got it fixed now. But clearly an installed package with broken metadata shouldn't break pip like this.

@takluyver

This comment has been minimized.

Copy link
Member

takluyver commented Oct 2, 2018

I've had a go at fixing this in #5842 .

@Juanlu001

This comment has been minimized.

Copy link

Juanlu001 commented Oct 2, 2018

I've found this particular issue in older versions of pip as well, including 10 and 9.

leloup314 added a commit to SiLab-Bonn/irrad_spectroscopy that referenced this issue Oct 5, 2018

malinajiang added a commit to malinajiang/dataproc-initialization-actions that referenced this issue Oct 5, 2018

Update jupyter.sh to set testpath<0.4
Open issue (pypa/pip#5839) causes pip install to fail with the following message --

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1632, in parseString
    raise exc
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1622, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3183, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'; extra '"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 291, in run
    resolver.resolve(requirement_set)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/resolve.py", line 103, in resolve
    self._resolve_one(requirement_set, req)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/resolve.py", line 307, in _resolve_one
    set(req_to_install.extras) - set(dist.extras)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2819, in extras
    return [dep for dep in self._dep_map if dep]
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2864, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2874, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2935, in parse_requirements
    yield Requirement(line)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2944, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'; extra '"

Issue can (temporarily) be circumvented by running

conda install 'testpath<0.4'

mikaylakonst added a commit to GoogleCloudPlatform/dataproc-initialization-actions that referenced this issue Oct 5, 2018

Update jupyter.sh to set testpath<0.4 (#362)
Open issue (pypa/pip#5839) causes pip install to fail with the following message --

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1632, in parseString
    raise exc
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1622, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3183, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'; extra '"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 291, in run
    resolver.resolve(requirement_set)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/resolve.py", line 103, in resolve
    self._resolve_one(requirement_set, req)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/resolve.py", line 307, in _resolve_one
    set(req_to_install.extras) - set(dist.extras)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2819, in extras
    return [dep for dep in self._dep_map if dep]
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2864, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2874, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2935, in parse_requirements
    yield Requirement(line)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2944, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'; extra '"

Issue can (temporarily) be circumvented by running

conda install 'testpath<0.4'
@mirekphd

This comment has been minimized.

Copy link
Author

mirekphd commented Oct 6, 2018

An update: in my complex python environment upgrading to the the latest versions of all libraries that appeared since the original bug report (including pip 18.0->18.1 and testpath 0.4 -> 0.42) did not help - installing latest Jupyter+extensions+configurator breaks down pip beyond normal repair, although error messages are different this time. In simple environments such as jupyter/base-notebook this error would go unnoticed.

And it's not testpath's fault. If jupyter alone is installed (without extensions and configurator), than no version of testpath can break it (tried versions from 0.3.1. to 0.4.2).

More details

[root@mx01 ml-gpu-py36-cuda8]#  docker exec -it ml-gpu-py36-cuda8 bash
root@0d9fb3d3f1ff:~# conda install -y -c conda-forge notebook jupyter_contrib_nbextensions jupyter_nbextensions_configurator
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.10
  latest version: 4.5.11

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /opt/conda

  added / updated specs: 
    - jupyter_contrib_nbextensions
    - jupyter_nbextensions_configurator
    - notebook


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    libsodium-1.0.16           |       h470a237_1         536 KB  conda-forge
    mistune-0.8.3              |   py36h470a237_2         873 KB  conda-forge
    ipykernel-5.0.0            |     pyh24bf2e0_1          76 KB  conda-forge
    zeromq-4.2.5               |       hfc679d8_6         939 KB  conda-forge
    jupyter_core-4.4.0         |             py_0          44 KB  conda-forge
    pyzmq-17.1.2               |   py36hae99301_0         1.0 MB  conda-forge
    jinja2-2.10                |             py_1          89 KB  conda-forge
    entrypoints-0.2.3          |        py36_1002           9 KB  conda-forge
    html5lib-1.0.1             |             py_0          89 KB  conda-forge
    webencodings-0.5.1         |             py_1          12 KB  conda-forge
    terminado-0.8.1            |        py36_1001          23 KB  conda-forge
    notebook-5.7.0             |        py36_1000         7.3 MB  conda-forge
    testpath-0.4.2             |        py36_1000          91 KB  conda-forge
    jupyter_contrib_nbextensions-0.5.0|           py36_0        19.4 MB  conda-forge
    pandocfilters-1.4.2        |             py_1           9 KB  conda-forge
    jupyter_highlight_selected_word-0.2.0|        py36_1000          13 KB  conda-forge
    jupyter_nbextensions_configurator-0.4.0|           py36_0         470 KB  conda-forge
    jupyter_contrib_core-0.3.3 |             py_2          15 KB  conda-forge
    jupyter_latex_envs-1.4.4   |           py36_0         753 KB  conda-forge
    jsonschema-2.6.0           |        py36_1002          62 KB  conda-forge
    pandoc-2.3.1               |                0        20.7 MB  conda-forge
    lxml-4.2.5                 |   py36hc9114bc_0         6.0 MB  conda-forge
    send2trash-1.5.0           |             py_0          12 KB  conda-forge
    libxslt-1.1.32             |       h88dbc4e_2         511 KB  conda-forge
    prometheus_client-0.4.0    |             py_0          32 KB  conda-forge
    jupyter_client-5.2.3       |             py_1          59 KB  conda-forge
    bleach-3.0.0               |             py_0         108 KB  conda-forge
    nbconvert-5.3.1            |             py_1         320 KB  conda-forge
    nbformat-4.4.0             |             py_1          91 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        59.6 MB

The following NEW packages will be INSTALLED:

    bleach:                            3.0.0-py_0            conda-forge
    entrypoints:                       0.2.3-py36_1002       conda-forge
    html5lib:                          1.0.1-py_0            conda-forge
    ipykernel:                         5.0.0-pyh24bf2e0_1    conda-forge
    jinja2:                            2.10-py_1             conda-forge
    jsonschema:                        2.6.0-py36_1002       conda-forge
    jupyter_client:                    5.2.3-py_1            conda-forge
    jupyter_contrib_core:              0.3.3-py_2            conda-forge
    jupyter_contrib_nbextensions:      0.5.0-py36_0          conda-forge
    jupyter_core:                      4.4.0-py_0            conda-forge
    jupyter_highlight_selected_word:   0.2.0-py36_1000       conda-forge
    jupyter_latex_envs:                1.4.4-py36_0          conda-forge
    jupyter_nbextensions_configurator: 0.4.0-py36_0          conda-forge
    libsodium:                         1.0.16-h470a237_1     conda-forge
    libxslt:                           1.1.32-h88dbc4e_2     conda-forge
    lxml:                              4.2.5-py36hc9114bc_0  conda-forge
    mistune:                           0.8.3-py36h470a237_2  conda-forge
    nbconvert:                         5.3.1-py_1            conda-forge
    nbformat:                          4.4.0-py_1            conda-forge
    notebook:                          5.7.0-py36_1000       conda-forge
    pandoc:                            2.3.1-0               conda-forge
    pandocfilters:                     1.4.2-py_1            conda-forge
    prometheus_client:                 0.4.0-py_0            conda-forge
    pyzmq:                             17.1.2-py36hae99301_0 conda-forge
    send2trash:                        1.5.0-py_0            conda-forge
    terminado:                         0.8.1-py36_1001       conda-forge
    testpath:                          0.4.2-py36_1000       conda-forge
    webencodings:                      0.5.1-py_1            conda-forge
    zeromq:                            4.2.5-hfc679d8_6      conda-forge


Downloading and Extracting Packages
libsodium-1.0.16     | 536 KB    | #################################################################################################################################### | 100% 
mistune-0.8.3        | 873 KB    | #################################################################################################################################### | 100% 
ipykernel-5.0.0      | 76 KB     | #################################################################################################################################### | 100% 
zeromq-4.2.5         | 939 KB    | #################################################################################################################################### | 100% 
jupyter_core-4.4.0   | 44 KB     | #################################################################################################################################### | 100% 
pyzmq-17.1.2         | 1.0 MB    | #################################################################################################################################### | 100% 
jinja2-2.10          | 89 KB     | #################################################################################################################################### | 100% 
entrypoints-0.2.3    | 9 KB      | #################################################################################################################################### | 100% 
html5lib-1.0.1       | 89 KB     | #################################################################################################################################### | 100% 
webencodings-0.5.1   | 12 KB     | #################################################################################################################################### | 100% 
terminado-0.8.1      | 23 KB     | #################################################################################################################################### | 100% 
notebook-5.7.0       | 7.3 MB    | #################################################################################################################################### | 100% 
testpath-0.4.2       | 91 KB     | #################################################################################################################################### | 100% 
jupyter_contrib_nbex | 19.4 MB   | #################################################################################################################################### | 100% 
pandocfilters-1.4.2  | 9 KB      | #################################################################################################################################### | 100% 
jupyter_highlight_se | 13 KB     | #################################################################################################################################### | 100% 
jupyter_nbextensions | 470 KB    | #################################################################################################################################### | 100% 
jupyter_contrib_core | 15 KB     | #################################################################################################################################### | 100% 
jupyter_latex_envs-1 | 753 KB    | #################################################################################################################################### | 100% 
jsonschema-2.6.0     | 62 KB     | #################################################################################################################################### | 100% 
pandoc-2.3.1         | 20.7 MB   | #################################################################################################################################### | 100% 
lxml-4.2.5           | 6.0 MB    | #################################################################################################################################### | 100% 
send2trash-1.5.0     | 12 KB     | #################################################################################################################################### | 100% 
libxslt-1.1.32       | 511 KB    | #################################################################################################################################### | 100% 
prometheus_client-0. | 32 KB     | #################################################################################################################################### | 100% 
jupyter_client-5.2.3 | 59 KB     | #################################################################################################################################### | 100% 
bleach-3.0.0         | 108 KB    | #################################################################################################################################### | 100% 
nbconvert-5.3.1      | 320 KB    | #################################################################################################################################### | 100% 
nbformat-4.4.0       | 91 KB     | #################################################################################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: | + /opt/conda/bin/python -c 'import logging; from jupyter_contrib_core.notebook_compat.nbextensions import install_nbextension_python; install_nbextension_python('\''jupyter_highlight_selected_word'\'', sys_prefix=True, logger=logging.getLogger())'

\ + /opt/conda/bin/python -c 'import logging; from jupyter_contrib_core.notebook_compat.nbextensions import install_nbextension_python; install_nbextension_python('\''latex_envs'\'', sys_prefix=True, logger=logging.getLogger())'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 211, in install_nbextension_python
    m, nbexts = _get_nbextension_metadata(module)
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 1122, in _get_nbextension_metadata
    m = import_item(module)
  File "/opt/conda/lib/python3.6/site-packages/traitlets/utils/importstring.py", line 42, in import_item
    return __import__(parts[0])
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/__init__.py", line 3, in <module>
    from . import latex_envs
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/latex_envs.py", line 19, in <module>
    from IPython.display import HTML, display,JSON
  File "/opt/conda/lib/python3.6/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 18, in <module>
    from prompt_toolkit.document import Document
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/interface.py", line 19, in <module>
    from .application import Application, AbortAction
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/__init__.py", line 2, in <module>
    from .application import Application
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 3, in <module>
    from prompt_toolkit.buffer import Buffer
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/buffer.py", line 9, in <module>
    from .completion import Completer, Completion, CompleteEvent
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/__init__.py", line 2, in <module>
    from .base import Completion, Completer, ThreadedCompleter, DummyCompleter, DynamicCompleter, CompleteEvent, merge_completers, get_common_complete_suffix
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/base.py", line 4, in <module>
    from prompt_toolkit.eventloop import generator_to_async_generator, AsyncGeneratorItem
ImportError: cannot import name 'generator_to_async_generator'

failed
ERROR conda.core.link:_execute(502): An error occurred while installing package 'conda-forge::jupyter_latex_envs-1.4.4-py36_0'.
LinkError: post-link script failed for package conda-forge::jupyter_latex_envs-1.4.4-py36_0
running your command again with `-v` will provide additional information
location of failed script: /opt/conda/bin/.jupyter_latex_envs-post-link.sh
==> script messages <==
+ /opt/conda/bin/python -c 'import logging; from jupyter_contrib_core.notebook_compat.nbextensions import install_nbextension_python; install_nbextension_python('\''latex_envs'\'', sys_prefix=True, logger=logging.getLogger())'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 211, in install_nbextension_python
    m, nbexts = _get_nbextension_metadata(module)
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 1122, in _get_nbextension_metadata
    m = import_item(module)
  File "/opt/conda/lib/python3.6/site-packages/traitlets/utils/importstring.py", line 42, in import_item
    return __import__(parts[0])
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/__init__.py", line 3, in <module>
    from . import latex_envs
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/latex_envs.py", line 19, in <module>
    from IPython.display import HTML, display,JSON
  File "/opt/conda/lib/python3.6/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 18, in <module>
    from prompt_toolkit.document import Document
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/interface.py", line 19, in <module>
    from .application import Application, AbortAction
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/__init__.py", line 2, in <module>
    from .application import Application
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 3, in <module>
    from prompt_toolkit.buffer import Buffer
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/buffer.py", line 9, in <module>
    from .completion import Completer, Completion, CompleteEvent
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/__init__.py", line 2, in <module>
    from .base import Completion, Completer, ThreadedCompleter, DummyCompleter, DynamicCompleter, CompleteEvent, merge_completers, get_common_complete_suffix
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/base.py", line 4, in <module>
    from prompt_toolkit.eventloop import generator_to_async_generator, AsyncGeneratorItem
ImportError: cannot import name 'generator_to_async_generator'


Attempting to roll back.

Rolling back transaction: done

LinkError: post-link script failed for package conda-forge::jupyter_latex_envs-1.4.4-py36_0
running your command again with `-v` will provide additional information
location of failed script: /opt/conda/bin/.jupyter_latex_envs-post-link.sh
==> script messages <==
+ /opt/conda/bin/python -c 'import logging; from jupyter_contrib_core.notebook_compat.nbextensions import install_nbextension_python; install_nbextension_python('\''latex_envs'\'', sys_prefix=True, logger=logging.getLogger())'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 211, in install_nbextension_python
    m, nbexts = _get_nbextension_metadata(module)
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 1122, in _get_nbextension_metadata
    m = import_item(module)
  File "/opt/conda/lib/python3.6/site-packages/traitlets/utils/importstring.py", line 42, in import_item
    return __import__(parts[0])
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/__init__.py", line 3, in <module>
    from . import latex_envs
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/latex_envs.py", line 19, in <module>
    from IPython.display import HTML, display,JSON
  File "/opt/conda/lib/python3.6/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 18, in <module>
    from prompt_toolkit.document import Document
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/interface.py", line 19, in <module>
    from .application import Application, AbortAction
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/__init__.py", line 2, in <module>
    from .application import Application
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 3, in <module>
    from prompt_toolkit.buffer import Buffer
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/buffer.py", line 9, in <module>
    from .completion import Completer, Completion, CompleteEvent
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/__init__.py", line 2, in <module>
    from .base import Completion, Completer, ThreadedCompleter, DummyCompleter, DynamicCompleter, CompleteEvent, merge_completers, get_common_complete_suffix
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/base.py", line 4, in <module>
    from prompt_toolkit.eventloop import generator_to_async_generator, AsyncGeneratorItem
ImportError: cannot import name 'generator_to_async_generator'




root@0d9fb3d3f1ff:~# pip install scipy
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/METADATA'

root@0d9fb3d3f1ff:~# pip install scipy
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/METADATA'

root@0d9fb3d3f1ff:~# pip install --upgrade pip
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip
  Downloading https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 10.8MB/s 
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/METADATA'

root@0d9fb3d3f1ff:~# conda install --upgrade pip
usage: conda [-h] [-V] command ...
conda: error: unrecognized arguments: --upgrade
root@0d9fb3d3f1ff:~# conda install pip
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.10
  latest version: 4.5.11

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /opt/conda

  added / updated specs: 
    - pip


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pip-18.1                   |        py36_1000         1.8 MB  conda-forge

The following packages will be UPDATED:

    pip: 10.0.1-py36_0 defaults --> 18.1-py36_1000 conda-forge

Proceed ([y]/n)? y


Downloading and Extracting Packages
pip-18.1             | 1.8 MB    | #################################################################################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
root@0d9fb3d3f1ff:~# pip install scipy
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/METADATA'


root@9fa47a5e4577:~# pip uninstall pip
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling pip-18.0:
  Would remove:
    /opt/conda/bin/pip
    /opt/conda/bin/pip3
    /opt/conda/bin/pip3.6
    /opt/conda/lib/python3.6/site-packages/pip-18.0.dist-info/*
    /opt/conda/lib/python3.6/site-packages/pip/*
Proceed (y/n)? y
  Successfully uninstalled pip-18.0
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
root@9fa47a5e4577:~# conda install pip
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.10
  latest version: 4.5.11

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /opt/conda

  added / updated specs: 
    - pip


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pip-18.1                   |        py36_1000         1.8 MB  conda-forge

The following packages will be UPDATED:

    pip: 10.0.1-py36_0 defaults --> 18.1-py36_1000 conda-forge

Proceed ([y]/n)? y


Downloading and Extracting Packages
pip-18.1             | 1.8 MB    | ################################################################################################################################################################# | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
root@9fa47a5e4577:~# pip install scipy
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/METADATA'


root@9fa47a5e4577:~# conda remove mistune
Solving environment: failed

PackagesNotFoundError: The following packages are missing from the target environment:
  - mistune


root@9fa47a5e4577:~# pip uninstall mistune
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Exception:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/uninstall.py", line 75, in run
    auto_confirm=options.yes, verbose=self.verbosity > 0,
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 682, in uninstall
    uninstalled_pathset = UninstallPathSet.from_dist(dist)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.py", line 360, in from_dist
    for path in uninstallation_paths(dist):
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.py", line 50, in unique
    for item in fn(*args, **kw):
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.py", line 67, in uninstallation_paths
    r = csv.reader(FakeFile(dist.get_metadata_lines('RECORD')))
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1411, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1407, in get_metadata
    value = self._get(self._fn(self.egg_info, name))
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1519, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/RECORD'


@takluyver

This comment has been minimized.

Copy link
Member

takluyver commented Oct 6, 2018

The error message there (EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/METADATA') looks different enough that I'd suggest filing a separate issue for it. Mistune isn't using Flit, so hopefully it's not me breaking stuff this time. ;-)

@takluyver

This comment has been minimized.

Copy link
Member

takluyver commented Oct 6, 2018

I have seen a similar error to that, with the METADATA file missing from six; it was a problem affecting CI builds, but it seemed to go away when I upgraded pip.

@mirekphd

This comment has been minimized.

Copy link
Author

mirekphd commented Oct 6, 2018

Maybe this one should be filled with conda? After all, isn't it their installer's failure to roll back that cripples pip?

Attempting to roll back.

Rolling back transaction: done

LinkError: post-link script failed for package conda-forge::jupyter_latex_envs-1.4.4-py36_0
running your command again with `-v` will provide additional information
location of failed script: /opt/conda/bin/.jupyter_latex_envs-post-link.sh

And a simple solution exists now, because we know exactly which package's folder to remove:

rm -rf /opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/

root@9fa47a5e4577:/opt/conda/lib/python3.6/site-packages# pip install scipy --no-cache-dir
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
root@9fa47a5e4577:

And if we break pip again (with the usual "conda install -y -c conda-forge jupyter jupyter_contrib_nbextensions jupyter_nbextensions_configurator"):

root@9fa47a5e4577:/opt/conda/lib/python3.6/site-packages# pip install scipy
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/ipywidgets-7.4.2.dist-info/METADATA'

..we (i.e. typically root) can remove the entire folder with the newly broken package: ipywidgets, and the removal repairs pip once again:

root@9fa47a5e4577:/opt/conda/lib/python3.6/site-packages# rm -rf /opt/conda/lib/python3.6/site-packages/ipywidgets-7.4.2.dist-info/
root@9fa47a5e4577:/opt/conda/lib/python3.6/site-packages# pip install scipy
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
root@9fa47a5e4577:/opt/conda/lib/python3.6/site-packages# 
@rodrev

This comment has been minimized.

Copy link

rodrev commented Oct 6, 2018

It's working for me now (essentially using workaround by @mirekphd).
I was having the same problem upgrading pip packages in a conda environment.

base conda environment
~/miniconda3
This is a base conda environment with just the minimal packages to install conda, plus conda's pip (10.0.1) and pip's pip (18.0 now 18.1).

ai conda environment
~/miniconda3/envs/ai
This has a ton of packages and just a handful of pip packages. It also had it's own pip (This may have been a problem) also of version 18.0 now removed.

Solution:

  1. update pip to version 18.1 in the base conda environment.
source activate base
pip install --upgrade pip
source deactivate
  1. remove pip from the environment you want to update.
source activate ai
pip uninstall pip
source deactivate

double check that it is gone.
ls ~/miniconda3/envs/ai/bin | grep pip

pip install still wasn't working yet. I realized that my base conda environment was not active while in my ai conda environment and I was using my system /usr/bin/pip after step 2.

  1. activate both your base and working conda environments before using pip install
source activate base
source activate ai
echo $PATH

Now your $PATH should begin with:
~/miniconda3/envs/ai/bin:~/miniconda3/bin
And use pip 18.1 from your base environment, ~/miniconda3/bin.

which pip
pip --version
  1. I also noticed that I now need sudo permissions for this pip (unclear why since it's not touching my system directories).
    sudo pip install --upgrade <package>

OK. pip install should now work under these conditions.

P.S. The set of pip packages I have are different, so the problem is likely independent of jupyter notebook extensions, etc.

working update

################################
#####      UPDATE CONDA    #####
################################
>>>>> conda update --name=base --yes conda
Solving environment: done
# All requested packages already installed.
###########################
#####      base       ####
###########################
>>>>> source activate base
>>>>> conda update --name=base --yes --all
Solving environment: ...working... done
# All requested packages already installed.
>>>>> pip install --upgrade pip
Requirement already up-to-date: pip in ./miniconda3/lib/python3.6/site-packages (18.1)
conda list --name=ai | grep '<pip>' | cut --fields=1 --delimiter=' ' | xargs (sudo pip install --upgrade)
[sudo] password for roddie: 
Requirement already up-to-date: configparser in ./miniconda3/lib/python3.6/site-packages (3.5.0)
Requirement already up-to-date: emoji in ./miniconda3/lib/python3.6/site-packages (0.5.1)
Requirement already up-to-date: music21 in ./miniconda3/lib/python3.6/site-packages (5.3.0)
Requirement already up-to-date: mypy in ./miniconda3/lib/python3.6/site-packages (0.630)
Requirement already up-to-date: mypy-extensions in ./miniconda3/lib/python3.6/site-packages (0.4.1)
Requirement already up-to-date: pydub in ./miniconda3/lib/python3.6/site-packages (0.23.0)
Requirement already up-to-date: pyls-isort in ./miniconda3/lib/python3.6/site-packages (0.1.1)
Requirement already up-to-date: pyls-mypy in ./miniconda3/lib/python3.6/site-packages (0.1.3)
Requirement already up-to-date: solargraph-utils.py in ./miniconda3/lib/python3.6/site-packages (1.1.0)
Requirement already up-to-date: typed-ast in ./miniconda3/lib/python3.6/site-packages (1.1.0)
Requirement already satisfied, skipping upgrade: python-language-server in ./miniconda3/lib/python3.6/site-packages (from pyls-isort) (0.21.2)
Requirement already satisfied, skipping upgrade: isort in ./miniconda3/lib/python3.6/site-packages (from pyls-isort) (4.3.4)
Requirement already satisfied, skipping upgrade: jedi>=0.12 in ./miniconda3/lib/python3.6/site-packages (from python-language-server->pyls-isort) (0.13.1)
Requirement already satisfied, skipping upgrade: future>=0.14.0 in ./miniconda3/lib/python3.6/site-packages (from python-language-server->pyls-isort) (0.16.0)
Requirement already satisfied, skipping upgrade: pluggy in ./miniconda3/lib/python3.6/site-packages (from python-language-server->pyls-isort) (0.7.1)
Requirement already satisfied, skipping upgrade: python-jsonrpc-server in ./miniconda3/lib/python3.6/site-packages (from python-language-server->pyls-isort) (0.0.2)
Requirement already satisfied, skipping upgrade: parso>=0.3.0 in ./miniconda3/lib/python3.6/site-packages (from jedi>=0.12->python-language-server->pyls-isort) (0.3.1)
>>>>> source deactivate
###########################
#####      ai       ####
###########################
>>>>> source activate ai
>>>>> conda update --name=ai --yes --all
Solving environment: ...working... done
# All requested packages already installed.
>>>>> pip install --upgrade pip
Requirement already up-to-date: pip in /usr/lib/python3.7/site-packages (18.1)
conda list --name=ai | grep '<pip>' | cut --fields=1 --delimiter=' ' | xargs (sudo pip install --upgrade)
Collecting configparser
Using cached https://files.pythonhosted.org/packages/7c/69/c2ce7e91c89dc073eb1aa74c0621c3eefbffe8216b3f9af9d3885265c01c/configparser-3.5.0.tar.gz
Collecting emoji
Using cached https://files.pythonhosted.org/packages/9c/fb/7586e11ff9205c9be9d11d376fcb6990ec4bdfae0a35663fb1ada7e3c10f/emoji-0.5.1-py3-none-any.whl
Collecting music21
Downloading https://files.pythonhosted.org/packages/4a/db/317c21f4b5b970c3bfb5ff321e333059faf775621ae6433abcd4c68c69db/music21-5.3.0.tar.gz (18.0MB)
100% |████████████████████████████████| 18.0MB 577kB/s 
Collecting mypy
Downloading https://files.pythonhosted.org/packages/32/8c/a668527fe2ea69f3a03fc4d895e12b6cb2eb1bb62d61cfe8ff4142395d3a/mypy-0.630-py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 807kB/s 
Collecting mypy-extensions
Downloading https://files.pythonhosted.org/packages/4d/72/8d54e2b296631b9b14961d583e56e90d9d7fba8a240d5ce7f1113cc5e887/mypy_extensions-0.4.1-py2.py3-none-any.whl
Collecting pydub
Downloading https://files.pythonhosted.org/packages/2f/73/bb9c093882d647437a9e6e87c7e6592d2df852f83ffac6f348b878979be0/pydub-0.23.0-py2.py3-none-any.whl
Collecting pyls-isort
Downloading https://files.pythonhosted.org/packages/8c/bd/7466d13e2bbe77fd1ae7cdd8e3b892518fc0a34c169d4933fb474c815526/pyls_isort-0.1.1-py3-none-any.whl
Collecting pyls-mypy
Downloading https://files.pythonhosted.org/packages/7b/88/41e44206fcdaef8aa6fe139a1d86e7d11062173968cac8b77d03d8e11df1/pyls-mypy-0.1.3.tar.gz
Requirement already up-to-date: solargraph-utils.py in /usr/lib/python3.7/site-packages (1.1.0)
Collecting typed-ast
Downloading https://files.pythonhosted.org/packages/e5/97/0398bd62ee2536097ed4576053f389e09bd5ac88b0750b3588bd9e2d341d/typed_ast-1.1.0-cp37-cp37m-manylinux1_x86_64.whl (723kB)
100% |████████████████████████████████| 727kB 864kB/s 
Requirement already satisfied, skipping upgrade: python-language-server in /usr/lib/python3.7/site-packages (from pyls-isort) (0.21.2)
Collecting isort (from pyls-isort)
Downloading https://files.pythonhosted.org/packages/1f/2c/22eee714d7199ae0464beda6ad5fedec8fee6a2f7ffd1e8f1840928fe318/isort-4.3.4-py3-none-any.whl (45kB)
100% |████████████████████████████████| 51kB 787kB/s
Requirement already satisfied, skipping upgrade: future>=0.14.0 in /usr/lib/python3.7/site-packages (from python-language-server->pyls-isort) (0.16.0)
Requirement already satisfied, skipping upgrade: jedi>=0.12 in /usr/lib/python3.7/site-packages (from python-language-server->pyls-isort) (0.13.0)
Requirement already satisfied, skipping upgrade: python-jsonrpc-server in /usr/lib/python3.7/site-packages (from python-language-server->pyls-isort) (0.0.1)
Requirement already satisfied, skipping upgrade: pluggy in /usr/lib/python3.7/site-packages (from python-language-server->pyls-isort) (0.7.1)
Requirement already satisfied, skipping upgrade: parso>=0.3.0 in /usr/lib/python3.7/site-packages (from jedi>=0.12->python-language-server->pyls-isort) (0.3.1)
Installing collected packages: configparser, emoji, music21, typed-ast, mypy-extensions, mypy, pydub, isort, pyls-isort, pyls-mypy
Running setup.py install for configparser ... done
Running setup.py install for music21 ... done
Running setup.py install for pyls-mypy ... done
Successfully installed configparser-3.5.0 emoji-0.5.1 isort-4.3.4 music21-5.3.0 mypy-0.630 mypy-extensions-0.4.1 pydub-0.23.0 pyls-isort-0.1.1 pyls-mypy-0.1.3 typed-ast-1.1.0
>>>>> source deactivate

original failed update

################################
#####      UPDATE CONDA    #####
################################
>>>>> conda update --name=base --yes conda
Solving environment: done
# All requested packages already installed.
###########################
#####      base       ####
###########################
>>>>> source activate base
>>>>> conda update --name=base --yes --all
setuptools-40.4.3    | 555 KB    | #################################################################################################################################################### | 100% 
wheel-0.32.0         | 35 KB     | #################################################################################################################################################### | 100% 
Solving environment: ...working... done
## Package Plan ##
environment location: /home/roddie/miniconda3
The following packages will be downloaded:
package | build
---------------------------|-----------------
setuptools-40.4.3 | py36_0 555 KB
wheel-0.32.0 | py36_0 35 KB
------------------------------------------------------------
Total: 590 KB
The following packages will be UPDATED:
setuptools: 40.2.0-py36_0 --> 40.4.3-py36_0
wheel: 0.31.1-py36_0 --> 0.32.0-py36_0
Downloading and Extracting Packages
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
>>>>> pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 891kB/s 
Installing collected packages: pip
Found existing installation: pip 18.0
Uninstalling pip-18.0:
Successfully uninstalled pip-18.0
Successfully installed pip-18.1
>>>>> conda list --name=base | grep '<pip>' | cut --fields=1 --delimiter=' ' | xargs pip install --upgrade 
Requirement already up-to-date: pip in ./miniconda3/lib/python3.6/site-packages (18.1)
>>>>> source deactivate
###########################
#####      ai       ####
###########################
>>>>> source activate ai
>>>>> conda update --name=ai --yes --all
networkx-2.2         | 2.0 MB    | #################################################################################################################################################### | 100% 
prompt_toolkit-2.0.5 | 461 KB    | #################################################################################################################################################### | 100% 
ipykernel-5.0.0      | 156 KB    | #################################################################################################################################################### | 100% 
pywavelets-1.0.1     | 4.4 MB    | #################################################################################################################################################### | 100% 
numpy-base-1.15.2    | 4.2 MB    | #################################################################################################################################################### | 100% 
ipython-7.0.1        | 1.0 MB    | #################################################################################################################################################### | 100% 
notebook-5.7.0       | 7.4 MB    | #################################################################################################################################################### | 100% 
numpy-1.15.2         | 48 KB     | #################################################################################################################################################### | 100% 
packaging-18.0       | 33 KB     | #################################################################################################################################################### | 100% 
testpath-0.4.1       | 91 KB     | #################################################################################################################################################### | 100% 
jupyterlab-0.34.12   | 10.0 MB   | #################################################################################################################################################### | 100% 
pillow-5.3.0         | 599 KB    | #################################################################################################################################################### | 100% 
click-7.0            | 118 KB    | #################################################################################################################################################### | 100% 
pickleshare-0.7.5    | 13 KB     | #################################################################################################################################################### | 100% 
Solving environment: ...working... done
## Package Plan ##
environment location: /home/roddie/miniconda3/envs/ai
The following packages will be downloaded:
package | build
---------------------------|-----------------
networkx-2.2 | py36_1 2.0 MB
prompt_toolkit-2.0.5 | py36_0 461 KB
ipykernel-5.0.0 | py36h39e3cac_0 156 KB
pywavelets-1.0.1 | py36hdd07704_0 4.4 MB
numpy-base-1.15.2 | py36h81de0dd_1 4.2 MB
ipython-7.0.1 | py36h39e3cac_0 1.0 MB
notebook-5.7.0 | py36_0 7.4 MB
numpy-1.15.2 | py36h1d66e8a_1 48 KB
packaging-18.0 | py36_0 33 KB
testpath-0.4.1 | py36_0 91 KB
jupyterlab-0.34.12 | py36_0 10.0 MB
pillow-5.3.0 | py36h34e0f95_0 599 KB
click-7.0 | py36_0 118 KB
pickleshare-0.7.5 | py36_0 13 KB
------------------------------------------------------------
Total: 30.5 MB
The following packages will be UPDATED:
click: 6.7-py36_0 --> 7.0-py36_0
ipykernel: 4.10.0-py36_0 --> 5.0.0-py36h39e3cac_0
ipython: 6.5.0-py36_0 --> 7.0.1-py36h39e3cac_0
jupyterlab: 0.34.9-py36_0 --> 0.34.12-py36_0
networkx: 2.1-py36_0 --> 2.2-py36_1
notebook: 5.6.0-py36_0 --> 5.7.0-py36_0
numpy: 1.15.2-py36h1d66e8a_0 --> 1.15.2-py36h1d66e8a_1
numpy-base: 1.15.2-py36h81de0dd_0 --> 1.15.2-py36h81de0dd_1
packaging: 17.1-py36_0 --> 18.0-py36_0
pickleshare: 0.7.4-py36_0 --> 0.7.5-py36_0
pillow: 5.2.0-py36heded4f4_0 --> 5.3.0-py36h34e0f95_0
prompt_toolkit: 1.0.15-py36_0 --> 2.0.5-py36_0
pywavelets: 1.0.0-py36hdd07704_0 --> 1.0.1-py36hdd07704_0
setuptools: 40.2.0-py36_0 --> 40.4.3-py36_0
testpath: 0.3.1-py36_0 --> 0.4.1-py36_0
wheel: 0.31.1-py36_0 --> 0.32.0-py36_0
Downloading and Extracting Packages
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
>>>>> pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Exception:
Traceback (most recent call last):                                                                                                                                                             
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in _dep_map                                                             
return self.__dep_map                                                                                                                                                                      
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2663, in __getattr__                                                          
raise AttributeError(attr)                                                                                                                                                                 
AttributeError: _DistInfoDistribution__dep_map                                                                                                                                                 
During handling of the above exception, another exception occurred:                                                                                                                            
Traceback (most recent call last):                                                                                                                                                             
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__                                                               
req = REQUIREMENT.parseString(requirement_string)                                                                                                                                          
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1632, in parseString                                                                       
raise exc                                                                                                                                                                                  
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1622, in parseString                                                                       
loc, tokens = self._parse( instring, 0 )                                                                                                                                                   
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache                                                                     
loc,tokens = self.parseImpl( instring, preloc, doActions )                                                                                                                                 
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3395, in parseImpl                                                                         
loc, exprtokens = e._parse( instring, loc, doActions )                                                                                                                                     
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache                                                                     
loc,tokens = self.parseImpl( instring, preloc, doActions )                                                                                                                                 
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3183, in parseImpl                                                                         
raise ParseException(instring, loc, self.errmsg, self)                                                                                                                                     
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)                                                                                                        
During handling of the above exception, another exception occurred:                                                                                                                            
Traceback (most recent call last):                                                                                                                                                             
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2949, in __init__                                                             
super(Requirement, self).__init__(requirement_string)                                                                                                                                      
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__                                                               
requirement_string[e.loc:e.loc + 8]))                                                                                                                                                      
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'; extra '"                                                                                        
During handling of the above exception, another exception occurred:                                                                                                                            
Traceback (most recent call last):                                                                                                                                                             
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 141, in main                                                                           
status = self.run(options, args)                                                                                                                                                           
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 330, in run                                                                       
self._warn_about_conflicts(to_install)                                                                                                                                                     
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 456, in _warn_about_conflicts                                                     
package_set, _dep_info = check_install_conflicts(to_install)                                                                                                                               
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 98, in check_install_conflicts                                                    
package_set = create_package_set_from_installed()                                                                                                                                          
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 41, in create_package_set_from_installed                                          
package_set[name] = PackageDetails(dist.version, dist.requires())                                                                                                                          
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2607, in requires                                                             
dm = self._dep_map                                                                                                                                                                         
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2871, in _dep_map                                                             
self.__dep_map = self._compute_dependencies()                                                                                                                                              
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2881, in _compute_dependencies                                                
reqs.extend(parse_requirements(req))                                                                                                                                                       
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in parse_requirements                                                   
yield Requirement(line)                                                                                                                                                                    
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2951, in __init__                                                             
raise RequirementParseError(str(e))                                                                                                                                                        
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'; extra '"                                                                                              
You are using pip version 18.0, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.                                                                                                                     
>>>>> conda list --name=ai | grep '<pip>' | cut --fields=1 --delimiter=' ' | xargs pip install --upgrade 
Requirement already up-to-date: configparser in ./miniconda3/envs/ai/lib/python3.6/site-packages (3.5.0)
Requirement already up-to-date: emoji in ./miniconda3/envs/ai/lib/python3.6/site-packages (0.5.1)
Requirement already up-to-date: music21 in ./miniconda3/envs/ai/lib/python3.6/site-packages (5.3.0)
Requirement already up-to-date: mypy in ./miniconda3/envs/ai/lib/python3.6/site-packages (0.630)
Requirement already up-to-date: mypy-extensions in ./miniconda3/envs/ai/lib/python3.6/site-packages (0.4.1)
Collecting pip
Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Requirement already up-to-date: pydub in ./miniconda3/envs/ai/lib/python3.6/site-packages (0.23.0)
Requirement already up-to-date: pyls-isort in ./miniconda3/envs/ai/lib/python3.6/site-packages (0.1.1)
Requirement already up-to-date: pyls-mypy in ./miniconda3/envs/ai/lib/python3.6/site-packages (0.1.3)
Requirement already up-to-date: solargraph-utils.py in ./miniconda3/envs/ai/lib/python3.6/site-packages (1.1.0)
Requirement already up-to-date: typed-ast in ./miniconda3/envs/ai/lib/python3.6/site-packages (1.1.0)
Requirement already satisfied, skipping upgrade: isort in ./miniconda3/envs/ai/lib/python3.6/site-packages (from pyls-isort) (4.3.4)
Requirement already satisfied, skipping upgrade: python-language-server in ./miniconda3/envs/ai/lib/python3.6/site-packages (from pyls-isort) (0.21.2)
Requirement already satisfied, skipping upgrade: python-jsonrpc-server in ./miniconda3/envs/ai/lib/python3.6/site-packages (from python-language-server->pyls-isort) (0.0.2)
Requirement already satisfied, skipping upgrade: jedi>=0.12 in ./miniconda3/envs/ai/lib/python3.6/site-packages (from python-language-server->pyls-isort) (0.12.1)
Requirement already satisfied, skipping upgrade: future>=0.14.0 in ./miniconda3/envs/ai/lib/python3.6/site-packages (from python-language-server->pyls-isort) (0.16.0)
Requirement already satisfied, skipping upgrade: pluggy in ./miniconda3/envs/ai/lib/python3.6/site-packages (from python-language-server->pyls-isort) (0.7.1)
Requirement already satisfied, skipping upgrade: parso>=0.3.0 in ./miniconda3/envs/ai/lib/python3.6/site-packages (from jedi>=0.12->python-language-server->pyls-isort) (0.3.1)
Exception:
Traceback (most recent call last):                                                                                                                                                             
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in _dep_map                                                             
return self.__dep_map                                                                                                                                                                      
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2663, in __getattr__                                                          
raise AttributeError(attr)                                                                                                                                                                 
AttributeError: _DistInfoDistribution__dep_map                                                                                                                                                 
During handling of the above exception, another exception occurred:                                                                                                                            
Traceback (most recent call last):                                                                                                                                                             
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__                                                               
req = REQUIREMENT.parseString(requirement_string)                                                                                                                                          
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1632, in parseString                                                                       
raise exc                                                                                                                                                                                  
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1622, in parseString                                                                       
loc, tokens = self._parse( instring, 0 )                                                                                                                                                   
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache                                                                     
loc,tokens = self.parseImpl( instring, preloc, doActions )                                                                                                                                 
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3395, in parseImpl                                                                         
loc, exprtokens = e._parse( instring, loc, doActions )                                                                                                                                     
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache                                                                     
loc,tokens = self.parseImpl( instring, preloc, doActions )                                                                                                                                 
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3183, in parseImpl                                                                         
raise ParseException(instring, loc, self.errmsg, self)                                                                                                                                     
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)                                                                                                        
During handling of the above exception, another exception occurred:                                                                                                                            
Traceback (most recent call last):                                                                                                                                                             
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2949, in __init__                                                             
super(Requirement, self).__init__(requirement_string)                                                                                                                                      
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__                                                               
requirement_string[e.loc:e.loc + 8]))                                                                                                                                                      
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'; extra '"                                                                                        
During handling of the above exception, another exception occurred:                                                                                                                            
Traceback (most recent call last):                                                                                                                                                             
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 141, in main                                                                           
status = self.run(options, args)                                                                                                                                                           
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 330, in run                                                                       
self._warn_about_conflicts(to_install)                                                                                                                                                     
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 456, in _warn_about_conflicts                                                     
package_set, _dep_info = check_install_conflicts(to_install)                                                                                                                               
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 98, in check_install_conflicts                                                    
package_set = create_package_set_from_installed()                                                                                                                                          
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 41, in create_package_set_from_installed                                          
package_set[name] = PackageDetails(dist.version, dist.requires())                                                                                                                          
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2607, in requires                                                             
dm = self._dep_map                                                                                                                                                                         
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2871, in _dep_map                                                             
self.__dep_map = self._compute_dependencies()                                                                                                                                              
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2881, in _compute_dependencies                                                
reqs.extend(parse_requirements(req))                                                                                                                                                       
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in parse_requirements                                                   
yield Requirement(line)                                                                                                                                                                    
File "/home/roddie/miniconda3/envs/ai/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2951, in __init__                                                             
raise RequirementParseError(str(e))                                                                                                                                                        
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'; extra '"                                                                                              
You are using pip version 18.0, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.                                                                                                                     
>>>>> source deactivate
@jjhelmus

This comment has been minimized.

Copy link

jjhelmus commented Oct 6, 2018

Can you see if this issue is still occurring with the latest packages in the conda ecosystem?

The testpath 0.4.1 conda packages in both the defaults and conda-forge channels contained a METADATA file with an invalid Required-Dist line that pkg_resources was not able to parse. Both channels now have corrected packages.

@mirekphd

This comment has been minimized.

Copy link
Author

mirekphd commented Oct 7, 2018

That problem with pkg_resources seems to be gone indeed. But that does not stop Jupyter Extensions (conda installed) from breaking pip in my Kaggle-like environment, like this...

[root@mx01 ml-gpu-py36-cuda90]# docker run -it -u 0 -p 8888:8888 mirekphd/ml-gpu-py36-cuda8:latest bash
root@256c343bb1ef:~# conda list testpath
# packages in environment at /opt/conda:
#
# Name                    Version                   Build  Channel
testpath                  0.4.2                     <pip>
root@256c343bb1ef:~# conda install -y -c conda-forge jupyter jupyter_contrib_nbextensions jupyter_nbextensions_configurator
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.10
  latest version: 4.5.11

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /opt/conda

  added / updated specs: 
    - jupyter
    - jupyter_contrib_nbextensions
    - jupyter_nbextensions_configurator


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    prometheus_client-0.4.0    |             py_0          32 KB  conda-forge
    testpath-0.4.2             |        py36_1000          91 KB  conda-forge
    jupyter_contrib_core-0.3.3 |             py_2          15 KB  conda-forge
    jsonschema-2.6.0           |        py36_1002          62 KB  conda-forge
    jupyter_contrib_nbextensions-0.5.0|           py36_0        19.4 MB  conda-forge
    ipywidgets-7.4.2           |             py_0          92 KB  conda-forge
    libsodium-1.0.16           |       h470a237_1         536 KB  conda-forge
    nbformat-4.4.0             |             py_1          91 KB  conda-forge
    entrypoints-0.2.3          |        py36_1002           9 KB  conda-forge
    jupyter_console-5.2.0      |           py36_1          34 KB  conda-forge
    pandoc-2.3.1               |                0        20.7 MB  conda-forge
    jupyter-1.0.0              |             py_1           6 KB  conda-forge
    html5lib-1.0.1             |             py_0          89 KB  conda-forge
    libxslt-1.1.32             |       h88dbc4e_2         511 KB  conda-forge
    jupyter_core-4.4.0         |             py_0          44 KB  conda-forge
    pandocfilters-1.4.2        |             py_1           9 KB  conda-forge
    mistune-0.8.3              |   py36h470a237_2         873 KB  conda-forge
    bleach-3.0.0               |             py_0         108 KB  conda-forge
    notebook-5.7.0             |        py36_1000         7.3 MB  conda-forge
    nbconvert-5.3.1            |             py_1         320 KB  conda-forge
    pyzmq-17.1.2               |   py36hae99301_0         1.0 MB  conda-forge
    terminado-0.8.1            |        py36_1001          23 KB  conda-forge
    jinja2-2.10                |             py_1          89 KB  conda-forge
    ipykernel-5.0.0            |     pyh24bf2e0_1          76 KB  conda-forge
    send2trash-1.5.0           |             py_0          12 KB  conda-forge
    widgetsnbextension-3.4.2   |        py36_1000         1.7 MB  conda-forge
    jupyter_latex_envs-1.4.4   |           py36_0         753 KB  conda-forge
    jupyter_highlight_selected_word-0.2.0|        py36_1000          13 KB  conda-forge
    lxml-4.2.5                 |   py36hc9114bc_0         6.0 MB  conda-forge
    qtconsole-4.4.1            |           py36_1         156 KB  conda-forge
    jupyter_nbextensions_configurator-0.4.0|           py36_0         470 KB  conda-forge
    jupyter_client-5.2.3       |             py_1          59 KB  conda-forge
    zeromq-4.2.5               |       hfc679d8_6         939 KB  conda-forge
    webencodings-0.5.1         |             py_1          12 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        61.6 MB

The following NEW packages will be INSTALLED:

    bleach:                            3.0.0-py_0            conda-forge
    entrypoints:                       0.2.3-py36_1002       conda-forge
    html5lib:                          1.0.1-py_0            conda-forge
    ipykernel:                         5.0.0-pyh24bf2e0_1    conda-forge
    ipywidgets:                        7.4.2-py_0            conda-forge
    jinja2:                            2.10-py_1             conda-forge
    jsonschema:                        2.6.0-py36_1002       conda-forge
    jupyter:                           1.0.0-py_1            conda-forge
    jupyter_client:                    5.2.3-py_1            conda-forge
    jupyter_console:                   5.2.0-py36_1          conda-forge
    jupyter_contrib_core:              0.3.3-py_2            conda-forge
    jupyter_contrib_nbextensions:      0.5.0-py36_0          conda-forge
    jupyter_core:                      4.4.0-py_0            conda-forge
    jupyter_highlight_selected_word:   0.2.0-py36_1000       conda-forge
    jupyter_latex_envs:                1.4.4-py36_0          conda-forge
    jupyter_nbextensions_configurator: 0.4.0-py36_0          conda-forge
    libsodium:                         1.0.16-h470a237_1     conda-forge
    libxslt:                           1.1.32-h88dbc4e_2     conda-forge
    lxml:                              4.2.5-py36hc9114bc_0  conda-forge
    mistune:                           0.8.3-py36h470a237_2  conda-forge
    nbconvert:                         5.3.1-py_1            conda-forge
    nbformat:                          4.4.0-py_1            conda-forge
    notebook:                          5.7.0-py36_1000       conda-forge
    pandoc:                            2.3.1-0               conda-forge
    pandocfilters:                     1.4.2-py_1            conda-forge
    prometheus_client:                 0.4.0-py_0            conda-forge
    pyzmq:                             17.1.2-py36hae99301_0 conda-forge
    qtconsole:                         4.4.1-py36_1          conda-forge
    send2trash:                        1.5.0-py_0            conda-forge
    terminado:                         0.8.1-py36_1001       conda-forge
    testpath:                          0.4.2-py36_1000       conda-forge
    webencodings:                      0.5.1-py_1            conda-forge
    widgetsnbextension:                3.4.2-py36_1000       conda-forge
    zeromq:                            4.2.5-hfc679d8_6      conda-forge


Downloading and Extracting Packages
prometheus_client-0. | 32 KB     | ########################################################################################################################################################### | 100% 
testpath-0.4.2       | 91 KB     | ########################################################################################################################################################### | 100% 
jupyter_contrib_core | 15 KB     | ########################################################################################################################################################### | 100% 
jsonschema-2.6.0     | 62 KB     | ########################################################################################################################################################### | 100% 
jupyter_contrib_nbex | 19.4 MB   | ########################################################################################################################################################### | 100% 
ipywidgets-7.4.2     | 92 KB     | ########################################################################################################################################################### | 100% 
libsodium-1.0.16     | 536 KB    | ########################################################################################################################################################### | 100% 
nbformat-4.4.0       | 91 KB     | ########################################################################################################################################################### | 100% 
entrypoints-0.2.3    | 9 KB      | ########################################################################################################################################################### | 100% 
jupyter_console-5.2. | 34 KB     | ########################################################################################################################################################### | 100% 
pandoc-2.3.1         | 20.7 MB   | ########################################################################################################################################################### | 100% 
jupyter-1.0.0        | 6 KB      | ########################################################################################################################################################### | 100% 
html5lib-1.0.1       | 89 KB     | ########################################################################################################################################################### | 100% 
libxslt-1.1.32       | 511 KB    | ########################################################################################################################################################### | 100% 
jupyter_core-4.4.0   | 44 KB     | ########################################################################################################################################################### | 100% 
pandocfilters-1.4.2  | 9 KB      | ########################################################################################################################################################### | 100% 
mistune-0.8.3        | 873 KB    | ########################################################################################################################################################### | 100% 
bleach-3.0.0         | 108 KB    | ########################################################################################################################################################### | 100% 
notebook-5.7.0       | 7.3 MB    | ########################################################################################################################################################### | 100% 
nbconvert-5.3.1      | 320 KB    | ########################################################################################################################################################### | 100% 
pyzmq-17.1.2         | 1.0 MB    | ########################################################################################################################################################### | 100% 
terminado-0.8.1      | 23 KB     | ########################################################################################################################################################### | 100% 
jinja2-2.10          | 89 KB     | ########################################################################################################################################################### | 100% 
ipykernel-5.0.0      | 76 KB     | ########################################################################################################################################################### | 100% 
send2trash-1.5.0     | 12 KB     | ########################################################################################################################################################### | 100% 
widgetsnbextension-3 | 1.7 MB    | ########################################################################################################################################################### | 100% 
jupyter_latex_envs-1 | 753 KB    | ########################################################################################################################################################### | 100% 
jupyter_highlight_se | 13 KB     | ########################################################################################################################################################### | 100% 
lxml-4.2.5           | 6.0 MB    | ########################################################################################################################################################### | 100% 
qtconsole-4.4.1      | 156 KB    | ########################################################################################################################################################### | 100% 
jupyter_nbextensions | 470 KB    | ########################################################################################################################################################### | 100% 
jupyter_client-5.2.3 | 59 KB     | ########################################################################################################################################################### | 100% 
zeromq-4.2.5         | 939 KB    | ########################################################################################################################################################### | 100% 
webencodings-0.5.1   | 12 KB     | ########################################################################################################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: \ Enabling notebook extension jupyter-js-widgets/extension...
      - Validating: OK

- + /opt/conda/bin/python -c 'import logging; from jupyter_contrib_core.notebook_compat.nbextensions import install_nbextension_python; install_nbextension_python('\''jupyter_highlight_selected_word'\'', sys_prefix=True, logger=logging.getLogger())'

- + /opt/conda/bin/python -c 'import logging; from jupyter_contrib_core.notebook_compat.nbextensions import install_nbextension_python; install_nbextension_python('\''latex_envs'\'', sys_prefix=True, logger=logging.getLogger())'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 211, in install_nbextension_python
    m, nbexts = _get_nbextension_metadata(module)
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 1122, in _get_nbextension_metadata
    m = import_item(module)
  File "/opt/conda/lib/python3.6/site-packages/traitlets/utils/importstring.py", line 42, in import_item
    return __import__(parts[0])
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/__init__.py", line 3, in <module>
    from . import latex_envs
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/latex_envs.py", line 19, in <module>
    from IPython.display import HTML, display,JSON
  File "/opt/conda/lib/python3.6/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 18, in <module>
    from prompt_toolkit.document import Document
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/interface.py", line 19, in <module>
    from .application import Application, AbortAction
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/__init__.py", line 2, in <module>
    from .application import Application
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 3, in <module>
    from prompt_toolkit.buffer import Buffer
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/buffer.py", line 9, in <module>
    from .completion import Completer, Completion, CompleteEvent
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/__init__.py", line 2, in <module>
    from .base import Completion, Completer, ThreadedCompleter, DummyCompleter, DynamicCompleter, CompleteEvent, merge_completers, get_common_complete_suffix
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/base.py", line 4, in <module>
    from prompt_toolkit.eventloop import generator_to_async_generator, AsyncGeneratorItem
ImportError: cannot import name 'generator_to_async_generator'

failed
ERROR conda.core.link:_execute(502): An error occurred while installing package 'conda-forge::jupyter_latex_envs-1.4.4-py36_0'.
LinkError: post-link script failed for package conda-forge::jupyter_latex_envs-1.4.4-py36_0
running your command again with `-v` will provide additional information
location of failed script: /opt/conda/bin/.jupyter_latex_envs-post-link.sh
==> script messages <==
+ /opt/conda/bin/python -c 'import logging; from jupyter_contrib_core.notebook_compat.nbextensions import install_nbextension_python; install_nbextension_python('\''latex_envs'\'', sys_prefix=True, logger=logging.getLogger())'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 211, in install_nbextension_python
    m, nbexts = _get_nbextension_metadata(module)
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 1122, in _get_nbextension_metadata
    m = import_item(module)
  File "/opt/conda/lib/python3.6/site-packages/traitlets/utils/importstring.py", line 42, in import_item
    return __import__(parts[0])
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/__init__.py", line 3, in <module>
    from . import latex_envs
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/latex_envs.py", line 19, in <module>
    from IPython.display import HTML, display,JSON
  File "/opt/conda/lib/python3.6/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 18, in <module>
    from prompt_toolkit.document import Document
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/interface.py", line 19, in <module>
    from .application import Application, AbortAction
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/__init__.py", line 2, in <module>
    from .application import Application
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 3, in <module>
    from prompt_toolkit.buffer import Buffer
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/buffer.py", line 9, in <module>
    from .completion import Completer, Completion, CompleteEvent
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/__init__.py", line 2, in <module>
    from .base import Completion, Completer, ThreadedCompleter, DummyCompleter, DynamicCompleter, CompleteEvent, merge_completers, get_common_complete_suffix
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/base.py", line 4, in <module>
    from prompt_toolkit.eventloop import generator_to_async_generator, AsyncGeneratorItem
ImportError: cannot import name 'generator_to_async_generator'


Attempting to roll back.

Rolling back transaction: done

LinkError: post-link script failed for package conda-forge::jupyter_latex_envs-1.4.4-py36_0
running your command again with `-v` will provide additional information
location of failed script: /opt/conda/bin/.jupyter_latex_envs-post-link.sh
==> script messages <==
+ /opt/conda/bin/python -c 'import logging; from jupyter_contrib_core.notebook_compat.nbextensions import install_nbextension_python; install_nbextension_python('\''latex_envs'\'', sys_prefix=True, logger=logging.getLogger())'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 211, in install_nbextension_python
    m, nbexts = _get_nbextension_metadata(module)
  File "/opt/conda/lib/python3.6/site-packages/notebook/nbextensions.py", line 1122, in _get_nbextension_metadata
    m = import_item(module)
  File "/opt/conda/lib/python3.6/site-packages/traitlets/utils/importstring.py", line 42, in import_item
    return __import__(parts[0])
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/__init__.py", line 3, in <module>
    from . import latex_envs
  File "/opt/conda/lib/python3.6/site-packages/latex_envs/latex_envs.py", line 19, in <module>
    from IPython.display import HTML, display,JSON
  File "/opt/conda/lib/python3.6/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/opt/conda/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 18, in <module>
    from prompt_toolkit.document import Document
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/interface.py", line 19, in <module>
    from .application import Application, AbortAction
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/__init__.py", line 2, in <module>
    from .application import Application
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 3, in <module>
    from prompt_toolkit.buffer import Buffer
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/buffer.py", line 9, in <module>
    from .completion import Completer, Completion, CompleteEvent
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/__init__.py", line 2, in <module>
    from .base import Completion, Completer, ThreadedCompleter, DummyCompleter, DynamicCompleter, CompleteEvent, merge_completers, get_common_complete_suffix
  File "/opt/conda/lib/python3.6/site-packages/prompt_toolkit/completion/base.py", line 4, in <module>
    from prompt_toolkit.eventloop import generator_to_async_generator, AsyncGeneratorItem
ImportError: cannot import name 'generator_to_async_generator'




root@256c343bb1ef:~# pip install scipy
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/METADATA'

root@256c343bb1ef:~# pip install scipy --no-cache-dir
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/METADATA'

root@256c343bb1ef:~# 


@mirekphd

This comment has been minimized.

Copy link
Author

mirekphd commented Oct 7, 2018

But a workaround is to manually remove those folders reported in sequence by pip in its [Errno 2] error message (there are two such libs to purge: mistune 0.8.3 and ipywidgets 7.4.2, both from the conda-forge channel and installed together with jupyter_contrib_nbextensions and jupyter_nbextensions_configurator). Presumably pip should be immunized from being broken by such malformed packages as well?

root@256c343bb1ef:~# pip install scipy --no-cache-dir
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/METADATA'

root@256c343bb1ef:~# rm -rf /opt/conda/lib/python3.6/site-packages/mistune-0.8.3.dist-info/

root@256c343bb1ef:~# pip install scipy --no-cache-dir
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.6/site-packages/ipywidgets-7.4.2.dist-info/METADATA'

root@256c343bb1ef:~# rm -rf /opt/conda/lib/python3.6/site-packages/ipywidgets-7.4.2.dist-info/

root@256c343bb1ef:~# pip install scipy --no-cache-dir
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
root@256c343bb1ef:~# 

@takluyver

This comment has been minimized.

Copy link
Member

takluyver commented Oct 7, 2018

Re: reporting it on conda - it's certainly an issue that the post-link script fails. But I'd say the bigger issue is that pip should handle the situation a bit more gracefully.

@mirekphd

This comment has been minimized.

Copy link
Author

mirekphd commented Oct 7, 2018

Maybe moving these folders to a temporary "quarantine" folder would be acceptable?

@Juanlu001

This comment has been minimized.

Copy link

Juanlu001 commented Oct 8, 2018

Is this related to jupyter/notebook#2605 in any way?

@mirekphd

This comment has been minimized.

Copy link
Author

mirekphd commented Oct 8, 2018

Is this related to jupyter/notebook#2605 in any way?

I think so, only the solution offered was not general enough to work in more complex cases like this one. I cannot reproduce their case, but can quickly prove their solution does not work here. Docker has no equals when it comes to reproducing bugs...

[root@mx01 ml-gpu-py36-cuda90]# docker pull mirekphd/tst-ml-gpu-py36-cuda8-failing:001766c55ca8
001766c55ca8: Pulling from mirekphd/tst-ml-gpu-py36-cuda8-failing
3b37166ec614: Already exists 
504facff238f: Already exists 
ebbcacd28e10: Already exists 
c7fb3351ecad: Already exists 
2e3debadcbf7: Already exists 
9d41bf765053: Already exists 
b032b67ae8c0: Already exists 
f0ca0f007bc1: Already exists 
a3fbaa8d0330: Already exists 
8d1ee91d6b9b: Already exists 
07f5a0daf889: Already exists 
844ed628e006: Pull complete 
fedac359abb2: Pull complete 
d3bbb12dcd7a: Pull complete 
d51865d3bf17: Pull complete 
f8268f466392: Pull complete 
81458ef137c3: Pull complete 
35b5befa520c: Pull complete 
76e4e385dfc1: Pull complete 
389f70da86d2: Pull complete 
a2f9ec6d50f0: Pull complete 
bdfbace07bda: Pull complete 
f8aa731f37d7: Pull complete 
6de061258af5: Pull complete 
c936b1b29cae: Pull complete 
a14b932d1362: Pull complete 
2e870e219b9a: Pull complete 
b421266e5bd7: Pull complete 
e3f899f7462b: Pull complete 
dead032ae4e1: Pull complete 
38b5148bb95d: Pull complete 
049707f48c29: Pull complete 
61ba6fbe1f6a: Pull complete 
bbec11a8049d: Pull complete 
1b9130fdbc6e: Pull complete 
d2cccfae9ad6: Pull complete 
542f108dedcf: Pull complete 
fbe2b7aa5d49: Pull complete 
23c3b3f0afdb: Pull complete 
6ca608281fdf: Pull complete 
771ebe0dd4be: Pull complete 
1f26185070ab: Pull complete 
Digest: sha256:0bd083fca178923714050ed2578592e25d75a6b9e071904f987a47477ad9aa4e
Status: Downloaded newer image for mirekphd/tst-ml-gpu-py36-cuda8-failing:001766c55ca8

[root@mx01 ml-gpu-py36-cuda90]# docker run -it --rm --name test -u 0 mirekphd/tst-ml-gpu-py36-cuda8-failing:001766c55ca8 bash

pip install scipy
root@2f62b221038e:/# pip install scipy
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Requirement already satisfied: numpy>=1.8.2 in /opt/conda/lib/python3.6/site-packages (from scipy) (1.15.2)
Exception:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in _dep_map
    return self.__dep_map
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2663, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1632, in parseString
    raise exc
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1622, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3183, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2949, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'; extra '"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 141, in main
    status = self.run(options, args)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 330, in run
    self._warn_about_conflicts(to_install)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 456, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 98, in check_install_conflicts
    package_set = create_package_set_from_installed()
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 41, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2607, in requires
    dm = self._dep_map
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2871, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2881, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in parse_requirements
    yield Requirement(line)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2951, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'; extra '"

root@2f62b221038e:/# sudo pip3 install --upgrade pip
sudo: pip3: command not found

root@2f62b221038e:/# sudo pip install --upgrade pip
sudo: pip: command not found

root@2f62b221038e:/# pip install --upgrade pip
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip
  Downloading https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 12.9MB/s 
Collecting first
  Downloading https://files.pythonhosted.org/packages/71/12/1b24a85f543658804027de982f7e5cb80543ea33ec396c887c099c75274c/first-2.0.1-py2.py3-none-any.whl
Exception:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in _dep_map
    return self.__dep_map
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2663, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1632, in parseString
    raise exc
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1622, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3183, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2949, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'; extra '"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 141, in main
    status = self.run(options, args)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 330, in run
    self._warn_about_conflicts(to_install)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 456, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 98, in check_install_conflicts
    package_set = create_package_set_from_installed()
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 41, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2607, in requires
    dm = self._dep_map
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2871, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2881, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in parse_requirements
    yield Requirement(line)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2951, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'; extra '"
root@2f62b221038e:/# pip install scipy
The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: scipy in /opt/conda/lib/python3.6/site-packages (1.1.0)
Requirement already satisfied: numpy>=1.8.2 in /opt/conda/lib/python3.6/site-packages (from scipy) (1.15.2)
Exception:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in _dep_map
    return self.__dep_map
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2663, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1632, in parseString
    raise exc
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1622, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3183, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2949, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'; extra '"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 141, in main
    status = self.run(options, args)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 330, in run
    self._warn_about_conflicts(to_install)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 456, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 98, in check_install_conflicts
    package_set = create_package_set_from_installed()
  File "/opt/conda/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 41, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2607, in requires
    dm = self._dep_map
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2871, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2881, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in parse_requirements
    yield Requirement(line)
  File "/opt/conda/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2951, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'; extra '"
root@2f62b221038e:/# 

@Juanlu001

This comment has been minimized.

Copy link

Juanlu001 commented Oct 9, 2018

Apart from the situation with conda, we were hit by this issue when trying to use a PEP 508 URL requirement in an extras_require section (see #5788 (comment)). To debug this issue, we had to insert a pdb.set_trace() in pip/_vendor/packaging/requirements.py, so I totally agree with @takluyver here:

But I'd say the bigger issue is that pip should handle the situation a bit more gracefully.

Perhaps it should print the full problematic line and hide the useless _DistInfoDistribution__dep_map error?

bors bot added a commit to mozilla/normandy that referenced this issue Feb 7, 2019

Merge #1723
1723: Scheduled weekly dependency update for week 05 r=mythmon a=pyup-bot






### Update [atomicwrites](https://pypi.org/project/atomicwrites) from **1.2.1** to **1.3.0**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/atomicwrites
  - Repo: https://github.com/untitaker/python-atomicwrites
</details>





### Update [botocore](https://pypi.org/project/botocore) from **1.12.82** to **1.12.86**.


<details>
  <summary>Changelog</summary>
  
  
   ### 1.12.86
   ```
   =======

* api-change:``devicefarm``: Update devicefarm client to latest version
* api-change:``codecommit``: Update codecommit client to latest version
* api-change:``medialive``: Update medialive client to latest version
* api-change:``mediaconnect``: Update mediaconnect client to latest version
   ```
   
  
  
   ### 1.12.85
   ```
   =======

* api-change:``logs``: Update logs client to latest version
* api-change:``elbv2``: Update elbv2 client to latest version
* api-change:``rds``: Update rds client to latest version
* api-change:``codebuild``: Update codebuild client to latest version
* api-change:``sms-voice``: Update sms-voice client to latest version
* api-change:``ecr``: Update ecr client to latest version
   ```
   
  
  
   ### 1.12.84
   ```
   =======

* api-change:``worklink``: Update worklink client to latest version
* api-change:``apigatewaymanagementapi``: Update apigatewaymanagementapi client to latest version
* api-change:``acm-pca``: Update acm-pca client to latest version
   ```
   
  
  
   ### 1.12.83
   ```
   =======

* api-change:``appstream``: Update appstream client to latest version
* api-change:``discovery``: Update discovery client to latest version
* api-change:``dms``: Update dms client to latest version
* api-change:``fms``: Update fms client to latest version
* api-change:``ssm``: Update ssm client to latest version
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/botocore
  - Changelog: https://pyup.io/changelogs/botocore/
  - Repo: https://github.com/boto/botocore
</details>





### Update [Faker](https://pypi.org/project/Faker) from **1.0.1** to **1.0.2**.


<details>
  <summary>Changelog</summary>
  
  
   ### 1.0.2
   ```
   --------------------------------------------------------------------------------------

* Fix state abbreviations for ``id_ID`` to be 2-letters. Thanks dt-ap.
* Fix format for ``city_with_postcode`` on ``de_DE`` locale. Thanks TZanke.
* Update ``person`` providers for ``zh_CN``. Thanks TimeFinger.
* Implement ``zipcode_in_state`` and aliases in ``en_US`` locale for generating
  a zipcode for a specified state. Thanks mattyg.
* Group first names by gender on ``zh_CN`` provider. Thanks TimeFinger.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/faker
  - Changelog: https://pyup.io/changelogs/faker/
  - Repo: https://github.com/joke2k/faker
</details>





### Update [pycodestyle](https://pypi.org/project/pycodestyle) from **2.4.0** to **2.5.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 2.5.0
   ```
   ------------------

New checks:

* E117: Over-indented code blocks
* W505: Maximum doc-string length only when configured with --max-doc-length

Changes:

* Remove support for EOL Python 2.6 and 3.3. PR 720.
* Add E117 error for over-indented code blocks.
* Allow W605 to be silenced by ` noqa` and fix the position reported by W605
* Allow users to omit blank lines around one-liner definitions of classes and
  functions
* Include the function return annotation (``-&gt;``) as requiring surrounding
  whitespace only on Python 3
* Verify that only names can follow ``await``. Previously we allowed numbers
  and strings.
* Add support for Python 3.7
* Fix detection of annotated argument defaults for E252
* Cprrect the position reported by W504
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pycodestyle
  - Changelog: https://pyup.io/changelogs/pycodestyle/
  - Docs: https://pycodestyle.readthedocs.io/
</details>





### Update [pyflakes](https://pypi.org/project/pyflakes) from **2.0.0** to **2.1.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 2.1.0
   ```
   - Allow intentional assignment to variables named ``_``
- Recognize ``__module__`` as a valid name in class scope
- ``pyflakes.checker.Checker`` supports checking of partial ``ast`` trees
- Detect assign-before-use for local variables which shadow builtin names
- Detect invalid ``print`` syntax using ``&gt;&gt;`` operator
- Treat ``async for`` the same as a ``for`` loop for introducing variables
- Add detection for list concatenation in ``__all__``
- Exempt ``typing.overload`` from duplicate function declaration
- Importing a submodule of an ``as``-aliased ``import``-import is marked as
  used
- Report undefined names from ``__all__`` as possibly coming from a ``*``
  import
- Add support for changes in Python 3.8-dev
- Add support for PEP 563 (``from __future__ import annotations``)
- Include Python version and platform information in ``pyflakes --version``
- Recognize ``__annotations__`` as a valid magic global in Python 3.6+
- Mark names used in PEP 484 `` type: ...`` comments as used
- Add check for use of ``is`` operator with ``str``, ``bytes``, and ``int``
  literals
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pyflakes
  - Changelog: https://pyup.io/changelogs/pyflakes/
  - Repo: https://github.com/PyCQA/pyflakes
</details>





### Update [setuptools](https://pypi.org/project/setuptools) from **40.6.3** to **40.7.3**.


<details>
  <summary>Changelog</summary>
  
  
   ### 40.7.3
   ```
   -------

* 1670: In package_index, revert to using a copy of splituser from Python 3.8. Attempts to use ``urllib.parse.urlparse`` led to problems as reported in 1663 and 1668. This change serves as an alternative to 1499 and fixes 1668.
   ```
   
  
  
   ### 40.7.2
   ```
   -------

* 1666: Restore port in URL handling in package_index.
   ```
   
  
  
   ### 40.7.1
   ```
   -------

* 1660: On Python 2, when reading config files, downcast options from text to bytes to satisfy distutils expectations.
   ```
   
  
  
   ### 40.7.0
   ```
   -------

* 1551: File inputs for the `license` field in `setup.cfg` files now explicitly raise an error.
* 1180: Add support for non-ASCII in setup.cfg (1062). Add support for native strings on some parameters (1136).
* 1499: ``setuptools.package_index`` no longer relies on the deprecated ``urllib.parse.splituser`` per Python 27485.
* 1544: Added tests for PackageIndex.download (for git URLs).
* 1625: In PEP 517 build_meta builder, ensure that sdists are built as gztar per the spec.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/setuptools
  - Changelog: https://pyup.io/changelogs/setuptools/
  - Repo: https://github.com/pypa/setuptools
</details>





### Update [cachetools](https://pypi.org/project/cachetools) from **3.0.0** to **3.1.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 3.1.0
   ```
   -------------------

- Fix Python 3.8 compatibility issue.

- Use ``time.monotonic`` as default timer if available.

- Improve documentation regarding thread safety.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/cachetools
  - Changelog: https://pyup.io/changelogs/cachetools/
  - Repo: https://github.com/tkem/cachetools
</details>





### Update [boto3](https://pypi.org/project/boto3) from **1.9.82** to **1.9.86**.


<details>
  <summary>Changelog</summary>
  
  
   ### 1.9.86
   ```
   ======

* api-change:``devicefarm``: [``botocore``] Update devicefarm client to latest version
* api-change:``codecommit``: [``botocore``] Update codecommit client to latest version
* api-change:``medialive``: [``botocore``] Update medialive client to latest version
* api-change:``mediaconnect``: [``botocore``] Update mediaconnect client to latest version
   ```
   
  
  
   ### 1.9.85
   ```
   ======

* api-change:``logs``: [``botocore``] Update logs client to latest version
* api-change:``elbv2``: [``botocore``] Update elbv2 client to latest version
* api-change:``rds``: [``botocore``] Update rds client to latest version
* api-change:``codebuild``: [``botocore``] Update codebuild client to latest version
* api-change:``sms-voice``: [``botocore``] Update sms-voice client to latest version
* api-change:``ecr``: [``botocore``] Update ecr client to latest version
   ```
   
  
  
   ### 1.9.84
   ```
   ======

* api-change:``worklink``: [``botocore``] Update worklink client to latest version
* api-change:``apigatewaymanagementapi``: [``botocore``] Update apigatewaymanagementapi client to latest version
* api-change:``acm-pca``: [``botocore``] Update acm-pca client to latest version
   ```
   
  
  
   ### 1.9.83
   ```
   ======

* api-change:``appstream``: [``botocore``] Update appstream client to latest version
* api-change:``discovery``: [``botocore``] Update discovery client to latest version
* api-change:``dms``: [``botocore``] Update dms client to latest version
* api-change:``fms``: [``botocore``] Update fms client to latest version
* api-change:``ssm``: [``botocore``] Update ssm client to latest version
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/boto3
  - Changelog: https://pyup.io/changelogs/boto3/
  - Repo: https://github.com/boto/boto3
</details>





### Update [flake8](https://pypi.org/project/flake8) from **3.6.0** to **3.7.5**.


<details>
  <summary>Changelog</summary>
  
  
   ### 3.7.5
   ```
   -------------------

You can view the `3.7.5 milestone`_ on GitLab for more details.

Bugs Fixed
~~~~~~~~~~

- Fix reporting of pyflakes &quot;referenced before assignment&quot; error (See also
  `GitLab!301`_, `GitLab503`_)


.. all links
.. _3.7.5 milestone:
    https://gitlab.com/pycqa/flake8/milestones/28

.. issue links
.. _GitLab503:
    https://gitlab.com/pycqa/flake8/issues/503

.. merge request links
.. _GitLab!301:
    https://gitlab.com/pycqa/flake8/merge_requests/301
   ```
   
  
  
   ### 3.7.4
   ```
   -------------------

You can view the `3.7.4 milestone`_ on GitLab for more details.

Bugs Fixed
~~~~~~~~~~

- Fix performance regression with lots of ``per-file-ignores`` and errors
  (See also `GitLab!299`_, `GitLab501`_)


.. all links
.. _3.7.4 milestone:
    https://gitlab.com/pycqa/flake8/milestones/27

.. issue links
.. _GitLab501:
    https://gitlab.com/pycqa/flake8/issues/501

.. merge request links
.. _GitLab!299:
    https://gitlab.com/pycqa/flake8/merge_requests/299
   ```
   
  
  
   ### 3.7.3
   ```
   -------------------

You can view the `3.7.3 milestone`_ on GitLab for more details.

Bugs Fixed
~~~~~~~~~~

- Fix imports of ``typing`` in python 3.5.0 / 3.5.1 (See also `GitLab!294`_,
  `GitLab498`_)

- Fix ``flake8 --statistics`` (See also `GitLab!295`_, `GitLab499`_)

- Gracefully ignore ``flake8-per-file-ignores`` plugin if installed (See also
  `GitLab!297`_, `GitLab495`_)

- Improve error message for malformed ``per-file-ignores`` (See also
  `GitLab!298`_, `GitLab489`_)


.. all links
.. _3.7.3 milestone:
    https://gitlab.com/pycqa/flake8/milestones/26

.. issue links
.. _GitLab489:
    https://gitlab.com/pycqa/flake8/issues/489
.. _GitLab495:
    https://gitlab.com/pycqa/flake8/issues/495
.. _GitLab498:
    https://gitlab.com/pycqa/flake8/issues/498
.. _GitLab499:
    https://gitlab.com/pycqa/flake8/issues/499

.. merge request links
.. _GitLab!294:
    https://gitlab.com/pycqa/flake8/merge_requests/294
.. _GitLab!295:
    https://gitlab.com/pycqa/flake8/merge_requests/295
.. _GitLab!297:
    https://gitlab.com/pycqa/flake8/merge_requests/297
.. _GitLab!298:
    https://gitlab.com/pycqa/flake8/merge_requests/298
   ```
   
  
  
   ### 3.7.2
   ```
   -------------------

You can view the `3.7.2 milestone`_ on GitLab for more details.

Bugs Fixed
~~~~~~~~~~

- Fix broken ``flake8 --diff`` (regressed in 3.7.0) (See also `GitLab!292`_,
  `GitLab490`_)

- Fix typo in plugin exception reporting (See also `GitLab!275`_,
  `GitLab491`_)

- Fix ``AttributeError`` while attempting to use the legacy api (regressed in
  3.7.0) (See also `GitLab!293`_, `GitLab497`_)

.. all links
.. _3.7.2 milestone:
    https://gitlab.com/pycqa/flake8/milestones/25

.. issue links
.. _GitLab490:
    https://gitlab.com/pycqa/flake8/issues/490
.. _GitLab491:
    https://gitlab.com/pycqa/flake8/issues/491
.. _GitLab497:
    https://gitlab.com/pycqa/flake8/issues/497

.. merge request links
.. _GitLab!292:
    https://gitlab.com/pycqa/flake8/merge_requests/292
.. _GitLab!275:
    https://gitlab.com/pycqa/flake8/merge_requests/275
.. _GitLab!293:
    https://gitlab.com/pycqa/flake8/merge_requests/293
   ```
   
  
  
   ### 3.7.1
   ```
   -------------------

You can view the `3.7.1 milestone`_ on GitLab for more details.

Bugs Fixed
~~~~~~~~~~

- Fix capitalized filenames in ``per-file-ignores`` setting (See also
  `GitLab!290`_, `GitLab488`_)

.. all links
.. _3.7.1 milestone:
    https://gitlab.com/pycqa/flake8/milestones/24

.. issue links
.. _GitLab488:
    https://gitlab.com/pycqa/flake8/issues/488

.. merge request links
.. _GitLab!290:
    https://gitlab.com/pycqa/flake8/merge_requests/290
   ```
   
  
  
   ### 3.7.0
   ```
   -------------------

You can view the `3.7.0 milestone`_ on GitLab for more details.

New Dependency Information
~~~~~~~~~~~~~~~~~~~~~~~~~~

- Add dependency on ``entrypoints`` &gt;= 0.3, &lt; 0.4 (See also `GitLab!264`_,
  `GitLab!288`_)

- Pyflakes has been updated to &gt;= 2.1.0, &lt; 2.2.0 (See also `GitLab!283`_,
  `GitLab!285`_)

- pycodestyle has been updated to &gt;= 2.5.0, &lt; 2.6.0 (See also `GitLab!287`_)

Features
~~~~~~~~

- Add support for ``per-file-ignores`` (See also `GitLab!259`_, `GitLab156`_,
  `GitLab!281`_, `GitLab471`_)

- Enable use of ``float`` and ``complex`` option types (See also `GitLab!261`_,
  `GitLab452`_)

- Improve startup performance by switching from ``pkg_resources`` to
  ``entrypoints`` (See also `GitLab!264`_)

- Add metadata for use through the `pre-commit`_ git hooks framework (See also
  `GitLab!268`_, `GitLab!284`_)

- Allow physical line checks to return more than one result (See also
  `GitLab!269`_)

- Allow `` noqa:X123`` comments without space between the colon and codes
  list (See also `GitLab!273`_, `GitLab470`_)

- Remove broken and unused ``flake8.listen`` plugin type (See also
  `GitLab!274`_, `GitLab480`_)

.. all links
.. _3.7.0 milestone:
    https://gitlab.com/pycqa/flake8/milestones/23
.. _pre-commit:
    https://pre-commit.com/

.. issue links
.. _GitLab156:
    https://gitlab.com/pycqa/flake8/issues/156
.. _GitLab452:
    https://gitlab.com/pycqa/flake8/issues/452
.. _GitLab470:
    https://gitlab.com/pycqa/flake8/issues/470
.. _GitLab471:
    https://gitlab.com/pycqa/flake8/issues/471
.. _GitLab480:
    https://gitlab.com/pycqa/flake8/issues/480

.. merge request links
.. _GitLab!259:
    https://gitlab.com/pycqa/flake8/merge_requests/259
.. _GitLab!261:
    https://gitlab.com/pycqa/flake8/merge_requests/261
.. _GitLab!264:
    https://gitlab.com/pycqa/flake8/merge_requests/264
.. _GitLab!268:
    https://gitlab.com/pycqa/flake8/merge_requests/268
.. _GitLab!269:
    https://gitlab.com/pycqa/flake8/merge_requests/269
.. _GitLab!273:
    https://gitlab.com/pycqa/flake8/merge_requests/273
.. _GitLab!274:
    https://gitlab.com/pycqa/flake8/merge_requests/274
.. _GitLab!281:
    https://gitlab.com/pycqa/flake8/merge_requests/281
.. _GitLab!283:
    https://gitlab.com/pycqa/flake8/merge_requests/283
.. _GitLab!284:
    https://gitlab.com/pycqa/flake8/merge_requests/284
.. _GitLab!285:
    https://gitlab.com/pycqa/flake8/merge_requests/285
.. _GitLab!287:
    https://gitlab.com/pycqa/flake8/merge_requests/287
.. _GitLab!288:
    https://gitlab.com/pycqa/flake8/merge_requests/288
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/flake8
  - Changelog: https://pyup.io/changelogs/flake8/
  - Repo: https://gitlab.com/pycqa/flake8
</details>





### Update [newrelic](https://pypi.org/project/newrelic) from **4.10.0.112** to **4.12.0.113**.


<details>
  <summary>Changelog</summary>
  
  
   ### 4.12.0.113
   ```
   This release of the Python agent extends support of Amazon&#39;s boto3 library and includes bug fixes.

The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from the New Relic download site.

Features


AWS operation and request ID will now be reported in transaction traces and
spans when using boto3 and botocore.

The agent will now report aws.requestId and aws.operation for all calls
to AWS made using botocore and boto3.
DynamoDB calls are now reported under the Databases tab.

The agent will now record DynamoDB query performance in the Databases tab in
APM in addition to table name for the following calls:


put_item
get_item
update_item
delete_item
create_table
delete_table
query
scan

Certain SQS calls will now report additional data for spans and transaction
traces.

The agent will now record the queue name in spans and transaction traces for
the following SQS calls:


send_message
send_message_batch
receive_message

SNS publish will now report additional data for spans and transaction traces.

The SNS topic, target, or the string literal PhoneNumber will be reported to
New Relic inside of spans and transaction traces.
The full URL path will now be recorded on span events and transaction traces
when using boto3 or botocore.

The agent will now record the full URL path for API calls made to AWS through
the boto3 / botocore libraries. The path will be available through span
events and transaction traces.


Bug Fixes


Using newrelic-admin to start a GunicornWebWorker with an application factory
resulted in an application crash.

The agent would fail to start if using the newrelic-admin command to start an
aiohttp application factory with GunicornWebWorker. This issue has now been
fixed.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/newrelic
  - Changelog: https://pyup.io/changelogs/newrelic/
  - Homepage: http://newrelic.com/docs/python/new-relic-for-python
</details>





### Update [psycopg2](https://pypi.org/project/psycopg2) from **2.7.6.1** to **2.7.7**.


<details>
  <summary>Changelog</summary>
  
  
   ### 2.7.7
   ```
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Cleanup of the cursor results assignment code, which might have solved
  double free and inconsistencies in concurrent usage (🎟`346, 384`).
- Wheel package compiled against OpenSSL 1.0.2q.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/psycopg2
  - Changelog: https://pyup.io/changelogs/psycopg2/
  - Homepage: http://initd.org/psycopg/
</details>





### Update [pyasn1-modules](https://pypi.org/project/pyasn1-modules) from **0.2.3** to **0.2.4**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pyasn1-modules
  - Changelog: https://pyup.io/changelogs/pyasn1-modules/
  - Repo: https://github.com/etingof/pyasn1-modules
</details>





### Update [pytest-django](https://pypi.org/project/pytest-django) from **3.4.5** to **3.4.7**.


<details>
  <summary>Changelog</summary>
  
  
   ### 3.4.7
   ```
   ------------------

Bugfixes
^^^^^^^^

* Fix disabling/handling of unittest methods with pytest 4.2+ (700)
   ```
   
  
  
   ### 3.4.6
   ```
   ------------------

Bugfixes
^^^^^^^^

* django_find_project: add cwd as fallback always (690)

Misc
^^^^

* Enable tests for Django 2.2 and add classifier (693)
* Disallow pytest 4.2.0 in ``install_requires`` (697)
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest-django
  - Changelog: https://pyup.io/changelogs/pytest-django/
  - Docs: https://pytest-django.readthedocs.io/
</details>





### Update [pytest](https://pypi.org/project/pytest) from **4.1.1** to **4.2.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 4.2.0
   ```
   =========================

Features
--------

- `3094 &lt;https://github.com/pytest-dev/pytest/issues/3094&gt;`_: `Class xunit-style &lt;https://docs.pytest.org/en/latest/xunit_setup.html&gt;`__ functions and methods
  now obey the scope of *autouse* fixtures.

  This fixes a number of surprising issues like ``setup_method`` being called before session-scoped
  autouse fixtures (see `517 &lt;https://github.com/pytest-dev/pytest/issues/517&gt;`__ for an example).


- `4627 &lt;https://github.com/pytest-dev/pytest/issues/4627&gt;`_: Display a message at the end of the test session when running under Python 2.7 and 3.4 that pytest 5.0 will no longer
  support those Python versions.


- `4660 &lt;https://github.com/pytest-dev/pytest/issues/4660&gt;`_: The number of *selected* tests now are also displayed when the ``-k`` or ``-m`` flags are used.


- `4688 &lt;https://github.com/pytest-dev/pytest/issues/4688&gt;`_: ``pytest_report_teststatus`` hook now can also receive a ``config`` parameter.


- `4691 &lt;https://github.com/pytest-dev/pytest/issues/4691&gt;`_: ``pytest_terminal_summary`` hook now can also receive a ``config`` parameter.



Bug Fixes
---------

- `3547 &lt;https://github.com/pytest-dev/pytest/issues/3547&gt;`_: ``--junitxml`` can emit XML compatible with Jenkins xUnit.
  ``junit_family`` INI option accepts ``legacy|xunit1``, which produces old style output, and ``xunit2`` that conforms more strictly to https://github.com/jenkinsci/xunit-plugin/blob/xunit-2.3.2/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd


- `4280 &lt;https://github.com/pytest-dev/pytest/issues/4280&gt;`_: Improve quitting from pdb, especially with ``--trace``.

  Using ``q[quit]`` after ``pdb.set_trace()`` will quit pytest also.


- `4402 &lt;https://github.com/pytest-dev/pytest/issues/4402&gt;`_: Warning summary now groups warnings by message instead of by test id.

  This makes the output more compact and better conveys the general idea of how much code is
  actually generating warnings, instead of how many tests call that code.


- `4536 &lt;https://github.com/pytest-dev/pytest/issues/4536&gt;`_: ``monkeypatch.delattr`` handles class descriptors like ``staticmethod``/``classmethod``.


- `4649 &lt;https://github.com/pytest-dev/pytest/issues/4649&gt;`_: Restore marks being considered keywords for keyword expressions.


- `4653 &lt;https://github.com/pytest-dev/pytest/issues/4653&gt;`_: ``tmp_path`` fixture and other related ones provides resolved path (a.k.a real path)


- `4667 &lt;https://github.com/pytest-dev/pytest/issues/4667&gt;`_: ``pytest_terminal_summary`` uses result from ``pytest_report_teststatus`` hook, rather than hardcoded strings.


- `4669 &lt;https://github.com/pytest-dev/pytest/issues/4669&gt;`_: Correctly handle ``unittest.SkipTest`` exception containing non-ascii characters on Python 2.


- `4680 &lt;https://github.com/pytest-dev/pytest/issues/4680&gt;`_: Ensure the ``tmpdir`` and the ``tmp_path`` fixtures are the same folder.


- `4681 &lt;https://github.com/pytest-dev/pytest/issues/4681&gt;`_: Ensure ``tmp_path`` is always a real path.



Trivial/Internal Changes
------------------------

- `4643 &lt;https://github.com/pytest-dev/pytest/issues/4643&gt;`_: Use ``a.item()`` instead of the deprecated ``np.asscalar(a)`` in ``pytest.approx``.

  ``np.asscalar`` has been `deprecated &lt;https://github.com/numpy/numpy/blob/master/doc/release/1.16.0-notes.rstnew-deprecations&gt;`__ in ``numpy 1.16.``.


- `4657 &lt;https://github.com/pytest-dev/pytest/issues/4657&gt;`_: Copy saferepr from pylib
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest
  - Changelog: https://pyup.io/changelogs/pytest/
  - Homepage: https://docs.pytest.org/en/latest/
</details>





### Update [pytest-mock](https://pypi.org/project/pytest-mock) from **1.10.0** to **1.10.1**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest-mock
  - Changelog: https://pyup.io/changelogs/pytest-mock/
  - Repo: https://github.com/pytest-dev/pytest-mock/
</details>





### Update [Sphinx](https://pypi.org/project/Sphinx) from **1.8.3** to **1.8.4**.


<details>
  <summary>Changelog</summary>
  
  
   ### 1.8.4
   ```
   =====================================

Bugs fixed
----------

* 3707: latex: no bold checkmark (✔) available.
* 5605: with the documentation language set to Chinese, English words could not
  be searched.
* 5889: LaTeX: user ``numfig_format`` is stripped of spaces and may cause
  build failure
* C++, fix hyperlinks for declarations involving east cv-qualifiers.
* 5755: C++, fix duplicate declaration error on function templates with constraints
  in the return type.
* C++, parse unary right fold expressions and binary fold expressions.
* pycode could not handle egg files on windows
* 5928: KeyError: &#39;DOCUTILSCONFIG&#39; when running build
* 5936: LaTeX: PDF build broken by inclusion of image taller than page height
  in an admonition
* 5231: &quot;make html&quot; does not read and build &quot;po&quot; files in &quot;locale&quot; dir
* 5954: ``:scale:`` image option may break PDF build if image in an admonition
* 5966: mathjax has not been loaded on incremental build
* 5960: LaTeX: modified PDF layout since September 2018 TeXLive update of
  :file:`parskip.sty`
* 5948: LaTeX: duplicated labels are generated for sections
* 5958: versionadded directive causes crash with Python 3.5.0
* 5995: autodoc: autodoc_mock_imports conflict with metaclass on Python 3.7
* 5871: texinfo: a section title ``.`` is not allowed
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/sphinx
  - Changelog: https://pyup.io/changelogs/sphinx/
  - Homepage: http://sphinx-doc.org/
</details>





### Update [pip](https://pypi.org/project/pip) from **18.1** to **19.0.1**.


<details>
  <summary>Changelog</summary>
  
  
   ### 19.0
   ```
   =================

Deprecations and Removals
-------------------------

- Deprecate support for Python 3.4 (`6106 &lt;https://github.com/pypa/pip/issues/6106&gt;`_)
- Start printing a warning for Python 2.7 to warn of impending Python 2.7 End-of-life and
  prompt users to start migrating to Python 3. (`6148 &lt;https://github.com/pypa/pip/issues/6148&gt;`_)
- Remove the deprecated ``--process-dependency-links`` option. (`6060 &lt;https://github.com/pypa/pip/issues/6060&gt;`_)
- Remove the deprecated SVN editable detection based on dependency links
  during freeze. (`5866 &lt;https://github.com/pypa/pip/issues/5866&gt;`_)

Features
--------

- Implement PEP 517 (allow projects to specify a build backend via pyproject.toml). (`5743 &lt;https://github.com/pypa/pip/issues/5743&gt;`_)
- Implement manylinux2010 platform tag support.  manylinux2010 is the successor
  to manylinux1.  It allows carefully compiled binary wheels to be installed
  on compatible Linux platforms. (`5008 &lt;https://github.com/pypa/pip/issues/5008&gt;`_)
- Improve build isolation: handle ``.pth`` files, so namespace packages are correctly supported under Python 3.2 and earlier. (`5656 &lt;https://github.com/pypa/pip/issues/5656&gt;`_)
- Include the package name in a freeze warning if the package is not installed. (`5943 &lt;https://github.com/pypa/pip/issues/5943&gt;`_)
- Warn when dropping an ``--[extra-]index-url`` value that points to an existing local directory. (`5827 &lt;https://github.com/pypa/pip/issues/5827&gt;`_)
- Prefix pip&#39;s ``--log`` file lines with their timestamp. (`6141 &lt;https://github.com/pypa/pip/issues/6141&gt;`_)

Bug Fixes
---------

- Avoid creating excessively long temporary paths when uninstalling packages. (`3055 &lt;https://github.com/pypa/pip/issues/3055&gt;`_)
- Redact the password from the URL in various log messages. (`4746 &lt;https://github.com/pypa/pip/issues/4746&gt;`_, `6124 &lt;https://github.com/pypa/pip/issues/6124&gt;`_)
- Avoid creating excessively long temporary paths when uninstalling packages. (`3055 &lt;https://github.com/pypa/pip/issues/3055&gt;`_)
- Avoid printing a stack trace when given an invalid requirement. (`5147 &lt;https://github.com/pypa/pip/issues/5147&gt;`_)
- Present 401 warning if username/password do not work for URL (`4833 &lt;https://github.com/pypa/pip/issues/4833&gt;`_)
- Handle ``requests.exceptions.RetryError`` raised in ``PackageFinder`` that was causing pip to fail silently when some indexes were unreachable. (`5270 &lt;https://github.com/pypa/pip/issues/5270&gt;`_, `5483 &lt;https://github.com/pypa/pip/issues/5483&gt;`_)
- Handle a broken stdout pipe more gracefully (e.g. when running ``pip list | head``). (`4170 &lt;https://github.com/pypa/pip/issues/4170&gt;`_)
- Fix crash from setting ``PIP_NO_CACHE_DIR=yes``. (`5385 &lt;https://github.com/pypa/pip/issues/5385&gt;`_)
- Fix crash from unparseable requirements when checking installed packages. (`5839 &lt;https://github.com/pypa/pip/issues/5839&gt;`_)
- Fix content type detection if a directory named like an archive is used as a package source. (`5838 &lt;https://github.com/pypa/pip/issues/5838&gt;`_)
- Fix listing of outdated packages that are not dependencies of installed packages in ``pip list --outdated --not-required`` (`5737 &lt;https://github.com/pypa/pip/issues/5737&gt;`_)
- Fix sorting ``TypeError`` in ``move_wheel_files()`` when installing some packages. (`5868 &lt;https://github.com/pypa/pip/issues/5868&gt;`_)
- Fix support for invoking pip using ``python src/pip ...``. (`5841 &lt;https://github.com/pypa/pip/issues/5841&gt;`_)
- Greatly reduce memory usage when installing wheels containing large files. (`5848 &lt;https://github.com/pypa/pip/issues/5848&gt;`_)
- Editable non-VCS installs now freeze as editable. (`5031 &lt;https://github.com/pypa/pip/issues/5031&gt;`_)
- Editable Git installs without a remote now freeze as editable. (`4759 &lt;https://github.com/pypa/pip/issues/4759&gt;`_)
- Canonicalize sdist file names so they can be matched to a canonicalized package name passed to ``pip install``. (`5870 &lt;https://github.com/pypa/pip/issues/5870&gt;`_)
- Properly decode special characters in SVN URL credentials. (`5968 &lt;https://github.com/pypa/pip/issues/5968&gt;`_)
- Make ``PIP_NO_CACHE_DIR`` disable the cache also for truthy values like ``&quot;true&quot;``, ``&quot;yes&quot;``, ``&quot;1&quot;``, etc. (`5735 &lt;https://github.com/pypa/pip/issues/5735&gt;`_)

Vendored Libraries
------------------

- Include license text of vendored 3rd party libraries. (`5213 &lt;https://github.com/pypa/pip/issues/5213&gt;`_)
- Update certifi to 2018.11.29
- Update colorama to 0.4.1
- Update distlib to 0.2.8
- Update idna to 2.8
- Update packaging to 19.0
- Update pep517 to 0.5.0
- Update pkg_resources to 40.6.3 (via setuptools)
- Update pyparsing to 2.3.1
- Update pytoml to 0.1.20
- Update requests to 2.21.0
- Update six to 1.12.0
- Update urllib3 to 1.24.1

Improved Documentation
----------------------

- Include the Vendoring Policy in the documentation. (`5958 &lt;https://github.com/pypa/pip/issues/5958&gt;`_)
- Add instructions for running pip from source to Development documentation. (`5949 &lt;https://github.com/pypa/pip/issues/5949&gt;`_)
- Remove references to removed ``egg=&lt;name&gt;-&lt;version&gt;`` functionality (`5888 &lt;https://github.com/pypa/pip/issues/5888&gt;`_)
- Fix omission of command name in HTML usage documentation (`5984 &lt;https://github.com/pypa/pip/issues/5984&gt;`_)
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pip
  - Changelog: https://pyup.io/changelogs/pip/
  - Homepage: https://pip.pypa.io/
</details>







Co-authored-by: pyup-bot <github-bot@pyup.io>
Co-authored-by: Peter Bengtsson <mail@peterbe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment