0

I'm not sure why I can't create this virtual environment on my Mac. I get an error on a call to python3 in my environment and when I dig in it seems to be looking for something called ensurepip.

Any idea what I'm doing wrong?

  $  python3 -m venv venv_test
  Error: Command '['/Users/raysalemi/workspaces/install_mcs_project/venv_test/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
  $  /Users/raysalemi/workspaces/install_mcs_project/venv_test/bin/python3 -Im ensurepip --upgrade --default-pip
  /Users/raysalemi/workspaces/install_mcs_project/venv_test/bin/python3: No module named ensurepip
  $  pip

  Usage:
    pip <command> [options]
l'L'l
  • 44,951
  • 10
  • 95
  • 146
Ray Salemi
  • 5,247
  • 4
  • 30
  • 63
  • 2
    Maybe try `python3 -m venv --without-pip venv_test` – l'L'l Dec 21 '17 at 19:41
  • That worked. Now to figure out what the implications are of no pip and why this happened. I've installed anaconda3 v 5 – Ray Salemi Dec 21 '17 at 19:47
  • 1
    You can install `pip` using the the downloader script once you have activated your venv (`curl https://bootstrap.pypa.io/get-pip.py | python`). – l'L'l Dec 21 '17 at 19:50
  • Except pip is already installed on my machine with anaconda. So now I wonder why ensurepip is not working. – Ray Salemi Dec 21 '17 at 19:56
  • I'd rather `brew install python3` and never used `pip` with the system-provide Python. – 9000 Dec 21 '17 at 19:59
  • Normally your virtual environment will be completely separate from what is already installed on your system (so if pip is on your system and not in your virtual environment it would need to be installed there as well). It's unclear what the exact issue is, although the resolution in most cases is the solution in my first comment. More info here: https://stackoverflow.com/q/24123150/499581 – l'L'l Dec 21 '17 at 20:00
  • btw -- if you have multiple python 3.x on your system. You will want "python3.6 -m venv ...." – SteveJ Dec 21 '17 at 22:40
  • @SteveJ same issue. – Ray Salemi Dec 22 '17 at 12:15

0 Answers0