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

Rely on venv instead of virtualenv

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 4.0
    • CI

    Description

      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
        

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: