We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[2.0] "pip3 install napalm" doesn't install requirements
Debian 9.2 (Stretch) with python3 v3.5.3, pip3 v9.0.1

With v1.2.0 a `pip3 install napalm==1.2.0` installs also the required modules (MarkupSafe, jinja2, netaddr, pyYAML, pyeapi, future, pynacl, bcrypt, paramiko, pyFG, scp, netmiko, lxml, pyIOSXR, ncclient, pyserial, junos-eznc, urllib3, idna, certifi, chardet, requests, pynxos, pan-python, requests-toolbelt, xmltodict, pyPluribus, chainmap, librouteros, vyattaconfparser).

With Napalm v2.0.0 no required module is installed with `pip3 install napalm`, so napalm won't work.

--- 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 """setup.py file."""
2 import uuid
3 import os
4 
5 from distutils.core import Command
6 from setuptools import setup, find_packages
7 from setuptools.command import install
8 
9 
10 from pip.req import parse_requirements
11 
12 import pip
13 import sys
14 
15 __author__ = 'David Barroso <dbarrosop@dravetech.com>'
16 
17 # Read SUPPORTED_DRIVERS from file (without importing)
18 _locals = {}
19 filename = os.path.join('napalm', '_SUPPORTED_DRIVERS.py')
20 with open(filename) as supported:
21     exec(supported.read(), None, _locals)
22     SUPPORTED_DRIVERS = _locals['SUPPORTED_DRIVERS']
23 
24 
25 def process_requirements(dep):
26     print("PROCESSING DEPENDENCIES FOR {}".format(dep))
27     u = uuid.uuid1()
28     iter_reqs = parse_requirements("requirements/{}".format(dep), session=u)
29     [pip.main(['install', (str(ir.req))]) for ir in iter_reqs]
30 
31 
32 def custom_command_driver(driver):
33     class CustomCommand(Command):
34         """A custom command to run Pylint on all Python source files."""
35         user_options = []
36 
37         def initialize_options(self):
38             pass
39 
40         def finalize_options(self):
41             pass
42 
43         def run(self):
44             """Run command."""
45             process_requirements(driver)
46 
47     return CustomCommand
48 
49 
50 class CustomInstall(install.install):
51     """A custom command to run Pylint on all Python source files."""
52 
53     def run(self):
54         """Run command."""
55         if any([d in sys.argv for d in SUPPORTED_DRIVERS]):
56             process_requirements('base')
57         else:
58             process_requirements('all')
59         install.install.run(self)
60 
61 
62 custom_commands = {d: custom_command_driver(d) for d in SUPPORTED_DRIVERS}
63 custom_commands['install'] = CustomInstall
64 
65 setup(
66     cmdclass=custom_commands,
67     name="napalm",
68     version='2.0.0',
69     packages=find_packages(exclude=("test*", )),
70     test_suite='test_base',
71     author="David Barroso, Kirk Byers, Mircea Ulinic",
72     author_email="dbarrosop@dravetech.com, ping@mirceaulinic.net, ktbyers@twb-tech.com",
73     description="Network Automation and Programmability Abstraction Layer with Multivendor support",
74     classifiers=[
75         'Topic :: Utilities',
76         'Programming Language :: Python',
77         'Programming Language :: Python :: 2',
78         'Programming Language :: Python :: 2.7',
79         'Programming Language :: Python :: 3',
80         'Programming Language :: Python :: 3.4',
81         'Programming Language :: Python :: 3.5',
82         'Programming Language :: Python :: 3.6',
83         'Operating System :: POSIX :: Linux',
84         'Operating System :: MacOS',
85     ],
86     url="https://github.com/napalm-automation/napalm",
87     include_package_data=True,
88     install_requires=[],
89     entry_points={
90         'console_scripts': [
91             'cl_napalm_configure=napalm.base.clitools.cl_napalm_configure:main',
92             'cl_napalm_test=napalm.base.clitools.cl_napalm_test:main',
93             'cl_napalm_validate=napalm.base.clitools.cl_napalm_validate:main',
94             'napalm=napalm.base.clitools.cl_napalm:main',
95         ],
96     }
97 )
98
```
--- 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
@@ -5,11 +5,12 @@
 from distutils.core import Command
 from setuptools import setup, find_packages
 from setuptools.command import install
+from subprocess import check_call
 
 
 from pip.req import parse_requirements
 
-import pip
+import pip  # noqa: test pip is installed
 import sys
 
 __author__ = 'David Barroso <dbarrosop@dravetech.com>'
@@ -26,7 +27,9 @@
     print("PROCESSING DEPENDENCIES FOR {}".format(dep))
     u = uuid.uuid1()
     iter_reqs = parse_requirements("requirements/{}".format(dep), session=u)
-    [pip.main(['install', (str(ir.req))]) for ir in iter_reqs]
+
+    for ir in iter_reqs:
+        check_call([sys.executable, '-m', 'pip', 'install', str(ir.req)])
 
 
 def custom_command_driver(driver):

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -5,11 +5,12 @@\n from distutils.core import Command\n from setuptools import setup, find_packages\n from setuptools.command import install\n+from subprocess import check_call\n \n \n from pip.req import parse_requirements\n \n-import pip\n+import pip  # noqa: test pip is installed\n import sys\n \n __author__ = 'David Barroso <dbarrosop@dravetech.com>'\n@@ -26,7 +27,9 @@\n     print(\"PROCESSING DEPENDENCIES FOR {}\".format(dep))\n     u = uuid.uuid1()\n     iter_reqs = parse_requirements(\"requirements/{}\".format(dep), session=u)\n-    [pip.main(['install', (str(ir.req))]) for ir in iter_reqs]\n+\n+    for ir in iter_reqs:\n+        check_call([sys.executable, '-m', 'pip', 'install', str(ir.req)])\n \n \n def custom_command_driver(driver):\n", "issue": "[2.0] \"pip3 install napalm\" doesn't install requirements\nDebian 9.2 (Stretch) with python3 v3.5.3, pip3 v9.0.1\r\n\r\nWith v1.2.0 a `pip3 install napalm==1.2.0` installs also the required modules (MarkupSafe, jinja2, netaddr, pyYAML, pyeapi, future, pynacl, bcrypt, paramiko, pyFG, scp, netmiko, lxml, pyIOSXR, ncclient, pyserial, junos-eznc, urllib3, idna, certifi, chardet, requests, pynxos, pan-python, requests-toolbelt, xmltodict, pyPluribus, chainmap, librouteros, vyattaconfparser).\r\n\r\nWith Napalm v2.0.0 no required module is installed with `pip3 install napalm`, so napalm won't work.\n", "before_files": [{"content": "\"\"\"setup.py file.\"\"\"\nimport uuid\nimport os\n\nfrom distutils.core import Command\nfrom setuptools import setup, find_packages\nfrom setuptools.command import install\n\n\nfrom pip.req import parse_requirements\n\nimport pip\nimport sys\n\n__author__ = 'David Barroso <dbarrosop@dravetech.com>'\n\n# Read SUPPORTED_DRIVERS from file (without importing)\n_locals = {}\nfilename = os.path.join('napalm', '_SUPPORTED_DRIVERS.py')\nwith open(filename) as supported:\n    exec(supported.read(), None, _locals)\n    SUPPORTED_DRIVERS = _locals['SUPPORTED_DRIVERS']\n\n\ndef process_requirements(dep):\n    print(\"PROCESSING DEPENDENCIES FOR {}\".format(dep))\n    u = uuid.uuid1()\n    iter_reqs = parse_requirements(\"requirements/{}\".format(dep), session=u)\n    [pip.main(['install', (str(ir.req))]) for ir in iter_reqs]\n\n\ndef custom_command_driver(driver):\n    class CustomCommand(Command):\n        \"\"\"A custom command to run Pylint on all Python source files.\"\"\"\n        user_options = []\n\n        def initialize_options(self):\n            pass\n\n        def finalize_options(self):\n            pass\n\n        def run(self):\n            \"\"\"Run command.\"\"\"\n            process_requirements(driver)\n\n    return CustomCommand\n\n\nclass CustomInstall(install.install):\n    \"\"\"A custom command to run Pylint on all Python source files.\"\"\"\n\n    def run(self):\n        \"\"\"Run command.\"\"\"\n        if any([d in sys.argv for d in SUPPORTED_DRIVERS]):\n            process_requirements('base')\n        else:\n            process_requirements('all')\n        install.install.run(self)\n\n\ncustom_commands = {d: custom_command_driver(d) for d in SUPPORTED_DRIVERS}\ncustom_commands['install'] = CustomInstall\n\nsetup(\n    cmdclass=custom_commands,\n    name=\"napalm\",\n    version='2.0.0',\n    packages=find_packages(exclude=(\"test*\", )),\n    test_suite='test_base',\n    author=\"David Barroso, Kirk Byers, Mircea Ulinic\",\n    author_email=\"dbarrosop@dravetech.com, ping@mirceaulinic.net, ktbyers@twb-tech.com\",\n    description=\"Network Automation and Programmability Abstraction Layer with Multivendor support\",\n    classifiers=[\n        'Topic :: Utilities',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Operating System :: POSIX :: Linux',\n        'Operating System :: MacOS',\n    ],\n    url=\"https://github.com/napalm-automation/napalm\",\n    include_package_data=True,\n    install_requires=[],\n    entry_points={\n        'console_scripts': [\n            'cl_napalm_configure=napalm.base.clitools.cl_napalm_configure:main',\n            'cl_napalm_test=napalm.base.clitools.cl_napalm_test:main',\n            'cl_napalm_validate=napalm.base.clitools.cl_napalm_validate:main',\n            'napalm=napalm.base.clitools.cl_napalm:main',\n        ],\n    }\n)\n", "path": "setup.py"}], "after_files": [{"content": "\"\"\"setup.py file.\"\"\"\nimport uuid\nimport os\n\nfrom distutils.core import Command\nfrom setuptools import setup, find_packages\nfrom setuptools.command import install\nfrom subprocess import check_call\n\n\nfrom pip.req import parse_requirements\n\nimport pip  # noqa: test pip is installed\nimport sys\n\n__author__ = 'David Barroso <dbarrosop@dravetech.com>'\n\n# Read SUPPORTED_DRIVERS from file (without importing)\n_locals = {}\nfilename = os.path.join('napalm', '_SUPPORTED_DRIVERS.py')\nwith open(filename) as supported:\n    exec(supported.read(), None, _locals)\n    SUPPORTED_DRIVERS = _locals['SUPPORTED_DRIVERS']\n\n\ndef process_requirements(dep):\n    print(\"PROCESSING DEPENDENCIES FOR {}\".format(dep))\n    u = uuid.uuid1()\n    iter_reqs = parse_requirements(\"requirements/{}\".format(dep), session=u)\n\n    for ir in iter_reqs:\n        check_call([sys.executable, '-m', 'pip', 'install', str(ir.req)])\n\n\ndef custom_command_driver(driver):\n    class CustomCommand(Command):\n        \"\"\"A custom command to run Pylint on all Python source files.\"\"\"\n        user_options = []\n\n        def initialize_options(self):\n            pass\n\n        def finalize_options(self):\n            pass\n\n        def run(self):\n            \"\"\"Run command.\"\"\"\n            process_requirements(driver)\n\n    return CustomCommand\n\n\nclass CustomInstall(install.install):\n    \"\"\"A custom command to run Pylint on all Python source files.\"\"\"\n\n    def run(self):\n        \"\"\"Run command.\"\"\"\n        if any([d in sys.argv for d in SUPPORTED_DRIVERS]):\n            process_requirements('base')\n        else:\n            process_requirements('all')\n        install.install.run(self)\n\n\ncustom_commands = {d: custom_command_driver(d) for d in SUPPORTED_DRIVERS}\ncustom_commands['install'] = CustomInstall\n\nsetup(\n    cmdclass=custom_commands,\n    name=\"napalm\",\n    version='2.0.0',\n    packages=find_packages(exclude=(\"test*\", )),\n    test_suite='test_base',\n    author=\"David Barroso, Kirk Byers, Mircea Ulinic\",\n    author_email=\"dbarrosop@dravetech.com, ping@mirceaulinic.net, ktbyers@twb-tech.com\",\n    description=\"Network Automation and Programmability Abstraction Layer with Multivendor support\",\n    classifiers=[\n        'Topic :: Utilities',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Operating System :: POSIX :: Linux',\n        'Operating System :: MacOS',\n    ],\n    url=\"https://github.com/napalm-automation/napalm\",\n    include_package_data=True,\n    install_requires=[],\n    entry_points={\n        'console_scripts': [\n            'cl_napalm_configure=napalm.base.clitools.cl_napalm_configure:main',\n            'cl_napalm_test=napalm.base.clitools.cl_napalm_test:main',\n            'cl_napalm_validate=napalm.base.clitools.cl_napalm_validate:main',\n            'napalm=napalm.base.clitools.cl_napalm:main',\n        ],\n    }\n)\n", "path": "setup.py"}]}