We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add venv into docker image to enable editable `pip install`
When trying to install composer with `pip install -e .` from within the docker image, we are seeing this error:
```
Traceback (most recent call last):
  File "/usr/bin/composer", line 33, in <module>
    sys.exit(load_entry_point('mosaicml', 'console_scripts', 'composer')())
  File "/usr/bin/composer", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.8/importlib/metadata.py", line 445, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.8/importlib/metadata.py", line 169, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: mosaicml
```
This seems to be remedied by running the `pip install` from within a virtualenv. Can we bake a virtualenv into the docker image as a workaround?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 # Copyright 2021 MosaicML. All Rights Reserved.
2 
3 import os
4 import sys
5 import textwrap
6 
7 import setuptools
8 from setuptools import setup
9 
10 
11 def package_files(directory: str):
12     # from https://stackoverflow.com/a/36693250
13     paths = []
14     for (path, _, filenames) in os.walk(directory):
15         for filename in filenames:
16             paths.append(os.path.join('..', path, filename))
17     return paths
18 
19 
20 with open("README.md", "r", encoding="utf-8") as fh:
21     long_description = fh.read()
22 
23 install_requires = [
24     "pyyaml>=5.4.1",
25     "tqdm>=4.62.3",
26     "torchmetrics>=0.6.0",
27     "torch_optimizer==0.1.0",
28     "torchvision>=0.9.0",
29     "torch>=1.9",
30     "yahp>=0.0.14",
31     "numpy==1.21.5",
32 ]
33 extra_deps = {}
34 
35 extra_deps['base'] = []
36 
37 extra_deps['dev'] = [
38     "custom_inherit==2.3.2",
39     'junitparser>=2.1.1',
40     'coverage[toml]>=6.1.1',
41     'fasteners>=0.16.3',  # run_directory_uploader tests require fasteners
42     'pytest>=6.2.0',
43     'yapf>=0.13.0',
44     'isort>=5.9.3',
45     'ipython>=7.29.0',
46     'ipykernel>=6.5.0',
47     'jupyter>=1.0.0',
48     'yamllint>=1.26.2',
49     'pytest-timeout>=1.4.2',
50     'recommonmark>=0.7.1',
51     'sphinx>=4.2.0',
52     'sphinx_copybutton>=0.4.0',
53     'sphinx_markdown_tables>=0.0.15',
54     'sphinx-argparse>=0.3.1',
55     'sphinxcontrib.katex>=0.8.6',
56     'sphinxext.opengraph>=0.4.2',
57     'sphinxemoji>=0.2.0',
58     'sphinx_rtd_theme>=1.0.0',
59     'testbook>=0.4.2',
60     'myst-parser>=0.15.2',
61 ]
62 extra_deps['logging'] = ['wandb>=0.12.2', 'apache-libcloud>=3.4.1']
63 
64 extra_deps['nlp'] = [
65     'transformers>=4.11.3',
66     'datasets>=1.14.0',
67 ]
68 
69 extra_deps['unet'] = [
70     'monai>=0.7.0',
71     'scikit-learn>=1.0.1',
72 ]
73 
74 extra_deps['deepspeed'] = [
75     'deepspeed>=0.5.5',
76 ]
77 
78 extra_deps['all'] = set(dep for deps in extra_deps.values() for dep in deps)
79 
80 setup(
81     name="mosaicml",
82     version="0.3.1",
83     author="MosaicML",
84     author_email="team@mosaicml.com",
85     description="composing methods for ML training efficiency",
86     long_description=long_description,
87     long_description_content_type="text/markdown",
88     url="https://github.com/mosaicml/composer",
89     include_package_data=True,
90     package_data={
91         "composer": ['py.typed'],
92         "": package_files('composer/yamls'),
93     },
94     packages=setuptools.find_packages(exclude=["tests*"]),
95     classifiers=[
96         "Programming Language :: Python :: 3",
97     ],
98     install_requires=install_requires,
99     entry_points={
100         'console_scripts': ['composer = composer.cli.launcher:main',],
101     },
102     extras_require=extra_deps,
103     dependency_links=['https://developer.download.nvidia.com/compute/redist'],
104     python_requires='>=3.7',
105     ext_package="composer",
106 )
107 
108 # only visible if user installs with verbose -v flag
109 # Printing to stdout as not to interfere with setup.py CLI flags (e.g. --version)
110 print("*" * 20, file=sys.stderr)
111 print(textwrap.dedent("""NOTE: For best performance, we recommend installing Pillow-SIMD
112     for accelerated image processing operations. To install:
113     \t pip uninstall pillow && pip install pillow-simd"""),
114       file=sys.stderr)
115 print("*" * 20, file=sys.stderr)
116
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1,12 +1,16 @@
 # Copyright 2021 MosaicML. All Rights Reserved.
 
 import os
+import site
 import sys
 import textwrap
 
 import setuptools
 from setuptools import setup
 
+# From https://github.com/pypa/pip/issues/7953#issuecomment-645133255
+site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
+
 
 def package_files(directory: str):
     # from https://stackoverflow.com/a/36693250

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -1,12 +1,16 @@\n # Copyright 2021 MosaicML. All Rights Reserved.\n \n import os\n+import site\n import sys\n import textwrap\n \n import setuptools\n from setuptools import setup\n \n+# From https://github.com/pypa/pip/issues/7953#issuecomment-645133255\n+site.ENABLE_USER_SITE = \"--user\" in sys.argv[1:]\n+\n \n def package_files(directory: str):\n     # from https://stackoverflow.com/a/36693250\n", "issue": "Add venv into docker image to enable editable `pip install`\nWhen trying to install composer with `pip install -e .` from within the docker image, we are seeing this error:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/composer\", line 33, in <module>\r\n    sys.exit(load_entry_point('mosaicml', 'console_scripts', 'composer')())\r\n  File \"/usr/bin/composer\", line 22, in importlib_load_entry_point\r\n    for entry_point in distribution(dist_name).entry_points\r\n  File \"/usr/lib/python3.8/importlib/metadata.py\", line 445, in distribution\r\n    return Distribution.from_name(distribution_name)\r\n  File \"/usr/lib/python3.8/importlib/metadata.py\", line 169, in from_name\r\n    raise PackageNotFoundError(name)\r\nimportlib.metadata.PackageNotFoundError: mosaicml\r\n```\r\nThis seems to be remedied by running the `pip install` from within a virtualenv. Can we bake a virtualenv into the docker image as a workaround?\n", "before_files": [{"content": "# Copyright 2021 MosaicML. All Rights Reserved.\n\nimport os\nimport sys\nimport textwrap\n\nimport setuptools\nfrom setuptools import setup\n\n\ndef package_files(directory: str):\n    # from https://stackoverflow.com/a/36693250\n    paths = []\n    for (path, _, filenames) in os.walk(directory):\n        for filename in filenames:\n            paths.append(os.path.join('..', path, filename))\n    return paths\n\n\nwith open(\"README.md\", \"r\", encoding=\"utf-8\") as fh:\n    long_description = fh.read()\n\ninstall_requires = [\n    \"pyyaml>=5.4.1\",\n    \"tqdm>=4.62.3\",\n    \"torchmetrics>=0.6.0\",\n    \"torch_optimizer==0.1.0\",\n    \"torchvision>=0.9.0\",\n    \"torch>=1.9\",\n    \"yahp>=0.0.14\",\n    \"numpy==1.21.5\",\n]\nextra_deps = {}\n\nextra_deps['base'] = []\n\nextra_deps['dev'] = [\n    \"custom_inherit==2.3.2\",\n    'junitparser>=2.1.1',\n    'coverage[toml]>=6.1.1',\n    'fasteners>=0.16.3',  # run_directory_uploader tests require fasteners\n    'pytest>=6.2.0',\n    'yapf>=0.13.0',\n    'isort>=5.9.3',\n    'ipython>=7.29.0',\n    'ipykernel>=6.5.0',\n    'jupyter>=1.0.0',\n    'yamllint>=1.26.2',\n    'pytest-timeout>=1.4.2',\n    'recommonmark>=0.7.1',\n    'sphinx>=4.2.0',\n    'sphinx_copybutton>=0.4.0',\n    'sphinx_markdown_tables>=0.0.15',\n    'sphinx-argparse>=0.3.1',\n    'sphinxcontrib.katex>=0.8.6',\n    'sphinxext.opengraph>=0.4.2',\n    'sphinxemoji>=0.2.0',\n    'sphinx_rtd_theme>=1.0.0',\n    'testbook>=0.4.2',\n    'myst-parser>=0.15.2',\n]\nextra_deps['logging'] = ['wandb>=0.12.2', 'apache-libcloud>=3.4.1']\n\nextra_deps['nlp'] = [\n    'transformers>=4.11.3',\n    'datasets>=1.14.0',\n]\n\nextra_deps['unet'] = [\n    'monai>=0.7.0',\n    'scikit-learn>=1.0.1',\n]\n\nextra_deps['deepspeed'] = [\n    'deepspeed>=0.5.5',\n]\n\nextra_deps['all'] = set(dep for deps in extra_deps.values() for dep in deps)\n\nsetup(\n    name=\"mosaicml\",\n    version=\"0.3.1\",\n    author=\"MosaicML\",\n    author_email=\"team@mosaicml.com\",\n    description=\"composing methods for ML training efficiency\",\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    url=\"https://github.com/mosaicml/composer\",\n    include_package_data=True,\n    package_data={\n        \"composer\": ['py.typed'],\n        \"\": package_files('composer/yamls'),\n    },\n    packages=setuptools.find_packages(exclude=[\"tests*\"]),\n    classifiers=[\n        \"Programming Language :: Python :: 3\",\n    ],\n    install_requires=install_requires,\n    entry_points={\n        'console_scripts': ['composer = composer.cli.launcher:main',],\n    },\n    extras_require=extra_deps,\n    dependency_links=['https://developer.download.nvidia.com/compute/redist'],\n    python_requires='>=3.7',\n    ext_package=\"composer\",\n)\n\n# only visible if user installs with verbose -v flag\n# Printing to stdout as not to interfere with setup.py CLI flags (e.g. --version)\nprint(\"*\" * 20, file=sys.stderr)\nprint(textwrap.dedent(\"\"\"NOTE: For best performance, we recommend installing Pillow-SIMD\n    for accelerated image processing operations. To install:\n    \\t pip uninstall pillow && pip install pillow-simd\"\"\"),\n      file=sys.stderr)\nprint(\"*\" * 20, file=sys.stderr)\n", "path": "setup.py"}], "after_files": [{"content": "# Copyright 2021 MosaicML. All Rights Reserved.\n\nimport os\nimport site\nimport sys\nimport textwrap\n\nimport setuptools\nfrom setuptools import setup\n\n# From https://github.com/pypa/pip/issues/7953#issuecomment-645133255\nsite.ENABLE_USER_SITE = \"--user\" in sys.argv[1:]\n\n\ndef package_files(directory: str):\n    # from https://stackoverflow.com/a/36693250\n    paths = []\n    for (path, _, filenames) in os.walk(directory):\n        for filename in filenames:\n            paths.append(os.path.join('..', path, filename))\n    return paths\n\n\nwith open(\"README.md\", \"r\", encoding=\"utf-8\") as fh:\n    long_description = fh.read()\n\ninstall_requires = [\n    \"pyyaml>=5.4.1\",\n    \"tqdm>=4.62.3\",\n    \"torchmetrics>=0.6.0\",\n    \"torch_optimizer==0.1.0\",\n    \"torchvision>=0.9.0\",\n    \"torch>=1.9\",\n    \"yahp>=0.0.14\",\n    \"numpy==1.21.5\",\n]\nextra_deps = {}\n\nextra_deps['base'] = []\n\nextra_deps['dev'] = [\n    \"custom_inherit==2.3.2\",\n    'junitparser>=2.1.1',\n    'coverage[toml]>=6.1.1',\n    'fasteners>=0.16.3',  # run_directory_uploader tests require fasteners\n    'pytest>=6.2.0',\n    'yapf>=0.13.0',\n    'isort>=5.9.3',\n    'ipython>=7.29.0',\n    'ipykernel>=6.5.0',\n    'jupyter>=1.0.0',\n    'yamllint>=1.26.2',\n    'pytest-timeout>=1.4.2',\n    'recommonmark>=0.7.1',\n    'sphinx>=4.2.0',\n    'sphinx_copybutton>=0.4.0',\n    'sphinx_markdown_tables>=0.0.15',\n    'sphinx-argparse>=0.3.1',\n    'sphinxcontrib.katex>=0.8.6',\n    'sphinxext.opengraph>=0.4.2',\n    'sphinxemoji>=0.2.0',\n    'sphinx_rtd_theme>=1.0.0',\n    'testbook>=0.4.2',\n    'myst-parser>=0.15.2',\n]\nextra_deps['logging'] = ['wandb>=0.12.2', 'apache-libcloud>=3.4.1']\n\nextra_deps['nlp'] = [\n    'transformers>=4.11.3',\n    'datasets>=1.14.0',\n]\n\nextra_deps['unet'] = [\n    'monai>=0.7.0',\n    'scikit-learn>=1.0.1',\n]\n\nextra_deps['deepspeed'] = [\n    'deepspeed>=0.5.5',\n]\n\nextra_deps['all'] = set(dep for deps in extra_deps.values() for dep in deps)\n\nsetup(\n    name=\"mosaicml\",\n    version=\"0.3.1\",\n    author=\"MosaicML\",\n    author_email=\"team@mosaicml.com\",\n    description=\"composing methods for ML training efficiency\",\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    url=\"https://github.com/mosaicml/composer\",\n    include_package_data=True,\n    package_data={\n        \"composer\": ['py.typed'],\n        \"\": package_files('composer/yamls'),\n    },\n    packages=setuptools.find_packages(exclude=[\"tests*\"]),\n    classifiers=[\n        \"Programming Language :: Python :: 3\",\n    ],\n    install_requires=install_requires,\n    entry_points={\n        'console_scripts': ['composer = composer.cli.launcher:main',],\n    },\n    extras_require=extra_deps,\n    dependency_links=['https://developer.download.nvidia.com/compute/redist'],\n    python_requires='>=3.7',\n    ext_package=\"composer\",\n)\n\n# only visible if user installs with verbose -v flag\n# Printing to stdout as not to interfere with setup.py CLI flags (e.g. --version)\nprint(\"*\" * 20, file=sys.stderr)\nprint(textwrap.dedent(\"\"\"NOTE: For best performance, we recommend installing Pillow-SIMD\n    for accelerated image processing operations. To install:\n    \\t pip uninstall pillow && pip install pillow-simd\"\"\"),\n      file=sys.stderr)\nprint(\"*\" * 20, file=sys.stderr)\n", "path": "setup.py"}]}