We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Arbitrary equality in pip freeze causes crash
<!--
  Hi there! Thank you for discovering and submitting an issue.

  Before you submit this; let's make sure of a few things.
  Please make sure the following boxes are ticked if they are correct.
  If not, please try and fulfill these first.
-->

<!-- Checked checkbox should look like this: [x] -->
- [ x] I am on the [latest](https://github.com/sdispater/poetry/releases/latest) Poetry version.
- [x ] I have searched the [issues](https://github.com/sdispater/poetry/issues) of this repo and believe that this is not a duplicate.
- [x ] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option).

<!--
  Once those are done, if you're able to fill in the following list with your information,
  it'd be very helpful to whoever handles the issue.
-->

- **MacOS High Sierra 10.13.6**: <!-- Replace with version + name -->
- **Poetry 0.11.5**: <!-- Replace with version -->

## Issue
<!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤️ -->
Running `poetry install` when a package is installed such that pip freeze lists it with an arbitrary equality operator (ex. `package===1.6.1-642-g1e03d5e853`) causes an exception

```
[ValueError]
Unable to parse "=1.6.1-642-g1e03d5e853".
```

Looks like the issue is the strict splitting on `==` in `poetry/repositories/installed_repository.py`.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `poetry/repositories/installed_repository.py`
Content:
```
1 from poetry.packages import Package
2 from poetry.utils.env import Env
3 
4 from .repository import Repository
5 
6 
7 class InstalledRepository(Repository):
8     @classmethod
9     def load(cls, env):  # type: (Env) -> InstalledRepository
10         """
11         Load installed packages.
12 
13         For now, it uses the pip "freeze" command.
14         """
15         repo = cls()
16 
17         freeze_output = env.run("pip", "freeze")
18         for line in freeze_output.split("\n"):
19             if "==" in line:
20                 name, version = line.split("==")
21                 repo.add_package(Package(name, version, version))
22             elif line.startswith("-e "):
23                 line = line[3:].strip()
24                 if line.startswith("git+"):
25                     url = line.lstrip("git+")
26                     if "@" in url:
27                         url, rev = url.rsplit("@", 1)
28                     else:
29                         rev = "master"
30 
31                     name = url.split("/")[-1].rstrip(".git")
32                     if "#egg=" in rev:
33                         rev, name = rev.split("#egg=")
34 
35                     package = Package(name, "0.0.0")
36                     package.source_type = "git"
37                     package.source_url = url
38                     package.source_reference = rev
39 
40                     repo.add_package(package)
41 
42         return repo
43
```
--- 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/poetry/repositories/installed_repository.py b/poetry/repositories/installed_repository.py
--- a/poetry/repositories/installed_repository.py
+++ b/poetry/repositories/installed_repository.py
@@ -1,3 +1,5 @@
+import re
+
 from poetry.packages import Package
 from poetry.utils.env import Env
 
@@ -17,7 +19,7 @@
         freeze_output = env.run("pip", "freeze")
         for line in freeze_output.split("\n"):
             if "==" in line:
-                name, version = line.split("==")
+                name, version = re.split("={2,3}", line)
                 repo.add_package(Package(name, version, version))
             elif line.startswith("-e "):
                 line = line[3:].strip()

{"golden_diff": "diff --git a/poetry/repositories/installed_repository.py b/poetry/repositories/installed_repository.py\n--- a/poetry/repositories/installed_repository.py\n+++ b/poetry/repositories/installed_repository.py\n@@ -1,3 +1,5 @@\n+import re\n+\n from poetry.packages import Package\n from poetry.utils.env import Env\n \n@@ -17,7 +19,7 @@\n         freeze_output = env.run(\"pip\", \"freeze\")\n         for line in freeze_output.split(\"\\n\"):\n             if \"==\" in line:\n-                name, version = line.split(\"==\")\n+                name, version = re.split(\"={2,3}\", line)\n                 repo.add_package(Package(name, version, version))\n             elif line.startswith(\"-e \"):\n                 line = line[3:].strip()\n", "issue": "Arbitrary equality in pip freeze causes crash\n<!--\r\n  Hi there! Thank you for discovering and submitting an issue.\r\n\r\n  Before you submit this; let's make sure of a few things.\r\n  Please make sure the following boxes are ticked if they are correct.\r\n  If not, please try and fulfill these first.\r\n-->\r\n\r\n<!-- Checked checkbox should look like this: [x] -->\r\n- [ x] I am on the [latest](https://github.com/sdispater/poetry/releases/latest) Poetry version.\r\n- [x ] I have searched the [issues](https://github.com/sdispater/poetry/issues) of this repo and believe that this is not a duplicate.\r\n- [x ] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option).\r\n\r\n<!--\r\n  Once those are done, if you're able to fill in the following list with your information,\r\n  it'd be very helpful to whoever handles the issue.\r\n-->\r\n\r\n- **MacOS High Sierra 10.13.6**: <!-- Replace with version + name -->\r\n- **Poetry 0.11.5**: <!-- Replace with version -->\r\n\r\n## Issue\r\n<!-- Now feel free to write your issue, but please be descriptive! Thanks again \ud83d\ude4c \u2764\ufe0f -->\r\nRunning `poetry install` when a package is installed such that pip freeze lists it with an arbitrary equality operator (ex. `package===1.6.1-642-g1e03d5e853`) causes an exception\r\n\r\n```\r\n[ValueError]\r\nUnable to parse \"=1.6.1-642-g1e03d5e853\".\r\n```\r\n\r\nLooks like the issue is the strict splitting on `==` in `poetry/repositories/installed_repository.py`.\r\n\n", "before_files": [{"content": "from poetry.packages import Package\nfrom poetry.utils.env import Env\n\nfrom .repository import Repository\n\n\nclass InstalledRepository(Repository):\n    @classmethod\n    def load(cls, env):  # type: (Env) -> InstalledRepository\n        \"\"\"\n        Load installed packages.\n\n        For now, it uses the pip \"freeze\" command.\n        \"\"\"\n        repo = cls()\n\n        freeze_output = env.run(\"pip\", \"freeze\")\n        for line in freeze_output.split(\"\\n\"):\n            if \"==\" in line:\n                name, version = line.split(\"==\")\n                repo.add_package(Package(name, version, version))\n            elif line.startswith(\"-e \"):\n                line = line[3:].strip()\n                if line.startswith(\"git+\"):\n                    url = line.lstrip(\"git+\")\n                    if \"@\" in url:\n                        url, rev = url.rsplit(\"@\", 1)\n                    else:\n                        rev = \"master\"\n\n                    name = url.split(\"/\")[-1].rstrip(\".git\")\n                    if \"#egg=\" in rev:\n                        rev, name = rev.split(\"#egg=\")\n\n                    package = Package(name, \"0.0.0\")\n                    package.source_type = \"git\"\n                    package.source_url = url\n                    package.source_reference = rev\n\n                    repo.add_package(package)\n\n        return repo\n", "path": "poetry/repositories/installed_repository.py"}], "after_files": [{"content": "import re\n\nfrom poetry.packages import Package\nfrom poetry.utils.env import Env\n\nfrom .repository import Repository\n\n\nclass InstalledRepository(Repository):\n    @classmethod\n    def load(cls, env):  # type: (Env) -> InstalledRepository\n        \"\"\"\n        Load installed packages.\n\n        For now, it uses the pip \"freeze\" command.\n        \"\"\"\n        repo = cls()\n\n        freeze_output = env.run(\"pip\", \"freeze\")\n        for line in freeze_output.split(\"\\n\"):\n            if \"==\" in line:\n                name, version = re.split(\"={2,3}\", line)\n                repo.add_package(Package(name, version, version))\n            elif line.startswith(\"-e \"):\n                line = line[3:].strip()\n                if line.startswith(\"git+\"):\n                    url = line.lstrip(\"git+\")\n                    if \"@\" in url:\n                        url, rev = url.rsplit(\"@\", 1)\n                    else:\n                        rev = \"master\"\n\n                    name = url.split(\"/\")[-1].rstrip(\".git\")\n                    if \"#egg=\" in rev:\n                        rev, name = rev.split(\"#egg=\")\n\n                    package = Package(name, \"0.0.0\")\n                    package.source_type = \"git\"\n                    package.source_url = url\n                    package.source_reference = rev\n\n                    repo.add_package(package)\n\n        return repo\n", "path": "poetry/repositories/installed_repository.py"}]}