9

I am running pipenv install --dev which is giving me the following errors

Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing dependencies from Pipfile.lock (2df4c1)…
Failed to load paths: /bin/sh: /Users/XXXX/.local/share/virtualenvs/my-service-enGYxXYk/bin/python: No such file or directory

Output: 
Failed to load paths: /bin/sh: /Users/XXXX/.local/share/virtualenvs/my-service-enGYxXYk/bin/python: No such file or directory

Output: 
Failed to load paths: /bin/sh: /Users/XXXX/.local/share/virtualenvs/my-service-enGYxXYk/bin/python: No such file or directory

I don't really want to change the command around I would rather solve the underlying issue as it is part of a package.json file in a project others are using rather than something i am just trying to run on my own machine..

Thanks

AnonymousAlias
  • 1,149
  • 2
  • 27
  • 68

4 Answers4

6

Remove your Pipfile.lock and try rerunning pipenv install to rebuild your dependencies from your Pipfile. It is looking for a virtual environment that does not exist. By removing your Pipfile.lock, you force pipenv to create a new environment.

1

I found the similar error on my ubuntu 20.04 like this :

frog@ocean:playground/demo-selenium $ pipenv install selenium
Installing selenium...
⠋ Installing...Failed to load paths: /bin/sh: 1: /home/frog/.local/share/virtualenvs/demo-selenium-aj4lh7NL/bin/python: not found

Output: 
⠙ Installing selenium...Failed to load paths: /bin/sh: 1: /home/frog/.local/share/virtualenvs/demo-selenium-aj4lh7NL/bin/python: not found

Output: 
Failed to load paths: /bin/sh: 1: /home/frog/.local/share/virtualenvs/demo-selenium-aj4lh7NL/bin/python: not found

Output: 
Error:  An error occurred while installing selenium!
Error text: 
/bin/sh: 1: /home/frog/.local/share/virtualenvs/demo-selenium-aj4lh7NL/bin/pip: not found

✘ Installation Failed 

How I solved is : When I run pipenv shell to create a new virtual environment, just add option --three or --two to specified the python version. Its because my linux doesn't install python 2. Then i run again, and voile i could install selenium, finnaly.

monti
  • 311
  • 2
  • 9
0

I ran pipenv --python 3.7 and then pipenv shell --three

It worked for me

tomerpacific
  • 4,704
  • 13
  • 34
  • 52
0

I was getting the same error in my Windows, what worked for me was running pipenv --rm and then pipenv check. Then I was able to run pipenv install without failure.

Carlos Coelho
  • 566
  • 1
  • 5
  • 14