Evandro Pomatti
Evandro Pomatti

Reputation: 15094

Pipenv install on Ubuntu and WSL fails

For some reason when I run pipenv install it tries to execute my Windows python.exe:

OSError: [Errno 8] Exec format error: '/mnt/c/Users/<MY_USER_NAME>/AppData/Local/
Microsoft/WindowsApps/python.exe'

I am running WSL Ubuntu 18.04. I have installed Pipenv with the following commands:

sudo apt install python3-pip
pip3 install --user pipenv
python3 -m site --user-base

Added ~/.local/bin to ~/.profile PATH, and then source ~/.profile

Upvotes: 1

Views: 2807

Answers (1)

Evandro Pomatti
Evandro Pomatti

Reputation: 15094

This worked for me:

pipenv install --python=/usr/bin/python3.6

Explanation: https://github.com/pypa/pipenv/issues/3488

The python version on Windows is higher than that on WSL, making it come before the latter one..

Specify python path explicitly can fix the problem:

$ pipenv --python /usr/bin/python3

Upvotes: 3

Related Questions