Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Version resolution sometimes fails when no previous virtual env exists #2435

Closed
greysteil opened this issue Jun 26, 2018 · 7 comments
Closed

Comments

@greysteil
Copy link
Contributor

greysteil commented Jun 26, 2018

Weird one, but I can reproduce the below consistently. I think it's due to resolution relying on the existing state of the virtualenv, but I could be missing something.

Note: This bug is new in 2018.6.25 - I don't get it in 2018.5.18.

$ python -m pipenv.help output

Pipenv version: '2018.6.26.dev0'

Pipenv location: '/Users/greysteil/code/pipenv/pipenv'

Python location: '/usr/local/opt/python/bin/python3.6'

Other Python installations in PATH:

  • 2.6: /usr/bin/python2.6

  • 2.6: /usr/bin/python2.6

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.6: /usr/local/bin/python3.6m

  • 3.6: /usr/local/bin/python3.6

  • 3.6: /usr/local/bin/python3.6

  • 3.6.5: /usr/local/bin/python

  • 3.6.5: /usr/local/bin/python

  • 2.7.10: /usr/bin/python

  • 3.6.5: /usr/local/bin/python3

  • 3.6.5: /usr/local/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.5',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '16.7.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 16.7.0: Tue Jan 30 11:27:06 PST '
                     '2018; root:xnu-3789.73.11~1/RELEASE_X86_64',
 'python_full_version': '3.6.5',
 'python_version': '3.6',
 'sys_platform': 'darwin'}

System environment variables:

  • TERM_PROGRAM
  • PYENV_ROOT
  • TERM
  • SHELL
  • CLICOLOR
  • TMPDIR
  • Apple_PubSub_Socket_Render
  • TERM_PROGRAM_VERSION
  • OLDPWD
  • TERM_SESSION_ID
  • USER
  • SSH_AUTH_SOCK
  • __CF_USER_TEXT_ENCODING
  • LSCOLORS
  • PATH
  • PWD
  • EDITOR
  • LANG
  • XPC_FLAGS
  • RBENV_SHELL
  • XPC_SERVICE_NAME
  • HOME
  • SHLVL
  • LOGNAME
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/opt/erlang@20/bin:/Users/greysteil/.pyenv/bin:/Users/greysteil/.cargo/bin:/usr/local/heroku/bin:/Users/greysteil/.rbenv/shims:/usr/local/bin:./node_modules/.bin:.bundle/binstubs:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin:/usr/local/sbin
  • SHELL: /bin/bash
  • EDITOR: subl -w
  • LANG: en_GB.UTF-8
  • PWD: /Users/greysteil/code/python-test

Contents of Pipfile ('/Users/greysteil/code/python-test/Pipfile'):

[dev-packages]
coverage = "==4.5.1"
django-nose = "==1.4.5"
flake8 = "==3.5.0"
freezegun = "==0.3.10"
mockredispy = "==2.9.3"
moto = "==1.3.3"
pylint = "==1.9.2"

[requires]
python_version = "2.7"

[[source]]
name = "pypi"
url = "https://pypi.python.org/simple/"
verify_ssl = true

Expected result

Running pyenv exec pipenv lock -v should work fine

Actual result

Running pyenv exec pipenv lock -v produces:

Error details
Locking [dev-packages] dependencies...
using sources: [{u'url': u'https://pypi.python.org/simple/', u'verify_ssl': True, u'name': u'pypi'}]
Using pip: -i https://pypi.python.org/simple/

                          ROUND 1                           
Current constraints:
  coverage==4.5.1 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 2))
  django-nose==1.4.5 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 3))
  flake8==3.5.0 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 4))
  freezegun==0.3.10 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 5))
  mockredispy==2.9.3 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 6))
  moto==1.3.3 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 7))
  pylint==1.9.2 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 8))

Finding the best candidates:
  found candidate coverage==4.5.1 (constraint was ==4.5.1)
  found candidate django-nose==1.4.5 (constraint was ==1.4.5)
  found candidate flake8==3.5.0 (constraint was ==3.5.0)
  found candidate freezegun==0.3.10 (constraint was ==0.3.10)
  found candidate mockredispy==2.9.3 (constraint was ==2.9.3)
  found candidate moto==1.3.3 (constraint was ==1.3.3)
  found candidate pylint==1.9.2 (constraint was ==1.9.2)

Finding secondary dependencies:
  coverage==4.5.1           requires -
  pylint==1.9.2             requires astroid<2.0,>=1.6, backports.functools-lru-cache; python_version == "2.7", configparser; python_version == "2.7", enum34>=1.1.3; python_version < "3.4", futures, isort>=4.2.5, lazy-object-proxy, mccabe, pylint==1.9.2, singledispatch; python_version < "3.4", six, wrapt
  moto==1.3.3               requires asn1crypto>=0.21.0, aws-xray-sdk<0.96,>=0.93, backports.ssl-match-hostname>=3.5; python_version < "3.5", backports.tempfile; python_version < "3.3", backports.weakref, boto3>=1.6.16, boto>=2.36.0, botocore>=1.9.16, certifi>=2017.4.17, cffi>=1.7; platform_python_implementation != "PyPy", chardet<3.1.0,>=3.0.2, cookies, cryptography>=2.0.0, docker-pycreds>=0.3.0, docker>=2.5.1, docutils>=0.10, enum34; python_version < "3", funcsigs>=1; python_version < "3.3", futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7", idna<2.8,>=2.5, ipaddress>=1.0.16; python_version < "3.3", jinja2>=2.7.3, jmespath<1.0.0,>=0.7.1, jsondiff==1.1.1, jsonpickle, markupsafe>=0.23, mock, moto==1.3.3, pbr>=0.11, pyaml, pycparser, python-dateutil<2.7.0,>=2.1, pytz, pyyaml, requests>=2.5, responses, s3transfer<0.2.0,>=0.1.10, six>1.9, urllib3<1.24,>=1.21.1, websocket-client>=0.32.0, werkzeug, wrapt, xmltodict
  mockredispy==2.9.3        requires -
  freezegun==0.3.10         requires python-dateutil!=2.0,>=1.0, six
  django-nose==1.4.5        requires nose>=1.2.1
  flake8==3.5.0             requires configparser; python_version < "3.2", enum34; python_version < "3.4", mccabe<0.7.0,>=0.6.0, pycodestyle<2.4.0,>=2.0.0, pyflakes<1.7.0,>=1.5.0

New dependencies found in this round:
  adding [u'asn1crypto', '>=0.21.0', '[]']
  adding [u'astroid', '<2.0,>=1.6', '[]']
  adding [u'aws-xray-sdk', '<0.96,>=0.93', '[]']
  adding [u'backports.functools-lru-cache', '', '[]']
  adding [u'backports.ssl-match-hostname', '>=3.5', '[]']
  adding [u'backports.tempfile', '', '[]']
  adding [u'backports.weakref', '', '[]']
  adding [u'boto', '>=2.36.0', '[]']
  adding [u'boto3', '>=1.6.16', '[]']
  adding [u'botocore', '>=1.9.16', '[]']
  adding [u'certifi', '>=2017.4.17', '[]']
  adding [u'cffi', '>=1.7', '[]']
  adding [u'chardet', '<3.1.0,>=3.0.2', '[]']
  adding [u'configparser', '', '[]']
  adding [u'cookies', '', '[]']
  adding [u'cryptography', '>=2.0.0', '[]']
  adding [u'docker', '>=2.5.1', '[]']
  adding [u'docker-pycreds', '>=0.3.0', '[]']
  adding [u'docutils', '>=0.10', '[]']
  adding [u'enum34', '>=1.1.3', '[]']
  adding [u'funcsigs', '>=1', '[]']
  adding [u'futures', '<4.0.0,>=2.2.0', '[]']
  adding [u'idna', '<2.8,>=2.5', '[]']
  adding [u'ipaddress', '>=1.0.16', '[]']
  adding [u'isort', '>=4.2.5', '[]']
  adding [u'jinja2', '>=2.7.3', '[]']
  adding [u'jmespath', '<1.0.0,>=0.7.1', '[]']
  adding [u'jsondiff', '==1.1.1', '[]']
  adding [u'jsonpickle', '', '[]']
  adding [u'lazy-object-proxy', '', '[]']
  adding [u'markupsafe', '>=0.23', '[]']
  adding [u'mccabe', '<0.7.0,>=0.6.0', '[]']
  adding [u'mock', '', '[]']
  adding [u'moto', '==1.3.3', '[]']
  adding [u'nose', '>=1.2.1', '[]']
  adding [u'pbr', '>=0.11', '[]']
  adding [u'pyaml', '', '[]']
  adding [u'pycodestyle', '<2.4.0,>=2.0.0', '[]']
  adding [u'pycparser', '', '[]']
  adding [u'pyflakes', '<1.7.0,>=1.5.0', '[]']
  adding [u'pylint', '==1.9.2', '[]']
  adding [u'python-dateutil', '!=2.0,<2.7.0,>=1.0,>=2.1', '[]']
  adding [u'pytz', '', '[]']
  adding [u'pyyaml', '', '[]']
  adding [u'requests', '>=2.5', '[]']
  adding [u'responses', '', '[]']
  adding [u's3transfer', '<0.2.0,>=0.1.10', '[]']
  adding [u'singledispatch', '', '[]']
  adding [u'six', '>1.9', '[]']
  adding [u'urllib3', '<1.24,>=1.21.1', '[]']
  adding [u'websocket-client', '>=0.32.0', '[]']
  adding [u'werkzeug', '', '[]']
  adding [u'wrapt', '', '[]']
  adding [u'xmltodict', '', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2                           
Current constraints:
  asn1crypto>=0.21.0
  astroid<2.0,>=1.6
  aws-xray-sdk<0.96,>=0.93
  backports.functools-lru-cache
  backports.ssl-match-hostname>=3.5
  backports.tempfile
  backports.weakref
  boto>=2.36.0
  boto3>=1.6.16
  botocore>=1.9.16
  certifi>=2017.4.17
  cffi>=1.7
  chardet<3.1.0,>=3.0.2
  configparser
  cookies
  coverage==4.5.1 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 2))
  cryptography>=2.0.0
  django-nose==1.4.5 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 3))
  docker>=2.5.1
  docker-pycreds>=0.3.0
  docutils>=0.10
  enum34>=1.1.3
  flake8==3.5.0 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 4))
  freezegun==0.3.10 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 5))
  funcsigs>=1
  futures<4.0.0,>=2.2.0
  idna<2.8,>=2.5
  ipaddress>=1.0.16
  isort>=4.2.5
  jinja2>=2.7.3
  jmespath<1.0.0,>=0.7.1
  jsondiff==1.1.1
  jsonpickle
  lazy-object-proxy
  markupsafe>=0.23
  mccabe<0.7.0,>=0.6.0
  mock
  mockredispy==2.9.3 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 6))
  moto==1.3.3 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 7))
  nose>=1.2.1
  pbr>=0.11
  pyaml
  pycodestyle<2.4.0,>=2.0.0
  pycparser
  pyflakes<1.7.0,>=1.5.0
  pylint==1.9.2 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 8))
  python-dateutil!=2.0,<2.7.0,>=1.0,>=2.1
  pytz
  pyyaml
  requests>=2.5
  responses
  s3transfer<0.2.0,>=0.1.10
  singledispatch
  six>1.9
  urllib3<1.24,>=1.21.1
  websocket-client>=0.32.0
  werkzeug
  wrapt
  xmltodict

Finding the best candidates:
  found candidate asn1crypto==0.24.0 (constraint was >=0.21.0)
  found candidate astroid==1.6.5 (constraint was >=1.6,<2.0)
  found candidate aws-xray-sdk==0.95 (constraint was >=0.93,<0.96)
  found candidate backports.functools-lru-cache==1.5 (constraint was <any>)
  found candidate backports.ssl-match-hostname==3.5.0.1 (constraint was >=3.5)
  found candidate backports.tempfile==1.0 (constraint was <any>)
  found candidate backports.weakref==1.0.post1 (constraint was <any>)
  found candidate boto==2.48.0 (constraint was >=2.36.0)
  found candidate boto3==1.7.46 (constraint was >=1.6.16)
  found candidate botocore==1.10.46 (constraint was >=1.9.16)
  found candidate certifi==2018.4.16 (constraint was >=2017.4.17)
  found candidate cffi==1.11.5 (constraint was >=1.7)
  found candidate chardet==3.0.4 (constraint was >=3.0.2,<3.1.0)
  found candidate configparser==3.5.0 (constraint was <any>)
  found candidate cookies==2.2.1 (constraint was <any>)
  found candidate coverage==4.5.1 (constraint was ==4.5.1)
  found candidate cryptography==2.2.2 (constraint was >=2.0.0)
  found candidate django-nose==1.4.5 (constraint was ==1.4.5)
  found candidate docker==3.4.0 (constraint was >=2.5.1)
  found candidate docker-pycreds==0.3.0 (constraint was >=0.3.0)
  found candidate docutils==0.14 (constraint was >=0.10)
  found candidate enum34==1.1.6 (constraint was >=1.1.3)
  found candidate flake8==3.5.0 (constraint was ==3.5.0)
  found candidate freezegun==0.3.10 (constraint was ==0.3.10)
  found candidate funcsigs==1.0.2 (constraint was >=1)
  found candidate futures==3.2.0 (constraint was >=2.2.0,<4.0.0)
  found candidate idna==2.7 (constraint was >=2.5,<2.8)
  found candidate ipaddress==1.0.22 (constraint was >=1.0.16)
  found candidate isort==4.3.4 (constraint was >=4.2.5)
  found candidate jinja2==2.10 (constraint was >=2.7.3)
  found candidate jmespath==0.9.3 (constraint was >=0.7.1,<1.0.0)
  found candidate jsondiff==1.1.1 (constraint was ==1.1.1)
  found candidate jsonpickle==0.9.6 (constraint was <any>)
  found candidate lazy-object-proxy==1.3.1 (constraint was <any>)
  found candidate markupsafe==1.0 (constraint was >=0.23)
  found candidate mccabe==0.6.1 (constraint was >=0.6.0,<0.7.0)
  found candidate mock==2.0.0 (constraint was <any>)
  found candidate mockredispy==2.9.3 (constraint was ==2.9.3)
  found candidate moto==1.3.3 (constraint was ==1.3.3)
  found candidate nose==1.3.7 (constraint was >=1.2.1)
  found candidate pbr==4.0.4 (constraint was >=0.11)
  found candidate pyaml==17.12.1 (constraint was <any>)
  found candidate pycodestyle==2.3.1 (constraint was >=2.0.0,<2.4.0)
  found candidate pycparser==2.18 (constraint was <any>)
  found candidate pyflakes==1.6.0 (constraint was >=1.5.0,<1.7.0)
  found candidate pylint==1.9.2 (constraint was ==1.9.2)
  found candidate python-dateutil==2.6.1 (constraint was >=1.0,!=2.0,>=2.1,<2.7.0)
  found candidate pytz==2018.4 (constraint was <any>)
  found candidate pyyaml==4.1 (constraint was <any>)
  found candidate requests==2.19.1 (constraint was >=2.5)
  found candidate responses==0.9.0 (constraint was <any>)
  found candidate s3transfer==0.1.13 (constraint was >=0.1.10,<0.2.0)
  found candidate singledispatch==3.4.0.3 (constraint was <any>)
  found candidate six==1.11.0 (constraint was >1.9)
  found candidate urllib3==1.23 (constraint was >=1.21.1,<1.24)
  found candidate websocket-client==0.48.0 (constraint was >=0.32.0)
  found candidate werkzeug==0.14.1 (constraint was <any>)
  found candidate wrapt==1.10.11 (constraint was <any>)
  found candidate xmltodict==0.11.0 (constraint was <any>)

Finding secondary dependencies:
  django-nose==1.4.5        requires nose>=1.2.1
  pyflakes==1.6.0           requires -
  aws-xray-sdk==0.95        requires aws-xray-sdk==0.95, certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, idna<2.8,>=2.5, jsonpickle, requests, urllib3<1.24,>=1.21.1, wrapt
  mccabe==0.6.1             requires -
  jsondiff==1.1.1           requires jsondiff==1.1.1
  lazy-object-proxy==1.3.1  requires -
  moto==1.3.3               requires asn1crypto>=0.21.0, aws-xray-sdk<0.96,>=0.93, backports.ssl-match-hostname>=3.5; python_version < "3.5", backports.tempfile; python_version < "3.3", backports.weakref, boto3>=1.6.16, boto>=2.36.0, botocore>=1.9.16, certifi>=2017.4.17, cffi>=1.7; platform_python_implementation != "PyPy", chardet<3.1.0,>=3.0.2, cookies, cryptography>=2.0.0, docker-pycreds>=0.3.0, docker>=2.5.1, docutils>=0.10, enum34; python_version < "3", funcsigs>=1; python_version < "3.3", futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7", idna<2.8,>=2.5, ipaddress>=1.0.16; python_version < "3.3", jinja2>=2.7.3, jmespath<1.0.0,>=0.7.1, jsondiff==1.1.1, jsonpickle, markupsafe>=0.23, mock, moto==1.3.3, pbr>=0.11, pyaml, pycparser, python-dateutil<2.7.0,>=2.1, pytz, pyyaml, requests>=2.5, responses, s3transfer<0.2.0,>=0.1.10, six>1.9, urllib3<1.24,>=1.21.1, websocket-client>=0.32.0, werkzeug, wrapt, xmltodict
  werkzeug==0.14.1          requires -
  websocket-client==0.48.0  requires six, websocket-client==0.48.0
  nose==1.3.7               requires -
  boto==2.48.0              requires -
  responses==0.9.0          requires cookies, mock; python_version in "2.6, 2.7, 3.2", requests>=2.0, six
  pycodestyle==2.3.1        requires -
  certifi==2018.4.16        requires -
  jmespath==0.9.3           requires -
  docker-pycreds==0.3.0     requires docker-pycreds==0.3.0, six>=1.4.0
  cryptography==2.2.2       requires asn1crypto>=0.21.0, cffi>=1.7; platform_python_implementation != "PyPy", cryptography==2.2.2, enum34; python_version < "3", idna>=2.1, ipaddress; python_version < "3", pycparser, six>=1.4.1
  pbr==4.0.4                requires pbr==4.0.4
  asn1crypto==0.24.0        requires asn1crypto==0.24.0
  pytz==2018.4              requires -
  mock==2.0.0               requires funcsigs>=1; python_version < "3.3", pbr>=0.11, six>=1.9
  jsonpickle==0.9.6         requires jsonpickle==0.9.6
  wrapt==1.10.11            requires -
  astroid==1.6.5            requires astroid==1.6.5, backports.functools-lru-cache; python_version < "3.4", enum34>=1.1.3; python_version < "3.4", lazy-object-proxy, singledispatch; python_version < "3.4", six, wrapt
  chardet==3.0.4            requires -
  xmltodict==0.11.0         requires xmltodict==0.11.0
  idna==2.7                 requires idna==2.7
  jinja2==2.10              requires markupsafe>=0.23
  docker==3.4.0             requires backports.ssl-match-hostname>=3.5; python_version < "3.5", certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, docker-pycreds>=0.3.0, docker==3.4.0, idna<2.8,>=2.5, ipaddress>=1.0.16; python_version < "3.3", requests!=2.18.0,>=2.14.2, six>=1.4.0, urllib3<1.24,>=1.21.1, websocket-client>=0.32.0
  urllib3==1.23             requires urllib3==1.23; python_version != "3.2.*" and python_version != "3.3.*" and python_version != "3.0.*" and python_version != "3.1.*" and python_version < "4" and python_version >= "2.6"
  six==1.11.0               requires -
  coverage==4.5.1           requires -
  requests==2.19.1          requires certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, idna<2.8,>=2.5, requests==2.19.1, urllib3<1.24,>=1.21.1
  s3transfer==0.1.13        requires botocore<2.0.0,>=1.3.0, futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7"
  flake8==3.5.0             requires configparser; python_version < "3.2", enum34; python_version < "3.4", mccabe<0.7.0,>=0.6.0, pycodestyle<2.4.0,>=2.0.0, pyflakes<1.7.0,>=1.5.0
  freezegun==0.3.10         requires python-dateutil!=2.0,>=1.0, six
  backports.weakref==1.0.post1 requires backports.weakref==1.0.post1
  pyyaml==4.1               requires pyyaml==4.1; python_version != "3.0.*" and python_version != "3.1.*" and python_version >= "2.6" and python_version != "3.3.*" and python_version != "3.2.*"
  botocore==1.10.46         requires botocore==1.10.46, docutils>=0.10, jmespath<1.0.0,>=0.7.1, python-dateutil<3.0.0,>=2.1; python_version >= "2.7", six>=1.5
  mockredispy==2.9.3        requires -
  isort==4.3.4              requires futures
  docutils==0.14            requires -
  boto3==1.7.46             requires boto3==1.7.46, botocore<1.11.0,>=1.10.46, docutils>=0.10, futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7", jmespath<1.0.0,>=0.7.1, python-dateutil<3.0.0,>=2.1; python_version >= "2.7", s3transfer<0.2.0,>=0.1.10, six>=1.5
  markupsafe==1.0           requires -
  pyaml==17.12.1            requires pyaml==17.12.1, pyyaml
  python-dateutil==2.6.1    requires six>=1.5
  pylint==1.9.2             requires astroid<2.0,>=1.6, backports.functools-lru-cache; python_version == "2.7", configparser; python_version == "2.7", enum34>=1.1.3; python_version < "3.4", futures, isort>=4.2.5, lazy-object-proxy, mccabe, pylint==1.9.2, singledispatch; python_version < "3.4", six, wrapt
  cookies==2.2.1            requires -
  pycparser==2.18           requires pycparser==2.18

New dependencies found in this round:
  adding [u'asn1crypto', '==0.24.0,>=0.21.0', '[]']
  adding [u'astroid', '<2.0,==1.6.5,>=1.6', '[]']
  adding [u'aws-xray-sdk', '<0.96,==0.95,>=0.93', '[]']
  adding [u'backports.functools-lru-cache', '==1.5', '[]']
  adding [u'backports.ssl-match-hostname', '==3.5.0.1,>=3.5', '[]']
  adding [u'backports.tempfile', '==1.0', '[]']
  adding [u'backports.weakref', '==1.0.post1', '[]']
  adding [u'boto3', '==1.7.46,>=1.6.16', '[]']
  adding [u'botocore', '<1.11.0,<2.0.0,==1.10.46,>=1.10.46,>=1.3.0,>=1.9.16', '[]']
  adding [u'cffi', '==1.11.5,>=1.7', '[]']
  adding [u'configparser', '==3.5.0', '[]']
  adding [u'cryptography', '==2.2.2,>=2.0.0', '[]']
  adding [u'docker', '==3.4.0,>=2.5.1', '[]']
  adding [u'docker-pycreds', '==0.3.0,>=0.3.0', '[]']
  adding [u'enum34', '==1.1.6,>=1.1.3', '[]']
  adding [u'funcsigs', '==1.0.2,>=1', '[]']
  adding [u'futures', '<4.0.0,==3.2.0,>=2.2.0', '[]']
  adding [u'idna', '<2.8,==2.7,>=2.1,>=2.5', '[]']
  adding [u'ipaddress', '==1.0.22,>=1.0.16', '[]']
  adding [u'jsonpickle', '==0.9.6', '[]']
  adding [u'pbr', '==4.0.4,>=0.11', '[]']
  adding [u'pyaml', '==17.12.1', '[]']
  adding [u'pycparser', '==2.18', '[]']
  adding [u'python-dateutil', '!=2.0,<2.7.0,<3.0.0,>=1.0,>=2.1', '[]']
  adding [u'pyyaml', '==4.1', '[]']
  adding [u'requests', '!=2.18.0,==2.19.1,>=2.0,>=2.14.2,>=2.5', '[]']
  adding [u'singledispatch', '==3.4.0.3', '[]']
  adding [u'six', '>1.9,>=1.4.0,>=1.4.1,>=1.5,>=1.9', '[]']
  adding [u'urllib3', '<1.24,==1.23,>=1.21.1', '[]']
  adding [u'websocket-client', '==0.48.0,>=0.32.0', '[]']
  adding [u'xmltodict', '==0.11.0', '[]']
Removed dependencies in this round:
  removing [u'asn1crypto', '>=0.21.0', '[]']
  removing [u'astroid', '<2.0,>=1.6', '[]']
  removing [u'aws-xray-sdk', '<0.96,>=0.93', '[]']
  removing [u'backports.functools-lru-cache', '', '[]']
  removing [u'backports.ssl-match-hostname', '>=3.5', '[]']
  removing [u'backports.tempfile', '', '[]']
  removing [u'backports.weakref', '', '[]']
  removing [u'boto3', '>=1.6.16', '[]']
  removing [u'botocore', '>=1.9.16', '[]']
  removing [u'cffi', '>=1.7', '[]']
  removing [u'configparser', '', '[]']
  removing [u'cryptography', '>=2.0.0', '[]']
  removing [u'docker', '>=2.5.1', '[]']
  removing [u'docker-pycreds', '>=0.3.0', '[]']
  removing [u'enum34', '>=1.1.3', '[]']
  removing [u'funcsigs', '>=1', '[]']
  removing [u'futures', '<4.0.0,>=2.2.0', '[]']
  removing [u'idna', '<2.8,>=2.5', '[]']
  removing [u'ipaddress', '>=1.0.16', '[]']
  removing [u'jsonpickle', '', '[]']
  removing [u'pbr', '>=0.11', '[]']
  removing [u'pyaml', '', '[]']
  removing [u'pycparser', '', '[]']
  removing [u'python-dateutil', '!=2.0,<2.7.0,>=1.0,>=2.1', '[]']
  removing [u'pyyaml', '', '[]']
  removing [u'requests', '>=2.5', '[]']
  removing [u'singledispatch', '', '[]']
  removing [u'six', '>1.9', '[]']
  removing [u'urllib3', '<1.24,>=1.21.1', '[]']
  removing [u'websocket-client', '>=0.32.0', '[]']
  removing [u'xmltodict', '', '[]']
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 2: not stable

                          ROUND 3                           
Current constraints:
  asn1crypto==0.24.0,>=0.21.0
  astroid<2.0,==1.6.5,>=1.6
  aws-xray-sdk<0.96,==0.95,>=0.93
  backports.functools-lru-cache==1.5
  backports.ssl-match-hostname==3.5.0.1,>=3.5
  backports.tempfile==1.0 from https://files.pythonhosted.org/packages/b4/5c/077f910632476281428fe254807952eb47ca78e720d059a46178c541e669/backports.tempfile-1.0-py2.py3-none-any.whl#sha256=05aa50940946f05759696156a8c39be118169a0e0f94a49d0bb106503891ff54
  backports.weakref==1.0.post1 from https://files.pythonhosted.org/packages/88/ec/f598b633c3d5ffe267aaada57d961c94fdfa183c5c3ebda2b6d151943db6/backports.weakref-1.0.post1-py2.py3-none-any.whl#sha256=81bc9b51c0abc58edc76aefbbc68c62a787918ffe943a37947e162c3f8e19e82 (from backports.tempfile==1.0)
  boto>=2.36.0
  boto3==1.7.46,>=1.6.16
  botocore<1.11.0,<2.0.0,==1.10.46,>=1.10.46,>=1.3.0,>=1.9.16
  certifi>=2017.4.17
  cffi==1.11.5,>=1.7
  chardet<3.1.0,>=3.0.2
  configparser==3.5.0 from https://files.pythonhosted.org/packages/7c/69/c2ce7e91c89dc073eb1aa74c0621c3eefbffe8216b3f9af9d3885265c01c/configparser-3.5.0.tar.gz#sha256=5308b47021bc2340965c371f0f058cc6971a04502638d4244225c49d80db273a
  cookies
  coverage==4.5.1 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 2))
  cryptography==2.2.2,>=2.0.0
  django-nose==1.4.5 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 3))
  docker==3.4.0,>=2.5.1
  docker-pycreds==0.3.0,>=0.3.0
  docutils>=0.10
  enum34==1.1.6,>=1.1.3
  flake8==3.5.0 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 4))
  freezegun==0.3.10 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 5))
  funcsigs==1.0.2,>=1
  futures<4.0.0,==3.2.0,>=2.2.0
  idna<2.8,==2.7,>=2.1,>=2.5
  ipaddress==1.0.22,>=1.0.16 from https://files.pythonhosted.org/packages/fc/d0/7fc3a811e011d4b388be48a0e381db8d990042df54aa4ef4599a31d39853/ipaddress-1.0.22-py2.py3-none-any.whl#sha256=64b28eec5e78e7510698f6d4da08800a5c575caa4a286c93d651c5d3ff7b6794
  isort>=4.2.5
  jinja2>=2.7.3
  jmespath<1.0.0,>=0.7.1
  jsondiff==1.1.1
  jsonpickle==0.9.6
  lazy-object-proxy
  markupsafe>=0.23
  mccabe<0.7.0,>=0.6.0
  mock
  mockredispy==2.9.3 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 6))
  moto==1.3.3 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 7))
  nose>=1.2.1
  pbr==4.0.4,>=0.11
  pyaml==17.12.1
  pycodestyle<2.4.0,>=2.0.0
  pycparser==2.18
  pyflakes<1.7.0,>=1.5.0
  pylint==1.9.2 (from -r /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements/pipenv-qWgDpW-constraints.txt (line 8))
  python-dateutil!=2.0,<2.7.0,<3.0.0,>=1.0,>=2.1
  pytz
  pyyaml==4.1
  requests!=2.18.0,==2.19.1,>=2.0,>=2.14.2,>=2.5
  responses
  s3transfer<0.2.0,>=0.1.10
  singledispatch==3.4.0.3 from https://files.pythonhosted.org/packages/c5/10/369f50bcd4621b263927b0a1519987a04383d4a98fb10438042ad410cf88/singledispatch-3.4.0.3-py2.py3-none-any.whl#sha256=833b46966687b3de7f438c761ac475213e53b306740f1abfaa86e1d1aae56aa8
  six>1.9,>=1.4.0,>=1.4.1,>=1.5,>=1.9 from https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl#sha256=832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb (from singledispatch==3.4.0.3)
  urllib3<1.24,==1.23,>=1.21.1
  websocket-client==0.48.0,>=0.32.0
  werkzeug
  wrapt
  xmltodict==0.11.0

Finding the best candidates:
  found candidate asn1crypto==0.24.0 (constraint was >=0.21.0,==0.24.0)
  found candidate astroid==1.6.5 (constraint was >=1.6,==1.6.5,<2.0)
  found candidate aws-xray-sdk==0.95 (constraint was >=0.93,==0.95,<0.96)
  found candidate backports.functools-lru-cache==1.5 (constraint was ==1.5)
  found candidate backports.ssl-match-hostname==3.5.0.1 (constraint was >=3.5,==3.5.0.1)
  found candidate backports.tempfile==1.0 (constraint was ==1.0)
  found candidate backports.weakref==1.0.post1 (constraint was ==1.0.post1)
  found candidate boto==2.48.0 (constraint was >=2.36.0)
  found candidate boto3==1.7.46 (constraint was >=1.6.16,==1.7.46)
  found candidate botocore==1.10.46 (constraint was ==1.10.46,>=1.10.46,<1.11.0,>=1.3.0,>=1.9.16,<2.0.0)
  found candidate certifi==2018.4.16 (constraint was >=2017.4.17)
  found candidate cffi==1.11.5 (constraint was ==1.11.5,>=1.7)
  found candidate chardet==3.0.4 (constraint was >=3.0.2,<3.1.0)
  found candidate configparser==3.5.0 (constraint was ==3.5.0)
  found candidate cookies==2.2.1 (constraint was <any>)
  found candidate coverage==4.5.1 (constraint was ==4.5.1)
  found candidate cryptography==2.2.2 (constraint was >=2.0.0,==2.2.2)
  found candidate django-nose==1.4.5 (constraint was ==1.4.5)
  found candidate docker==3.4.0 (constraint was >=2.5.1,==3.4.0)
  found candidate docker-pycreds==0.3.0 (constraint was >=0.3.0,==0.3.0)
  found candidate docutils==0.14 (constraint was >=0.10)
  found candidate enum34==1.1.6 (constraint was >=1.1.3,==1.1.6)
  found candidate flake8==3.5.0 (constraint was ==3.5.0)
  found candidate freezegun==0.3.10 (constraint was ==0.3.10)
  found candidate funcsigs==1.0.2 (constraint was >=1,==1.0.2)
  found candidate futures==3.2.0 (constraint was >=2.2.0,==3.2.0,<4.0.0)
  found candidate idna==2.7 (constraint was >=2.1,>=2.5,==2.7,<2.8)
  found candidate ipaddress==1.0.22 (constraint was >=1.0.16,==1.0.22)
  found candidate isort==4.3.4 (constraint was >=4.2.5)
  found candidate jinja2==2.10 (constraint was >=2.7.3)
  found candidate jmespath==0.9.3 (constraint was >=0.7.1,<1.0.0)
  found candidate jsondiff==1.1.1 (constraint was ==1.1.1)
  found candidate jsonpickle==0.9.6 (constraint was ==0.9.6)
  found candidate lazy-object-proxy==1.3.1 (constraint was <any>)
  found candidate markupsafe==1.0 (constraint was >=0.23)
  found candidate mccabe==0.6.1 (constraint was >=0.6.0,<0.7.0)
  found candidate mock==2.0.0 (constraint was <any>)
  found candidate mockredispy==2.9.3 (constraint was ==2.9.3)
  found candidate moto==1.3.3 (constraint was ==1.3.3)
  found candidate nose==1.3.7 (constraint was >=1.2.1)
  found candidate pbr==4.0.4 (constraint was >=0.11,==4.0.4)
  found candidate pyaml==17.12.1 (constraint was ==17.12.1)
  found candidate pycodestyle==2.3.1 (constraint was >=2.0.0,<2.4.0)
  found candidate pycparser==2.18 (constraint was ==2.18)
  found candidate pyflakes==1.6.0 (constraint was >=1.5.0,<1.7.0)
  found candidate pylint==1.9.2 (constraint was ==1.9.2)
  found candidate python-dateutil==2.6.1 (constraint was >=1.0,!=2.0,>=2.1,<2.7.0,<3.0.0)
  found candidate pytz==2018.4 (constraint was <any>)
  found candidate pyyaml==4.1 (constraint was ==4.1)
  found candidate requests==2.19.1 (constraint was >=2.0,>=2.14.2,!=2.18.0,==2.19.1,>=2.5)
  found candidate responses==0.9.0 (constraint was <any>)
  found candidate s3transfer==0.1.13 (constraint was >=0.1.10,<0.2.0)
  found candidate singledispatch==3.4.0.3 (constraint was ==3.4.0.3)
  found candidate six==1.11.0 (constraint was >=1.4.0,>=1.4.1,>=1.5,>1.9,>=1.9)
  found candidate urllib3==1.23 (constraint was >=1.21.1,==1.23,<1.24)
  found candidate websocket-client==0.48.0 (constraint was >=0.32.0,==0.48.0)
  found candidate werkzeug==0.14.1 (constraint was <any>)
  found candidate wrapt==1.10.11 (constraint was <any>)
  found candidate xmltodict==0.11.0 (constraint was ==0.11.0)

Finding secondary dependencies:
  futures==3.2.0            requires -
  mockredispy==2.9.3        requires -
  botocore==1.10.46         requires botocore==1.10.46, docutils>=0.10, jmespath<1.0.0,>=0.7.1, python-dateutil<3.0.0,>=2.1; python_version >= "2.7", six>=1.5
  s3transfer==0.1.13        requires botocore<2.0.0,>=1.3.0, futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7"
  lazy-object-proxy==1.3.1  requires -
  websocket-client==0.48.0  requires six, websocket-client==0.48.0
  flake8==3.5.0             requires configparser; python_version < "3.2", enum34; python_version < "3.4", mccabe<0.7.0,>=0.6.0, pycodestyle<2.4.0,>=2.0.0, pyflakes<1.7.0,>=1.5.0
  responses==0.9.0          requires cookies, mock; python_version in "2.6, 2.7, 3.2", requests>=2.0, six
  six==1.11.0               requires -
  isort==4.3.4              requires futures
  moto==1.3.3               requires asn1crypto>=0.21.0, aws-xray-sdk<0.96,>=0.93, backports.ssl-match-hostname>=3.5; python_version < "3.5", backports.tempfile; python_version < "3.3", backports.weakref, boto3>=1.6.16, boto>=2.36.0, botocore>=1.9.16, certifi>=2017.4.17, cffi>=1.7; platform_python_implementation != "PyPy", chardet<3.1.0,>=3.0.2, cookies, cryptography>=2.0.0, docker-pycreds>=0.3.0, docker>=2.5.1, docutils>=0.10, enum34; python_version < "3", funcsigs>=1; python_version < "3.3", futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7", idna<2.8,>=2.5, ipaddress>=1.0.16; python_version < "3.3", jinja2>=2.7.3, jmespath<1.0.0,>=0.7.1, jsondiff==1.1.1, jsonpickle, markupsafe>=0.23, mock, moto==1.3.3, pbr>=0.11, pyaml, pycparser, python-dateutil<2.7.0,>=2.1, pytz, pyyaml, requests>=2.5, responses, s3transfer<0.2.0,>=0.1.10, six>1.9, urllib3<1.24,>=1.21.1, websocket-client>=0.32.0, werkzeug, wrapt, xmltodict
  docker==3.4.0             requires backports.ssl-match-hostname>=3.5; python_version < "3.5", certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, docker-pycreds>=0.3.0, docker==3.4.0, idna<2.8,>=2.5, ipaddress>=1.0.16; python_version < "3.3", requests!=2.18.0,>=2.14.2, six>=1.4.0, urllib3<1.24,>=1.21.1, websocket-client>=0.32.0

WARNING:notpip._internal.req.req_install:No PKG-INFO file found in /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/tmp8f92W4build/configparser/pip-egg-info/configparser.egg-info/PKG-INFO
WARNING:notpip._internal.req.req_install:No PKG-INFO file found in /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/tmp8f92W4build/configparser/pip-egg-info/configparser.egg-info/PKG-INFO
Traceback (most recent call last):
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/resolver.py", line 86, in <module>
    main()
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/resolver.py", line 75, in main
    system=system,
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/resolver.py", line 62, in resolve
    allow_global=system,
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/utils.py", line 403, in resolve_deps
    req_dir=req_dir
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/utils.py", line 294, in actually_resolve_deps
    results = resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS)
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 104, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 204, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 282, in _iter_dependencies
    for dependency in self.repository.get_dependencies(ireq):
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 243, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 332, in get_legacy_dependencies
    self.resolver.resolve(reqset)
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 107, in resolve
    self._resolve_one(requirement_set, req)
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 264, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 214, in _get_abstract_dist_for
    self.require_hashes
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 328, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 158, in prep_for_dist
    self.req.run_egg_info()
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 502, in run_egg_info
    metadata_name = canonicalize_name(self.pkg_info()["Name"])
  File "/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/patched/notpip/_vendor/packaging/utils.py", line 16, in canonicalize_name
    return _canonicalize_regex.sub("-", name).lower()
TypeError: expected string or buffer
/Users/greysteil/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/_compat.py:108: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-uCSa6O-requirements'>
  warnings.warn(warn_message, ResourceWarning)

I only get the above error when I run the command for the first time in a fresh virtual env. Running a second time I get successful resolution.

Steps to replicate
rm -rf ~/.local/share/virtualenvs/ # Remove virtual envs
pyenv exec pipenv lock             # Generate lockfile with Pipfile foud in environment details above

Note, I have Python 3.6.5 (default) and Python 2.7.15 installed via pyenv.

@techalchemy
Copy link
Member

Huh, I've been wondering about that bug. I am not sure what exactly is the cause but the fact that it only happens in fresh environments is new information for me. does this happen with master also?

@greysteil
Copy link
Contributor Author

Yep, happening with the latest master.

Let me see if I can get the commit that introduced it for you...

@greysteil
Copy link
Contributor Author

OK, so it was definitely introduced by #2267. Resolution works fine on d55e400 but I get the same error as above on e135f7c.

@greysteil
Copy link
Contributor Author

Within that PR, it's introduced by either bba2f38 or 7abc2fd. (I get a different error for 7abc2fd which may be masking it, but definitely get it with bba2f38 checked out.)

@techalchemy
Copy link
Member

Yeah that makes perfect sense, try against master now that I updated requirementslib, otherwise try against #2453 maybe

@greysteil
Copy link
Contributor Author

Fixed on master. 🎉

@greysteil
Copy link
Contributor Author

greysteil commented Jun 28, 2018

Argh, @techalchemy, you're going to hate me but I jumped the gun on this. It's still happening, although possibly less often - I now can't always reproduce it just by removing the virtualenv.

Here's my terminal output from running pyenv exec pipenv lock -v a few times, using master. Most of the time I get the error, but sometimes resolution succeeds.

Output (search for "TypeError")
python-test (master) $ rm -rf ~/.local/share/virtualenvs/
python-test (master) $ pyenv exec pipenv lock -v
Creating a virtualenv for this project...
Pipfile: /Users/greysteil/code/python-test/Pipfile
Using /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7 (2.7.15) to create virtualenv...
⠋Running virtualenv with interpreter /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7
New python executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python2.7
Also creating executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python
Installing setuptools, pip, wheel...done.
Setting project for python-test-vk93uezd to /Users/greysteil/code/python-test

Virtualenv location: /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd
Locking [dev-packages] dependencies...
using sources: [{u'url': u'https://pypi.python.org/simple/', u'verify_ssl': True, u'name': u'pypi'}]
Using pip: -i https://pypi.python.org/simple/

                          ROUND 1                           
... (removed)

Locking [packages] dependencies...
Updated Pipfile.lock (aef4cd)!
python-test (master) $ rm -rf ~/.local/share/virtualenvs/
python-test (master) $ ls
Pipfile                 Pipfile.lock            python_package.egg-info
python-test (master) $ rm Pipfile.lock 
python-test (master) $ pyenv exec pipenv lock -v
Creating a virtualenv for this project...
Pipfile: /Users/greysteil/code/python-test/Pipfile
Using /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7 (2.7.15) to create virtualenv...
⠋Running virtualenv with interpreter /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7
New python executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python2.7
Also creating executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python
Installing setuptools, pip, wheel...done.
Setting project for python-test-vk93uezd to /Users/greysteil/code/python-test

Virtualenv location: /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd
Locking [dev-packages] dependencies...
using sources: [{u'url': u'https://pypi.python.org/simple/', u'verify_ssl': True, u'name': u'pypi'}]
Using pip: -i https://pypi.python.org/simple/

.... (removed)

Finding secondary dependencies:
  xmltodict==0.11.0         requires xmltodict==0.11.0
  cryptography==2.2.2       requires asn1crypto>=0.21.0, cffi>=1.7; platform_python_implementation != "PyPy", cryptography==2.2.2, enum34; python_version < "3", idna>=2.1, ipaddress; python_version < "3", pycparser, six>=1.4.1
  pyaml==17.12.1            requires pyaml==17.12.1, pyyaml
  cookies==2.2.1            requires -
  jmespath==0.9.3           requires -
  aws-xray-sdk==0.95        requires aws-xray-sdk==0.95, certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, idna<2.8,>=2.5, jsonpickle, requests, urllib3<1.24,>=1.21.1, wrapt
  docutils==0.14            requires -
  werkzeug==0.14.1          requires -
  pbr==4.0.4                requires pbr==4.0.4
  six==1.11.0               requires -
  asn1crypto==0.24.0        requires asn1crypto==0.24.0
  chardet==3.0.4            requires -
  django-nose==1.4.5        requires nose>=1.2.1
  idna==2.7                 requires idna==2.7
  mccabe==0.6.1             requires -
  docker-pycreds==0.3.0     requires docker-pycreds==0.3.0, six>=1.4.0
  markupsafe==1.0           requires -
  isort==4.3.4              requires futures
  astroid==1.6.5            requires astroid==1.6.5, backports.functools-lru-cache; python_version < "3.4", enum34>=1.1.3; python_version < "3.4", lazy-object-proxy, singledispatch; python_version < "3.4", six, wrapt
  coverage==4.5.1           requires -
  wrapt==1.10.11            requires -
  mockredispy==2.9.3        requires -
  urllib3==1.23             requires urllib3==1.23; python_version != "3.2.*" and python_version != "3.3.*" and python_version != "3.0.*" and python_version != "3.1.*" and python_version < "4" and python_version >= "2.6"
  jsondiff==1.1.1           requires jsondiff==1.1.1
  botocore==1.10.47         requires botocore==1.10.47, docutils>=0.10, jmespath<1.0.0,>=0.7.1, python-dateutil<3.0.0,>=2.1; python_version >= "2.7", six>=1.5

WARNING:notpip._internal.req.req_install:No PKG-INFO file found in /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/tmps2uhBtbuild/configparser/pip-egg-info/configparser.egg-info/PKG-INFO
WARNING:notpip._internal.req.req_install:No PKG-INFO file found in /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/tmps2uhBtbuild/configparser/pip-egg-info/configparser.egg-info/PKG-INFO
Traceback (most recent call last):
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 86, in <module>
    main()
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 75, in main
    system=system,
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 62, in resolve
    allow_global=system,
  File "/Users/greysteil/code/pipenv/pipenv/utils.py", line 403, in resolve_deps
    req_dir=req_dir
  File "/Users/greysteil/code/pipenv/pipenv/utils.py", line 294, in actually_resolve_deps
    results = resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS)
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 104, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 204, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 282, in _iter_dependencies
    for dependency in self.repository.get_dependencies(ireq):
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/repositories/pypi.py", line 243, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/repositories/pypi.py", line 335, in get_legacy_dependencies
    self.resolver.resolve(reqset)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 107, in resolve
    self._resolve_one(requirement_set, req)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 264, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 214, in _get_abstract_dist_for
    self.require_hashes
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/operations/prepare.py", line 328, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/operations/prepare.py", line 158, in prep_for_dist
    self.req.run_egg_info()
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/req/req_install.py", line 502, in run_egg_info
    metadata_name = canonicalize_name(self.pkg_info()["Name"])
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_vendor/packaging/utils.py", line 16, in canonicalize_name
    return _canonicalize_regex.sub("-", name).lower()
TypeError: expected string or buffer
/Users/greysteil/code/pipenv/pipenv/_compat.py:108: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-xQ6v4_-requirements'>
  warnings.warn(warn_message, ResourceWarning)

python-test (master) $ rm -rf ~/.local/share/virtualenvs/python-test-vk93uezd/
.project            bin/                include/            lib/                pip-selfcheck.json  
python-test (master) $ rm -rf ~/.local/share/virtualenvs/
python-test (master) $ pyenv exec pipenv lock -v
Creating a virtualenv for this project...
Pipfile: /Users/greysteil/code/python-test/Pipfile
Using /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7 (2.7.15) to create virtualenv...
⠋Running virtualenv with interpreter /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7
New python executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python2.7
Also creating executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python
Installing setuptools, pip, wheel...done.
Setting project for python-test-vk93uezd to /Users/greysteil/code/python-test

Virtualenv location: /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd
Locking [dev-packages] dependencies...
using sources: [{u'url': u'https://pypi.python.org/simple/', u'verify_ssl': True, u'name': u'pypi'}]
Using pip: -i https://pypi.python.org/simple/

... (removed)

Locking [packages] dependencies...
Updated Pipfile.lock (aef4cd)!
python-test (master) $ rm -rf ~/.local/share/virtualenvs/
python-test (master) $ rm Pipfile.lock 
python-test (master) $ pyenv exec pipenv lock -v
Creating a virtualenv for this project...
Pipfile: /Users/greysteil/code/python-test/Pipfile
Using /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7 (2.7.15) to create virtualenv...
⠋Running virtualenv with interpreter /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7
New python executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python2.7
Also creating executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python
Installing setuptools, pip, wheel...done.
Setting project for python-test-vk93uezd to /Users/greysteil/code/python-test

Virtualenv location: /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd
Locking [dev-packages] dependencies...
using sources: [{u'url': u'https://pypi.python.org/simple/', u'verify_ssl': True, u'name': u'pypi'}]
Using pip: -i https://pypi.python.org/simple/

                          ROUND 1                           

... (removed)

Finding secondary dependencies:
  responses==0.9.0          requires cookies, mock; python_version in "2.6, 2.7, 3.2", requests>=2.0, six
  six==1.11.0               requires -
  freezegun==0.3.10         requires python-dateutil!=2.0,>=1.0, six
  werkzeug==0.14.1          requires -
  aws-xray-sdk==0.95        requires aws-xray-sdk==0.95, certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, idna<2.8,>=2.5, jsonpickle, requests, urllib3<1.24,>=1.21.1, wrapt
  mock==2.0.0               requires funcsigs>=1; python_version < "3.3", pbr>=0.11, six>=1.9
  docutils==0.14            requires -
  jsonpickle==0.9.6         requires jsonpickle==0.9.6
  docker-pycreds==0.3.0     requires docker-pycreds==0.3.0, six>=1.4.0
  requests==2.19.1          requires certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, idna<2.8,>=2.5, requests==2.19.1, urllib3<1.24,>=1.21.1
  astroid==1.6.5            requires astroid==1.6.5, backports.functools-lru-cache; python_version < "3.4", enum34>=1.1.3; python_version < "3.4", lazy-object-proxy, singledispatch; python_version < "3.4", six, wrapt
  pycparser==2.18           requires pycparser==2.18
  jmespath==0.9.3           requires -
  certifi==2018.4.16        requires -
  django-nose==1.4.5        requires nose>=1.2.1
  pylint==1.9.2             requires astroid<2.0,>=1.6, backports.functools-lru-cache; python_version == "2.7", configparser; python_version == "2.7", enum34>=1.1.3; python_version < "3.4", futures, isort>=4.2.5, lazy-object-proxy, mccabe, pylint==1.9.2, singledispatch; python_version < "3.4", six, wrapt
  cryptography==2.2.2       requires asn1crypto>=0.21.0, cffi>=1.7; platform_python_implementation != "PyPy", cryptography==2.2.2, enum34; python_version < "3", idna>=2.1, ipaddress; python_version < "3", pycparser, six>=1.4.1
  urllib3==1.23             requires urllib3==1.23; python_version != "3.2.*" and python_version != "3.3.*" and python_version != "3.0.*" and python_version != "3.1.*" and python_version < "4" and python_version >= "2.6"
  python-dateutil==2.6.1    requires six>=1.5
  idna==2.7                 requires idna==2.7
  pytz==2018.4              requires -
  pycodestyle==2.3.1        requires -
  boto==2.48.0              requires -
  wrapt==1.10.11            requires -
  coverage==4.5.1           requires -
  jinja2==2.10              requires markupsafe>=0.23
  jsondiff==1.1.1           requires jsondiff==1.1.1
  boto3==1.7.47             requires boto3==1.7.47, botocore<1.11.0,>=1.10.47, docutils>=0.10, futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7", jmespath<1.0.0,>=0.7.1, python-dateutil<3.0.0,>=2.1; python_version >= "2.7", s3transfer<0.2.0,>=0.1.10, six>=1.5
  websocket-client==0.48.0  requires six, websocket-client==0.48.0
  chardet==3.0.4            requires -
  s3transfer==0.1.13        requires botocore<2.0.0,>=1.3.0, futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7"
  pyaml==17.12.1            requires pyaml==17.12.1, pyyaml
  pbr==4.0.4                requires pbr==4.0.4

WARNING:notpip._internal.req.req_install:No PKG-INFO file found in /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/tmpeBATMLbuild/configparser/pip-egg-info/configparser.egg-info/PKG-INFO
WARNING:notpip._internal.req.req_install:No PKG-INFO file found in /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/tmpeBATMLbuild/configparser/pip-egg-info/configparser.egg-info/PKG-INFO
Traceback (most recent call last):
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 86, in <module>
    main()
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 75, in main
    system=system,
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 62, in resolve
    allow_global=system,
  File "/Users/greysteil/code/pipenv/pipenv/utils.py", line 403, in resolve_deps
    req_dir=req_dir
  File "/Users/greysteil/code/pipenv/pipenv/utils.py", line 294, in actually_resolve_deps
    results = resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS)
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 104, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 204, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 282, in _iter_dependencies
    for dependency in self.repository.get_dependencies(ireq):
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/repositories/pypi.py", line 243, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/repositories/pypi.py", line 335, in get_legacy_dependencies
    self.resolver.resolve(reqset)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 107, in resolve
    self._resolve_one(requirement_set, req)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 264, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 214, in _get_abstract_dist_for
    self.require_hashes
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/operations/prepare.py", line 328, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/operations/prepare.py", line 158, in prep_for_dist
    self.req.run_egg_info()
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/req/req_install.py", line 502, in run_egg_info
    metadata_name = canonicalize_name(self.pkg_info()["Name"])
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_vendor/packaging/utils.py", line 16, in canonicalize_name
    return _canonicalize_regex.sub("-", name).lower()
TypeError: expected string or buffer
/Users/greysteil/code/pipenv/pipenv/_compat.py:108: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-k_yn4W-requirements'>
  warnings.warn(warn_message, ResourceWarning)

python-test (master) $ ls
Pipfile                 python_package.egg-info
python-test (master) $ rm -rf ~/.local/share/virtualenvs/
python-test (master) $ pyenv exec pipenv lock -v
Creating a virtualenv for this project...
Pipfile: /Users/greysteil/code/python-test/Pipfile
Using /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7 (2.7.15) to create virtualenv...
⠋Running virtualenv with interpreter /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7
New python executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python2.7
Also creating executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python
Installing setuptools, pip, wheel...done.
Setting project for python-test-vk93uezd to /Users/greysteil/code/python-test

Virtualenv location: /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd
Locking [dev-packages] dependencies...
using sources: [{u'url': u'https://pypi.python.org/simple/', u'verify_ssl': True, u'name': u'pypi'}]
Using pip: -i https://pypi.python.org/simple/

                          ROUND 1                           

... (removed)

Finding secondary dependencies:
  xmltodict==0.11.0         requires xmltodict==0.11.0
  pbr==4.0.4                requires pbr==4.0.4
  jinja2==2.10              requires markupsafe>=0.23
  flake8==3.5.0             requires configparser; python_version < "3.2", enum34; python_version < "3.4", mccabe<0.7.0,>=0.6.0, pycodestyle<2.4.0,>=2.0.0, pyflakes<1.7.0,>=1.5.0
  wrapt==1.10.11            requires -
  freezegun==0.3.10         requires python-dateutil!=2.0,>=1.0, six
  s3transfer==0.1.13        requires botocore<2.0.0,>=1.3.0, futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7"
  cookies==2.2.1            requires -
  chardet==3.0.4            requires -
  werkzeug==0.14.1          requires -
  cryptography==2.2.2       requires asn1crypto>=0.21.0, cffi>=1.7; platform_python_implementation != "PyPy", cryptography==2.2.2, enum34; python_version < "3", idna>=2.1, ipaddress; python_version < "3", pycparser, six>=1.4.1
  botocore==1.10.47         requires botocore==1.10.47, docutils>=0.10, jmespath<1.0.0,>=0.7.1, python-dateutil<3.0.0,>=2.1; python_version >= "2.7", six>=1.5
  mccabe==0.6.1             requires -
  jsondiff==1.1.1           requires jsondiff==1.1.1
  boto==2.48.0              requires -
  mockredispy==2.9.3        requires -
  pylint==1.9.2             requires astroid<2.0,>=1.6, backports.functools-lru-cache; python_version == "2.7", configparser; python_version == "2.7", enum34>=1.1.3; python_version < "3.4", futures, isort>=4.2.5, lazy-object-proxy, mccabe, pylint==1.9.2, singledispatch; python_version < "3.4", six, wrapt
  pyaml==17.12.1            requires pyaml==17.12.1, pyyaml
  pycodestyle==2.3.1        requires -
  jmespath==0.9.3           requires -
  responses==0.9.0          requires cookies, mock; python_version in "2.6, 2.7, 3.2", requests>=2.0, six
  pyyaml==4.1               requires pyyaml==4.1; python_version != "3.0.*" and python_version != "3.1.*" and python_version >= "2.6" and python_version != "3.3.*" and python_version != "3.2.*"
  lazy-object-proxy==1.3.1  requires -
  six==1.11.0               requires -
  moto==1.3.3               requires asn1crypto>=0.21.0, aws-xray-sdk<0.96,>=0.93, backports.ssl-match-hostname>=3.5; python_version < "3.5", backports.tempfile; python_version < "3.3", backports.weakref, boto3>=1.6.16, boto>=2.36.0, botocore>=1.9.16, certifi>=2017.4.17, cffi>=1.7; platform_python_implementation != "PyPy", chardet<3.1.0,>=3.0.2, cookies, cryptography>=2.0.0, docker-pycreds>=0.3.0, docker>=2.5.1, docutils>=0.10, enum34; python_version < "3", funcsigs>=1; python_version < "3.3", futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7", idna<2.8,>=2.5, ipaddress>=1.0.16; python_version < "3.3", jinja2>=2.7.3, jmespath<1.0.0,>=0.7.1, jsondiff==1.1.1, jsonpickle, markupsafe>=0.23, mock, moto==1.3.3, pbr>=0.11, pyaml, pycparser, python-dateutil<2.7.0,>=2.1, pytz, pyyaml, requests>=2.5, responses, s3transfer<0.2.0,>=0.1.10, six>1.9, urllib3<1.24,>=1.21.1, websocket-client>=0.32.0, werkzeug, wrapt, xmltodict
  markupsafe==1.0           requires -

WARNING:notpip._internal.req.req_install:No PKG-INFO file found in /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/tmpcfpz_Fbuild/configparser/pip-egg-info/configparser.egg-info/PKG-INFO
WARNING:notpip._internal.req.req_install:No PKG-INFO file found in /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/tmpcfpz_Fbuild/configparser/pip-egg-info/configparser.egg-info/PKG-INFO
Traceback (most recent call last):
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 86, in <module>
    main()
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 75, in main
    system=system,
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 62, in resolve
    allow_global=system,
  File "/Users/greysteil/code/pipenv/pipenv/utils.py", line 403, in resolve_deps
    req_dir=req_dir
  File "/Users/greysteil/code/pipenv/pipenv/utils.py", line 294, in actually_resolve_deps
    results = resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS)
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 104, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 204, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 282, in _iter_dependencies
    for dependency in self.repository.get_dependencies(ireq):
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/repositories/pypi.py", line 243, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/repositories/pypi.py", line 335, in get_legacy_dependencies
    self.resolver.resolve(reqset)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 107, in resolve
    self._resolve_one(requirement_set, req)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 264, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 214, in _get_abstract_dist_for
    self.require_hashes
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/operations/prepare.py", line 328, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/operations/prepare.py", line 158, in prep_for_dist
    self.req.run_egg_info()
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/req/req_install.py", line 502, in run_egg_info
    metadata_name = canonicalize_name(self.pkg_info()["Name"])
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_vendor/packaging/utils.py", line 16, in canonicalize_name
    return _canonicalize_regex.sub("-", name).lower()
TypeError: expected string or buffer
/Users/greysteil/code/pipenv/pipenv/_compat.py:108: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-gSq4va-requirements'>
  warnings.warn(warn_message, ResourceWarning)

python-test (master) $ rm -rf ~/.local/share/virtualenvs/
python-test (master) $ rm -rf ~/.local/share/virtualenvs/
python-test (master) $ pyenv exec pipenv lock -v
Creating a virtualenv for this project...
Pipfile: /Users/greysteil/code/python-test/Pipfile
Using /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7 (2.7.15) to create virtualenv...
⠋Running virtualenv with interpreter /Users/greysteil/.pyenv/versions/2.7.15/bin/python2.7
New python executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python2.7
Also creating executable in /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd/bin/python
Installing setuptools, pip, wheel...done.
Setting project for python-test-vk93uezd to /Users/greysteil/code/python-test

Virtualenv location: /Users/greysteil/.local/share/virtualenvs/python-test-vk93uezd
Locking [dev-packages] dependencies...
using sources: [{u'url': u'https://pypi.python.org/simple/', u'verify_ssl': True, u'name': u'pypi'}]
Using pip: -i https://pypi.python.org/simple/

                          ROUND 1                           

... (removed)

Finding secondary dependencies:
  pyyaml==4.1               requires pyyaml==4.1; python_version != "3.0.*" and python_version != "3.1.*" and python_version >= "2.6" and python_version != "3.3.*" and python_version != "3.2.*"
  moto==1.3.3               requires asn1crypto>=0.21.0, aws-xray-sdk<0.96,>=0.93, backports.ssl-match-hostname>=3.5; python_version < "3.5", backports.tempfile; python_version < "3.3", backports.weakref, boto3>=1.6.16, boto>=2.36.0, botocore>=1.9.16, certifi>=2017.4.17, cffi>=1.7; platform_python_implementation != "PyPy", chardet<3.1.0,>=3.0.2, cookies, cryptography>=2.0.0, docker-pycreds>=0.3.0, docker>=2.5.1, docutils>=0.10, enum34; python_version < "3", funcsigs>=1; python_version < "3.3", futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7", idna<2.8,>=2.5, ipaddress>=1.0.16; python_version < "3.3", jinja2>=2.7.3, jmespath<1.0.0,>=0.7.1, jsondiff==1.1.1, jsonpickle, markupsafe>=0.23, mock, moto==1.3.3, pbr>=0.11, pyaml, pycparser, python-dateutil<2.7.0,>=2.1, pytz, pyyaml, requests>=2.5, responses, s3transfer<0.2.0,>=0.1.10, six>1.9, urllib3<1.24,>=1.21.1, websocket-client>=0.32.0, werkzeug, wrapt, xmltodict
  asn1crypto==0.24.0        requires asn1crypto==0.24.0
  wrapt==1.10.11            requires -
  jsondiff==1.1.1           requires jsondiff==1.1.1
  docker==3.4.0             requires backports.ssl-match-hostname>=3.5; python_version < "3.5", certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, docker-pycreds>=0.3.0, docker==3.4.0, idna<2.8,>=2.5, ipaddress>=1.0.16; python_version < "3.3", requests!=2.18.0,>=2.14.2, six>=1.4.0, urllib3<1.24,>=1.21.1, websocket-client>=0.32.0
  jsonpickle==0.9.6         requires jsonpickle==0.9.6
  aws-xray-sdk==0.95        requires aws-xray-sdk==0.95, certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, idna<2.8,>=2.5, jsonpickle, requests, urllib3<1.24,>=1.21.1, wrapt
  nose==1.3.7               requires -
  chardet==3.0.4            requires -
  pyaml==17.12.1            requires pyaml==17.12.1, pyyaml
  mccabe==0.6.1             requires -
  pbr==4.0.4                requires pbr==4.0.4
  coverage==4.5.1           requires -
  markupsafe==1.0           requires -
  docutils==0.14            requires -
  pycparser==2.18           requires pycparser==2.18
  astroid==1.6.5            requires astroid==1.6.5, backports.functools-lru-cache; python_version < "3.4", enum34>=1.1.3; python_version < "3.4", lazy-object-proxy, singledispatch; python_version < "3.4", six, wrapt
  responses==0.9.0          requires cookies, mock; python_version in "2.6, 2.7, 3.2", requests>=2.0, six
  cryptography==2.2.2       requires asn1crypto>=0.21.0, cffi>=1.7; platform_python_implementation != "PyPy", cryptography==2.2.2, enum34; python_version < "3", idna>=2.1, ipaddress; python_version < "3", pycparser, six>=1.4.1
  django-nose==1.4.5        requires nose>=1.2.1
  flake8==3.5.0             requires configparser; python_version < "3.2", enum34; python_version < "3.4", mccabe<0.7.0,>=0.6.0, pycodestyle<2.4.0,>=2.0.0, pyflakes<1.7.0,>=1.5.0
  isort==4.3.4              requires futures
  requests==2.19.1          requires certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, idna<2.8,>=2.5, requests==2.19.1, urllib3<1.24,>=1.21.1
  pytz==2018.4              requires -
  pycodestyle==2.3.1        requires -
  mockredispy==2.9.3        requires -
  boto3==1.7.47             requires boto3==1.7.47, botocore<1.11.0,>=1.10.47, docutils>=0.10, futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7", jmespath<1.0.0,>=0.7.1, python-dateutil<3.0.0,>=2.1; python_version >= "2.7", s3transfer<0.2.0,>=0.1.10, six>=1.5
  werkzeug==0.14.1          requires -

WARNING:notpip._internal.req.req_install:No PKG-INFO file found in /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/tmpklAGM1build/configparser/pip-egg-info/configparser.egg-info/PKG-INFO
WARNING:notpip._internal.req.req_install:No PKG-INFO file found in /var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/tmpklAGM1build/configparser/pip-egg-info/configparser.egg-info/PKG-INFO
Traceback (most recent call last):
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 86, in <module>
    main()
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 75, in main
    system=system,
  File "/Users/greysteil/code/pipenv/pipenv/resolver.py", line 62, in resolve
    allow_global=system,
  File "/Users/greysteil/code/pipenv/pipenv/utils.py", line 403, in resolve_deps
    req_dir=req_dir
  File "/Users/greysteil/code/pipenv/pipenv/utils.py", line 294, in actually_resolve_deps
    results = resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS)
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 104, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 204, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/resolver.py", line 282, in _iter_dependencies
    for dependency in self.repository.get_dependencies(ireq):
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/repositories/pypi.py", line 243, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/Users/greysteil/code/pipenv/pipenv/patched/piptools/repositories/pypi.py", line 335, in get_legacy_dependencies
    self.resolver.resolve(reqset)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 107, in resolve
    self._resolve_one(requirement_set, req)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 264, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/resolve.py", line 214, in _get_abstract_dist_for
    self.require_hashes
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/operations/prepare.py", line 328, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/operations/prepare.py", line 158, in prep_for_dist
    self.req.run_egg_info()
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_internal/req/req_install.py", line 502, in run_egg_info
    metadata_name = canonicalize_name(self.pkg_info()["Name"])
  File "/Users/greysteil/code/pipenv/pipenv/patched/notpip/_vendor/packaging/utils.py", line 16, in canonicalize_name
    return _canonicalize_regex.sub("-", name).lower()
TypeError: expected string or buffer
/Users/greysteil/code/pipenv/pipenv/_compat.py:108: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/var/folders/kv/y02nj9zd5ss16sn505tk6g_40000gn/T/pipenv-j9WSGO-requirements'>
  warnings.warn(warn_message, ResourceWarning)

Some observations:

  • If the error happens, it always happens during the Finding secondary dependencies: step
  • The error can happen in any round of resolution
  • Within the output of Finding secondary dependencies:, it's not always the same dependency that's just been output before the error occurs

I'm at a bit of a loss on where to dig next.

@greysteil greysteil reopened this Jun 28, 2018
techalchemy added a commit that referenced this issue Jun 29, 2018
- Prevents re-preparation of deleted `PKG-INFO` files
- Fixes #2435

Signed-off-by: Dan Ryan <dan@danryan.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants