4

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.

3

I was facing the same problem on Ubuntu 20.04, but since you are on heroku i am not sure, you can execute this: Go in your terminal:

sudo apt-get remove python3-pipenv
sudo pip3 install pipenv (or sudo pip install pipenv)

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

sudo apt-get remove python3-virtualenv
sudo pip3 install virtualenv.

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:

export PATH=$PATH:/home/[your_user]/.local/bin/
-1

I think is better that you use python3-venv instead of pipenv

you can install with below code

sudo apt install python3-venv

and create a virtualenv with:

python3 -m venv <folder name for virtualenv>

and active it with:

source <folder name for virtualenv>/bin/activate

and deactivate with:

deactivate

you can use python3.8 instead of python3(Especially when another version of Python is installed on your system)

I hope it helps you

1
  • Thanks its working, but for hosting I require pipenv. – Akshat Zala May 22 '20 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.