question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: 'NoneType' object is not iterable

See original GitHub issue

Issue description

For pipenv version 2018.11.14, the creation of Pipfile is constantly returning TypeError: 'NoneType' object is not iterable. I got this error when I issued commands pipenv install -e . or pipenv --python 3.6.7 or pipenv install numpy. For the latter, the creation of the Virtualenv location was completed. What should I do next?

Expected result

Successful creation of Pipefile and Pipfile.lock and the installation of required package in virtual environment.

Actual result

$ pipenv --version
pipenv, version 2018.11.14
$cd ~/git/mypkg
$ pipenv install -e .
Creating a virtualenv for this project…
Pipfile: ~/git/mypkg/Pipfile
Using /usr/bin/python3 (3.5.2) to create virtualenv…
⠼ Running...Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in ~/.local/share/virtualenvs/mypkg-ZSstWkW5/bin/python3
Also creating executable in ~/.local/share/virtualenvs/mypkg-ZSstWkW5/bin/python
Installing setuptools, pip, wheel...done.
Virtualenv location: ~/.local/share/virtualenvs/mypkg-ZSstWkW5
Creating a Pipfile for this project…
✔ Complete 
Traceback (most recent call last):
  File "~/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/cli/command.py", line 249, in install
    editable_packages=state.installstate.editables,
  File "~/.local/lib/python3.5/site-packages/pipenv/core.py", line 1725, in do_install
    pypi_mirror=pypi_mirror,
  File "~/.local/lib/python3.5/site-packages/pipenv/core.py", line 604, in ensure_project
    validate=validate, skip_requirements=skip_requirements, system=system
  File "~/.local/lib/python3.5/site-packages/pipenv/core.py", line 320, in ensure_pipfile
    project.create_pipfile(python=python)
  File "~/.local/lib/python3.5/site-packages/pipenv/project.py", line 722, in create_pipfile
    required_python = self.which("python", self.virtualenv_location)
  File "~/.local/lib/python3.5/site-packages/pipenv/project.py", line 1074, in which
    result = next(iter(filter(None, (find(finder) for finder in self.finders))), None)
  File "~/.local/lib/python3.5/site-packages/pipenv/project.py", line 1074, in <genexpr>
    result = next(iter(filter(None, (find(finder) for finder in self.finders))), None)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 67, in which
    return self.system_path.which(exe)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 54, in system_path
    ignore_unsupported=self.ignore_unsupported,
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 451, in create
    ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 75e45f144e3d5510d54dd5fca6730b98fa0220a9>", line 38, in __init__
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 116, in __attrs_post_init__
    self._setup_pyenv()
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 196, in _setup_pyenv
    version_glob_path="versions/*", ignore_unsupported=self.ignore_unsupported
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 154, in create
    sort_function=sort_function, version_glob_path=version_glob_path)
  File "<attrs generated init 513173584682552efeecee9238f4c2ee8c5c744e>", line 17, in __init__
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 98, in get_versions
    for p in self.get_version_order():
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 70, in get_version_order
    version_order = [versions[v] for v in parse_pyenv_version_order()]
TypeError: 'NoneType' object is not iterable
$ pipenv --python 3.6.7
Traceback (most recent call last):
  File "~/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/cli/command.py", line 203, in cli
    clear=state.clear,
  File "~/.local/lib/python3.5/site-packages/pipenv/core.py", line 569, in ensure_project
    pypi_mirror=pypi_mirror,
  File "~/.local/lib/python3.5/site-packages/pipenv/core.py", line 489, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "~/.local/lib/python3.5/site-packages/pipenv/core.py", line 397, in ensure_python
    path_to_python = find_a_system_python(python)
  File "~/.local/lib/python3.5/site-packages/pipenv/core.py", line 360, in find_a_system_python
    python_entry = finder.find_python_version(line)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 113, in find_python_version
    return self.system_path.find_python_version(
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 54, in system_path
    ignore_unsupported=self.ignore_unsupported,
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 451, in create
    ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 75e45f144e3d5510d54dd5fca6730b98fa0220a9>", line 38, in __init__
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 116, in __attrs_post_init__
    self._setup_pyenv()
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 196, in _setup_pyenv
    version_glob_path="versions/*", ignore_unsupported=self.ignore_unsupported
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 154, in create
    sort_function=sort_function, version_glob_path=version_glob_path)
  File "<attrs generated init ceadc4956dc4f996262dab732dae93ed2d67f457>", line 17, in __init__
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 98, in get_versions
    for p in self.get_version_order():
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 70, in get_version_order
    version_order = [versions[v] for v in parse_pyenv_version_order()]
TypeError: 'NoneType' object is not iterable
$ pipenv install numpy
Creating a virtualenv for this project…
Pipfile: ~/git/mypkg/Pipfile
Using /usr/bin/python3 (3.5.2) to create virtualenv…
⠼ Running...Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in ~/.local/share/virtualenvs/mypkg-2z7If1d0/bin/python3
Also creating executable in ~/.local/share/virtualenvs/mypkg-2z7If1d0/bin/python
Installing setuptools, pip, wheel...done.
Virtualenv location: ~/.local/share/virtualenvs/mypkg-2z7If1d0
Creating a Pipfile for this project…
✔ Complete 
Traceback (most recent call last):
  File "~/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "~/.local/lib/python3.5/site-packages/pipenv/cli/command.py", line 249, in install
    editable_packages=state.installstate.editables,
  File "~/.local/lib/python3.5/site-packages/pipenv/core.py", line 1725, in do_install
    pypi_mirror=pypi_mirror,
  File "~/.local/lib/python3.5/site-packages/pipenv/core.py", line 604, in ensure_project
    validate=validate, skip_requirements=skip_requirements, system=system
  File "~/.local/lib/python3.5/site-packages/pipenv/core.py", line 320, in ensure_pipfile
    project.create_pipfile(python=python)
  File "~/.local/lib/python3.5/site-packages/pipenv/project.py", line 722, in create_pipfile
    required_python = self.which("python", self.virtualenv_location)
  File "~/.local/lib/python3.5/site-packages/pipenv/project.py", line 1074, in which
    result = next(iter(filter(None, (find(finder) for finder in self.finders))), None)
  File "~/.local/lib/python3.5/site-packages/pipenv/project.py", line 1074, in <genexpr>
    result = next(iter(filter(None, (find(finder) for finder in self.finders))), None)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 67, in which
    return self.system_path.which(exe)
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 54, in system_path
    ignore_unsupported=self.ignore_unsupported,
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 451, in create
    ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 75e45f144e3d5510d54dd5fca6730b98fa0220a9>", line 38, in __init__
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 116, in __attrs_post_init__
    self._setup_pyenv()
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 196, in _setup_pyenv
    version_glob_path="versions/*", ignore_unsupported=self.ignore_unsupported
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 154, in create
    sort_function=sort_function, version_glob_path=version_glob_path)
  File "<attrs generated init d3ce2b26408ec3fc57fcdac66b71ec7abfab6c0f>", line 17, in __init__
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 98, in get_versions
    for p in self.get_version_order():
  File "~/.local/lib/python3.5/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 70, in get_version_order
    version_order = [versions[v] for v in parse_pyenv_version_order()]
TypeError: 'NoneType' object is not iterable

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
techalchemycommented, Nov 26, 2018

Release is up on pypi. No idea about homebrew 😦

3reactions
techalchemycommented, Nov 21, 2018

No worries, the actual fix will be released shortly (in the process of a few more fixes before we can release) – sorry again for the trouble, I know a lot of folks are relying on pipenv for day to day processes

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: 'NoneType' object is not iterable in Python
It means that the data variable is passing None (which is type NoneType), its equivalent for nothing. So ...
Read more >
Python TypeError: 'NoneType' object is not iterable Solution | CK
The TypeError: 'NoneType' object is not iterable error is raised when you try to iterate over an object whose value is equal to...
Read more >
TypeError: 'NoneType' object is not iterable in Python
The Python "TypeError: 'NoneType' object is not iterable" occurs when we try to iterate over a None value. To solve the error, ...
Read more >
typeerror: 'nonetype' object is not iterable: How to solve this ...
With Python, you can only iterate over an object if that object has a value. This is because iterable objects only have a...
Read more >
Typeerror nonetype object is not iterable : Complete Solution
Typeerror nonetype object is not iterable error occurs when we try to iterate any NoneType object in the place of iterable Python objects....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found