PyCharm 2019.3 macOS 10.15.3 pipenv not able to create environment

Hi,

I am trying to get pipenv support to work. I followed the guide at https://www.jetbrains.com/help/pycharm/pipenv.html

I installed pipenv successfully, changed the PATH accordingly and the pipenv executable is found by PyCharm.

When I try to create new project with pipenv or to create a pipenv environment for an existing project (using venv) I get 

RuntimeError: location not created nor specified

The executed command is:

/Users/joh/Library/Python/3.7/bin/pipenv --python /usr/bin/python3 install --dev

and command output is


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…
Pipfile: /Users/joh/PycharmProjects/BLLV Maillist Updater/Pipfile
Using /usr/bin/python3 (3.7.3) to create virtualenv…

⠋ Creating virtual environment...
⠙ Creating virtual environment...
⠹ Creating virtual environment...
⠸ Creating virtual environment...
⠼ Creating virtual environment...
⠴ Creating virtual environment...
⠦ Creating virtual environment...
⠧ Creating virtual environment...
⠇ Creating virtual environment...
⠏ Creating virtual environment...
⠋ Creating virtual environment...
⠙ Creating virtual environment...
⠹ Creating virtual environment...
⠸ Creating virtual environment...created virtual environment CPython3.7.3.final.0-64 in 705ms
creator CPython3Posix(dest=/Users/joh/.local/share/virtualenvs/BLLV_Maillist_Updater-iBvU68ei, clear=False, global=False)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/joh/Library/Application Support/virtualenv/seed-app-data/v1)
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

✔ Successfully created virtual environment!
Virtualenv location: /Users/joh/.local/share/virtualenvs/BLLV_Maillist_Updater-iBvU68ei
Traceback (most recent call last):
File "/Users/joh/Library/Python/3.7/bin/pipenv", line 8, in <module>
sys.exit(cli())
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 1134, in invoke
Command.invoke(self, ctx)
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/cli/command.py", line 208, in cli
clear=state.clear,
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/core.py", line 579, in ensure_project
path_to_python = which("python") or which("py")
File "/Users/joh/Library/Python/3.7/lib/python/site-packages/pipenv/core.py", line 108, in which
raise RuntimeError("location not created nor specified")
RuntimeError: location not created nor specified

 

What strikes me is the output of

python -m site --user-base

giving: 

/Users/joh/Library/Python/2.7

 

That seems quite different from what the doc says it should look like on a Mac:

/Users/jetbrains/.local

And suggest the use of Python 2.7, which might not be a very good idea

 

Any help or tips appreciated, regards

Jochen

1
2 comments

Well, so far it doesn't look like IDE-related issue, so you may want to look beyond PyCharm documentation too.

0

I was able to get rid of this by installing python 3.8 on my macbook, but I also had to change the python version in my Pipfile to 3.8 (which was fine for me). So it might be a quick workaround.

0

Please sign in to leave a comment.