Make memory_profiler an optional dependency
To avoid having binary dependencies in the code in general (as discovered in #1481), we should move `memory_profiler` to be an optional dependency in the same way as done in #1462. This is a bit urgent as the issue is blocking our unit tests unless some other hack is made.
diff --git a/ganga/GangaCore/Utility/Profiling.py b/ganga/GangaCore/Utility/Profiling.py
index d87ff757a..0b18a7cd9 100644
--- a/ganga/GangaCore/Utility/Profiling.py
+++ b/ganga/GangaCore/Utility/Profiling.py
@@ -1,7 +1,6 @@
 from GangaCore.Utility.Config import getConfig
 
 import os
-from memory_profiler import profile
 import cProfile
 import time
 import json
@@ -12,6 +11,9 @@ timestr = time.strftime("-%Y%m%d-%H%M%S")
 # Obtaining the config from .gangarc file
 c = getConfig('Configuration')
 
+if c['Profile_Memory']:
+    from memory_profiler import profile
+    
 path = os.path.join(c['gangadir'], 'logs')
 
 
diff --git a/requirements.txt b/requirements.txt
index 125f99da7..c8299b631 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -7,5 +7,4 @@ pytest-mock
 unittest2
 coverage
 pygments
-mock
-memory_profiler
\ No newline at end of file
+mock
\ No newline at end of file
diff --git a/setup.py b/setup.py
index f932e36d9..b776b63a6 100644
--- a/setup.py
+++ b/setup.py
@@ -90,6 +90,7 @@ setup(name='ganga',
           'absl-py>=0.1.2',
           'google-api-python-client>=1.1',
       ],
+      extra_require={'profiler' : ['memory_profiler']},
       classifiers=[
           'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
           'Programming Language :: Python :: 2.7',
['setup.py', 'ganga/GangaCore/Utility/Profiling.py', 'requirements.txt']