pipenv: pipenv --three generates an error on Mac OS X
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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 34 (17 by maintainers)
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.
Before the above mentioned exports:
Yeah
are required.
Broken here too.
SETUP:
MacOS version: 10.13.4 (High Sierra)
Python 3:
brew install python
pipenv:brew install pipenv
SOLUTION:
Solved by adding the following lines to
~/.bash_profile
:Then running this command on terminal:
source ~/.bash_profile
I can reproduce this bug, it depends on the Language & Region System preferences.
Good:
Bad:
pipenv shell
Workaround is to add
to .bash_profile.
sorry about the bug!
@ms4720 en_US.UTF-8
@kennethreitz just
pipenv --three
Installing latest version with brew didn’t help me today, rather exporting the variables as mentioned earlier. I personally added them in
~/.bash_profile
to persist, not sure whether that’s the best with MacOS.Installed pipenv via pip3 and python3 of brew btw.
we should have this fixed within a few hours, here. this is a pretty major issue.