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.

pipenv --three generates an error on Mac OS X

See original GitHub issue

I had to manually set the python variable to the correct place in the cli.py file because it was, somehow, getting the wrong path.

which('python') was returning /bin/python/ instead of the correct path.

This is the stack trace:

Virtualenv location:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/cli.py", line 1163, in cli
    ensure_project(three=three, python=python)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/cli.py", line 382, in ensure_project
    if project.required_python_version not in python_version(path_to_python):
TypeError: argument of type 'NoneType' is not iterable

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:34 (17 by maintainers)

github_iconTop GitHub Comments

73reactions
jussihuotaricommented, Sep 20, 2017

Not working for me on MacOs + Brew-installed python3. However, the error went away after setting the locale so I assume this may have something to do with https://bugs.python.org/issue18378.

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Before the above mentioned exports:

$ which pip3
/usr/local/bin/pip3
$ pip3 install pipenv
Collecting pipenv
  ...
  ...
  ...
Successfully installed pipenv-7.3.7
$ pipenv --three
Warning: the environment variable LANG is not set!
We recommend setting this in ~/.profile (or equivalent) for proper expected behavior.
Creating a virtualenv for this project…
Using /usr/local/bin/python3 to create virtualenv…
...
...
Virtualenv location: 
Creating a Pipfile for this project…
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 1422, in cli
    ensure_project(three=three, python=python, warn=True)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 549, in ensure_project
    ensure_pipfile(validate=validate)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 293, in ensure_pipfile
    project.create_pipfile(python=python)
  File "/usr/local/lib/python3.6/site-packages/pipenv/project.py", line 328, in create_pipfile
    data[u'requires'] = {'python_version': python_version(python)[:len('2.7')]}
TypeError: 'NoneType' object is not subscriptable
53reactions
kennethreitzcommented, Sep 20, 2017

Yeah

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

are required.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using `pipenv install` on a Mac fails with 'No such file or ...
1 Answer 1 · I already created a virtual env using Homebrew's python@3.7 · Check that virtual env python is just a symlink...
Read more >
Common Pipenv Errors and How to Solve Them: Why Won't it ...
When you begin a project with Pipenv, the tool automatically creates a virtual environment, a Pipfile, and a Pipfile.lock. The Pipfile is very...
Read more >
Frequently Encountered Pipenv Problems - Read the Docs
Here are some common questions people have using Pipenv. Please take a look below and see if they resolve your problem. Note. Make...
Read more >
pipenv Documentation - Read the Docs
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the. Python...
Read more >
Advanced Usage of Pipenv - Python Packaging Authority
All unspecified packages are resolved using the default index source; the default package index is PyPI. For a specific package to be installed...
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