Forums

Pipenv shell start error: FileNotFoundError: [Errno 2] No such file or directory: '/proc/xxxx/stat'

Hi all,

i'm trying to use pipenv, installing works, now I wanted to start the shell with pipenv shell and I got the error below. At first I thought I messed too much with pipenv, but in a new useraccount the same error occurs.

The directory '/proc/xxxxx/stat doesn't exist', so the error message is in my opinion correct, unfortunately I don't know how to fix this...

Traceback (most recent call last):   File
"/home/florisnetten/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())   File "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py",
line 722, in __call__
    return self.main(*args, **kwargs)   File "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py",
line 697, in main
    rv = self.invoke(ctx)   File "/home/florisnetten/.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 "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py",
line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)   File "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py",
line 535, in invoke
    return callback(*args, **kwargs)   File "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/cli.py",
line 664, in shell
    three=three, python=python, fancy=fancy, shell_args=shell_args, pypi_mirror=pypi_mirror   File
"/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/core.py",
line 2149, in do_shell
    shell = choose_shell()   File "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/shells.py",
line 217, in choose_shell
    type_, command = detect_info()   File "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/shells.py",
line 25, in detect_info
    return shellingham.detect_shell()   File "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/vendor/shellingham/__init__.py",
line 24, in detect_shell
    shell = get_shell(pid, max_depth=max_depth)   File "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/vendor/shellingham/posix/__init__.py",
line 20, in get_shell
    mapping = _get_process_mapping()   File "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/vendor/shellingham/posix/__init__.py",
line 13, in _get_process_mapping
    return impl.get_process_mapping()   File "/home/florisnetten/.local/lib/python3.6/site-packages/pipenv/vendor/shellingham/posix/linux.py",
line 14, in get_process_mapping
    with open('/proc/{0}/stat'.format(os.getpid())) as f: FileNotFoundError: [Errno 2] No such file or directory:
'/proc/31027/stat'

[edit by admin: formatting]

Hmm. Unfortunately that suggests that pipenv -- at least as you have it configured -- isn't compatible with our virtualization system. Could you give us the exact steps you did in order to get that trace?

Hello Giles,

first of all I'm a complete noob regarding python and pipenv but I've managed to install it on my laptop, was looking for a solution to use python in a easy way on multiple machines and pythonanywhere is great!

I tried to install pipenv according to this topic: Pipenv install. On the shell used the command pip3.6 install --user pipenv created a test dir in the test dir I used pipenv install request wanted to start pipenv shell

After that got an error message such as mentioned in the starting post. Looks like it wants to do something with the pid. I read somewhere else on the forum that you do not provide the pid or something like that.

Yeah. Sorry. As @giles said, it looks like it's just not compatible with our virtualisation system.

Use pipenv 2018.6.25

Do

pip install pipenv==2018.6.25 --user

Then you may use pipenv shell properly.

This works thanks: pip install pipenv==2018.6.25 --user

But why doesn't the latest pipenv work?

@chris I believe we have been corresponding over email. Pipenv tries to access /proc/, which is not mounted for a regular user environment. this error can be worked around by using docker consoles, and this should let you use the latest pipenv. Do let us know if this you want to try this, and let us know if it works!