Pipenv: `pipenv shell` doesn't work on CircleCI

Created on 29 Sep 2017  路  5Comments  路  Source: pypa/pipenv

I can't run pipenv shell command on CircleCI. It used to work few versions back, but stops working after upgrading to latest version. Relevant information below:

$ uname -a
Linux 68d69e284471 4.4.0-92-generic #115~14.04.1-Ubuntu SMP Thu Aug 10 15:06:53 UTC 2017 x86_64 GNU/Linux

$ python --version
Python 3.6.2

$ pipenv --version
pipenv, version 8.2.2

$ pipenv --where
/home/circleci/project

$ pipenv --venv
/home/circleci/.local/share/virtualenvs/project-zxI9dQ-Q

$ pipenv shell

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 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_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/cli.py", line 2057, in shell
    do_shell(three=three, python=python, fancy=fancy, shell_args=shell_args)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 1952, in do_shell
    shell = os.path.abspath(PIPENV_SHELL)
  File "/usr/local/lib/python3.6/posixpath.py", line 369, in abspath
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Pipenv 7.0.0 works fine.
Pipenv 8.0.0 shows this error (even though $SHELL is set to /bin/bash):
`Please ensure that the SHELL environment variable is set before activating shell.

I appreciate any help! Thank you for great tool :thumbsup:

Most helpful comment

@tricoder42 Did you try pipenv run ... instead?

All 5 comments

why would you run shell on ci?

Good question, I though that pipenv shell is used to activate virtualenv... I did pipenv shell "cd docs; make html; exit". Now I'm using source $(pipenv --venv)/bin/activate; cd docs; make html instead.

So, there's nothing wrong with source $(pipenv --venv)/bin/activate? pipenv shell is for local development only?

@tricoder42 Did you try pipenv run ... instead?

correct

@philfreo I tried just now, it works great. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leileigong picture leileigong  路  3Comments

jeyraof picture jeyraof  路  3Comments

jacek-jablonski picture jacek-jablonski  路  3Comments

marc-fez picture marc-fez  路  3Comments

bgjelstrup picture bgjelstrup  路  3Comments