AttributeError: 'NoneType' object has no attribute 'netloc' · Issue #5889 · pypa/pip (original) (raw)

Environment

Description
I am using a fresh conda environment (most packages from conda-forge), pip 18.1, python 3.6, and linux. I am utilizing the new PEP508 syntax for installing private packages from our internal gitlab server (anonymized below). I added some print statements that I hope will be helpful:

$ pip install -e .
Obtaining file:///nas/home/broot/Programs/tools/catutils
req: shapely
comes_from: catutils==0.15.dev1 from file:///nas/home/broot/Programs/tools/catutils
req: netCDF4
comes_from: catutils==0.15.dev1 from file:///nas/home/broot/Programs/tools/catutils
req: aershp>=0.10
comes_from: catutils==0.15.dev1 from file:///nas/home/broot/Programs/tools/catutils
req: numpy!=1.10,!=1.11.0
comes_from: catutils==0.15.dev1 from file:///nas/home/broot/Programs/tools/catutils
req: scipy
comes_from: catutils==0.15.dev1 from file:///nas/home/broot/Programs/tools/catutils
req: GDAL
comes_from: catutils==0.15.dev1 from file:///nas/home/broot/Programs/tools/catutils
Requirement already satisfied: shapely in /rd22/scratch/broot/miniconda/envs/py3k/lib/python3.6/site-packages (from catutils==0.15.dev1) (1.6.4.post1)
Requirement already satisfied: netCDF4 in /rd22/scratch/broot/miniconda/envs/py3k/lib/python3.6/site-packages (from catutils==0.15.dev1) (1.4.1)
req: numpy>=1.7
comes_from: netCDF4 in /rd22/scratch/broot/miniconda/envs/py3k/lib/python3.6/site-packages (from catutils==0.15.dev1)
req: cftime
comes_from: netCDF4 in /rd22/scratch/broot/miniconda/envs/py3k/lib/python3.6/site-packages (from catutils==0.15.dev1)
Requirement already satisfied: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1) (0.16.dev1)
req: nose
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
req: numpy
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
req: matplotlib<2.2.0
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
req: Shapely
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
req: GDAL
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
req: pyyaml
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
req: jinja2
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
req: scripttest
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
req: netCDF4
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
req: six
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
req: atomic_context@ git+ssh://git@***********.com/common/atomic_context.git@release
comes_from: aershp>=0.10 in /nas/home/broot/Programs/tools/aershp/lib (from catutils==0.15.dev1)
Exception:
Traceback (most recent call last):
  File "/home/broot/scratch/miniconda/envs/py3k/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/home/broot/scratch/miniconda/envs/py3k/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 318, in run
    resolver.resolve(requirement_set)
  File "/home/broot/scratch/miniconda/envs/py3k/lib/python3.6/site-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/home/broot/scratch/miniconda/envs/py3k/lib/python3.6/site-packages/pip/_internal/resolve.py", line 318, in _resolve_one
    add_req(subreq, extras_requested=available_requested)
  File "/home/broot/scratch/miniconda/envs/py3k/lib/python3.6/site-packages/pip/_internal/resolve.py", line 275, in add_req
    wheel_cache=self.wheel_cache,
  File "/home/broot/scratch/miniconda/envs/py3k/lib/python3.6/site-packages/pip/_internal/req/constructors.py", line 290, in install_req_from_req
    if req.url and comes_from.link.netloc in domains_not_allowed:
AttributeError: 'NoneType' object has no attribute 'netloc'

A bit of explanation of my dependency tree. I am installing a package called "catutils". It has a dependency on another private package called "aershp". That package, in turn, has a dependency upon two other private, pure-python, packages called "ncxml" and "atomic_context". I installed "aershp" via "pip install -e .", and it fetched the other two packages from our gitlab server. This failure happened when I tried doing "pip install -e ." for the catutils package.

Some additional insights. I have gone back and reinstalled (pip install -e .) the "atomic_context" and the "ncxml" packages. I then pip uninstall aershp, and then did pip install -e .. This failed for some odd reason:
Could not find a version that satisfies the requirement aershp>=0.10 (from catutils==0.15.dev1) (from versions: )
So, I then did a pip uninstall catutils: which said that it was skipping it because it is not installed (as expected), but then went back to the "aershp" package and redid pip install -e ., and instead of the unsatisfiable error, I got the same error as originally posted above.