Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pipenv Install RuntimeError: location not created nor specified

I am using Pipenv to manage project dependencies. It was working fine so far until now. Now I am trying to bootstrap an environment with pipenv install and I am getting the following error:

❯ pipenv install --dev --skip-lock
Creating a virtualenv for this project…
Pipfile: /Users/user/project/Pipfile
Using /usr/bin/python3 (3.7.3) to create virtualenv…
⠧ Creating virtual environment...created virtual environment CPython3.7.3.final.0-64 in 399ms
  creator CPython3Posix(dest=/Users/user/.local/share/virtualenvs/sql_runner-ABIm84c6, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/user/Library/Application Support/virtualenv/seed-app-data/v1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

✔ Successfully created virtual environment!
Virtualenv location: /Users/user/.local/share/virtualenvs/sql_runner-ABIm84c6
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/cli/command.py", line 235, in install
    retcode = do_install(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/core.py", line 1734, in do_install
    ensure_project(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/core.py", line 579, in ensure_project
    path_to_python = which("python") or which("py")
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/core.py", line 108, in which
    raise RuntimeError("location not created nor specified")
RuntimeError: location not created nor specified

The Pipfile is the following

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

[dev-packages]
pytest     = "==4.6.3"
flake8     = "==3.7.7"
autopep8   = "==1.4.4"
pytest-cov = "==2.7.1"
moto       = "==1.3.13"
Sphinx     = "==2.3.1"

[packages]
psycopg2-binary          = "==2.8.2"
boto3                    = "==1.9.166"
pymongo                  = "==3.8.0"
deprecated               = "==1.2.5"
paramiko                 = "==2.6.0"
pandas                   = "==0.24.2"
pyarrow                  = "==0.14.0"
SQLAlchemy               = "==1.3.15"
s3fs                     = "==0.4.0"

[requires]
python_version = "3.7"

I have installed Pipenv with Homebrew. I am not sure what could have changed to stop working. Other older projects keep working, but every time that I try to create an environment I get this error.

Thanks!

like image 717
pablosjv Avatar asked Mar 30 '20 07:03

pablosjv


1 Answers

So I manage to make it work. My default python system installation was 3.7.3. However, pipenv didn't like that one for some reason. I installed python 3.7.7 with homebrew and pipenv was able to locate that version properly and use it to create a virtual environment.

In summary, to fix this issue try to install python again. In my case:

brew install python
like image 179
pablosjv Avatar answered Sep 18 '22 22:09

pablosjv