I am getting following error while creating executing pipenv shell
command:
⠋/usr/bin/python3: No module named pipenv.pew
Virtualenv location:
Creating a Pipfile for this project…
Traceback (most recent call last):
File "/usr/bin/pipenv", line 11, in <module>
load_entry_point('pipenv==11.9.0', 'console_scripts', 'pipenv')()
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pipenv/cli.py", line 571, in shell
core.do_shell(
File "/usr/lib/python3/dist-packages/pipenv/core.py", line 2093, in do_shell
ensure_project(three=three, python=python, validate=False)
File "/usr/lib/python3/dist-packages/pipenv/core.py", line 636, in ensure_project
ensure_pipfile(validate=validate, skip_requirements=skip_requirements)
File "/usr/lib/python3/dist-packages/pipenv/core.py", line 289, in ensure_pipfile
project.create_pipfile(python=python)
File "/usr/lib/python3/dist-packages/pipenv/project.py", line 518, in create_pipfile
'python_version': python_version(required_python)[: len('2.7')]
TypeError: 'NoneType' object is not subscriptable
For hosting on heroku I require pipenv shell.
I was facing the same problem on Ubuntu 20.04, but since you are on heroku I am not sure if you can execute these but, in your terminal:
After that I had another problem with the version of virtualenv. For that I removed python3-virtualenv and the version of virtualenv installed by pip
You can check, if pipenv works: /home/[your_username]/.local/bin/pipenv
If you still face a problem with virtualenv, look here: https://github.com/pypa/pipenv/issues
After it works, add /home/[your_user]/.local/bin/ to your PATH:
Some it's the case when you need to add path to your binaries. like adding
/home/<username>/.local/bin
to you $PATH.use this to add it.
Sometimes it can be due to permission issues. I run
sudo pipenv shell
it worked.In my case there was no Python 2 installed and no python executeable in my PATH. To fix this, I created a simbolic link:
I think is better that you use python3-venv instead of pipenv
you can install with below code
and create a virtualenv with:
and active it with:
and deactivate with:
you can use python3.8 instead of python3(Especially when another version of Python is installed on your system)
I hope it helps you