Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2437

Rely on venv instead of virtualenv

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.0
    • Affects Version/s: None
    • Component/s: CI

      Once we drop support for Python 2 we could start relying on venv instead of virtualenv. However, there are still a few hiccups with using venv:

      • on Ubuntu 18.04 "python3 -m venv mongovenv" fails with this error:
         [2020/11/20 21:34:33.329] Finished 'shell.exec' in "run aws auth test with regular aws credentials" in 13.76142158s
         [2020/11/20 21:34:33.329] Running command 'shell.exec' in "run aws auth test with assume role credentials" (step 4.1 of 8)
         [2020/11/20 21:34:33.408] The virtual environment was not created successfully because ensurepip is not
         [2020/11/20 21:34:33.408] available.  On Debian/Ubuntu systems, you need to install the python3-venv
         [2020/11/20 21:34:33.408] package using the following command.
         [2020/11/20 21:34:33.408]     apt-get install python3-venv
         [2020/11/20 21:34:33.408] You may need to use sudo with that command.  After installing the python3-venv
         [2020/11/20 21:34:33.408] package, recreate your virtual environment.
         [2020/11/20 21:34:33.408] Failing command: ['/data/mci/751269f52662093748413aa179689d98/src/mongovenv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']
        
      • On Windows "C:/python/Python38/python.exe -m venv mongovenv" succeeds but attempting to activate the venv fails with this error:
         [2020/11/20 21:34:02.310] Running command 'shell.exec' in "run aws auth test with assume role credentials" (step 4.1 of 8)
         [2020/11/20 21:34:06.700] mongovenv/Scripts/activate: line 3: $'\r': command not found
        

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: