title: DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools-scm')
body: <p>Hello when trying to deploy a django application to elastic beanstalk this error shows up,</p>
  <pre><code>DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools-scm')
  </code></pre>
  <p>I have tried to add the library setuptools-scm in my requirements.txt file and even in my .ebextension directory, but still no luck any suggestions?</p>
  <p>EDIT, here's the a full log of the error:</p>
  <p><code>Application deployment failed at 2021-05-18T23:56:56Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. Collecting Django==1.11.16 Using cached Django-1.11.16-py2.py3-none-any.whl (7.0 MB) Collecting django-oscar==1.6.4 Using cached django_oscar-1.6.4-py2.py3-none-any.whl (7.5 MB) Collecting psycopg2==2.7.3.2 Using cached psycopg2-2.7.3.2-cp36-cp36m-manylinux1_x86_64.whl (2.7 MB) Collecting openpyxl==2.4.10 Using cached openpyxl-2.4.10.tar.gz (158 kB) Collecting django-storages==1.6.5 Using cached django_storages-1.6.5-py2.py3-none-any.whl (47 kB) Collecting boto3==1.5.19 Using cached boto3-1.5.19-py2.py3-none-any.whl (128 kB) Collecting django-ipware==2.0.1 Using cached django-ipware-2.0.1.tar.gz (10 kB) Collecting django-extensions&gt;=2.0.6 Using cached django_extensions-3.1.3-py3-none-any.whl (223 kB) Collecting pygeoip==0.3.2 Using cached pygeoip-0.3.2-py2.py3-none-any.whl (20 kB) Collecting selenium==3.14.1 Using cached selenium-3.14.1-py2.py3-none-any.whl (902 kB) Collecting pycountry==18.5.26 Using cached pycountry-18.5.26-py2.py3-none-any.whl (10.3 MB) Collecting pysolr==3.8.1 Using cached pysolr-3.8.1-py2.py3-none-any.whl (16 kB) Collecting django-filter==0.13.0 Using cached django_filter-0.13.0-py2.py3-none-any.whl (27 kB) Collecting djangorestframework==3.3.3 Using cached djangorestframework-3.3.3-py2.py3-none-any.whl (662 kB) Collecting Pillow==5.3.0 Using cached Pillow-5.3.0-cp36-cp36m-manylinux1_x86_64.whl (2.0 MB) Collecting django-settings-export==1.2.1 Using cached django-settings-export-1.2.1.tar.gz (5.0 kB) Collecting django-background-tasks==1.2.0 Using cached django-background-tasks-1.2.0.tar.gz (19 kB) Collecting ip2geotools==0.1.5 Using cached ip2geotools-0.1.5-py3-none-any.whl (16 kB) Collecting watchtower==0.7.3 Using cached watchtower-0.7.3-py2.py3-none-any.whl (13 kB) Collecting pytz Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB) Collecting sorl-thumbnail&lt;12.5,&gt;=12.4.1 Using cached sorl_thumbnail-12.4.1-py2.py3-none-any.whl (44 kB) Collecting django-widget-tweaks&gt;=1.4.1 Using cached django_widget_tweaks-1.4.8-py2.py3-none-any.whl (11 kB) Collecting django-treebeard&gt;=4.3.0 Using cached django_treebeard-4.5.1-py3-none-any.whl (103 kB) Collecting django-extra-views&lt;0.12,&gt;=0.11 Using cached django-extra-views-0.11.0.tar.gz (13 kB) Collecting Unidecode&lt;1.1,&gt;=1.0 Using cached Unidecode-1.0.23-py2.py3-none-any.whl (237 kB) Collecting Babel&lt;3.0,&gt;=1.0 Using cached Babel-2.9.1-py2.py3-none-any.whl (8.8 MB) Collecting factory-boy&lt;3.0,&gt;=2.4.1 Using cached factory_boy-2.12.0-py2.py3-none-any.whl (36 kB) Collecting mock&lt;3.0,&gt;=1.0.1 Using cached mock-2.0.0-py2.py3-none-any.whl (56 kB) Collecting phonenumbers Using cached phonenumbers-8.12.23-py2.py3-none-any.whl (2.6 MB) Collecting django-haystack&lt;3.0.0,&gt;=2.5.0 Using cached django-haystack-2.8.1.tar.gz (1.6 MB) ERROR: Command errored out with exit status 1: command: /opt/python/run/venv/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/tmp/pip-install-ji9vxolp/django-haystack_504d7caab43d489ebad3acd0546161a6/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/tmp/pip-install-ji9vxolp/django-haystack_504d7caab43d489ebad3acd0546161a6/setup.py'&quot;'&quot;';f = getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__) if os.path.exists(__file__) else io.StringIO('&quot;'&quot;'from setuptools import setup; setup()'&quot;'&quot;');code = f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' egg_info --egg-base /tmp/pip-pip-egg-info-2lhqu4p5 cwd: /tmp/pip-install-ji9vxolp/django-haystack_504d7caab43d489ebad3acd0546161a6/ Complete output (23 lines): Couldn't find index page for 'setuptools_scm' (maybe misspelled?) No local packages or working download links found for setuptools_scm Traceback (most recent call last): File &quot;&quot;, line 1, in File &quot;/tmp/pip-install-ji9vxolp/django-haystack_504d7caab43d489ebad3acd0546161a6/setup.py&quot;, line 71, in setup_requires=['setuptools_scm'], File &quot;/usr/lib64/python3.6/distutils/core.py&quot;, line 108, in setup _setup_distribution = dist = klass(attrs) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/dist.py&quot;, line 315, in __init__ self.fetch_build_eggs(attrs['setup_requires']) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/dist.py&quot;, line 361, in fetch_build_eggs replace_conflicting=True, File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/pkg_resources/__init__.py&quot;, line 850, in resolve dist = best[req.key] = env.best_match(req, ws, installer) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/pkg_resources/__init__.py&quot;, line 1122, in best_match return self.obtain(req, installer) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/pkg_resources/__init__.py&quot;, line 1134, in obtain return installer(requirement) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/dist.py&quot;, line 429, in fetch_build_egg return cmd.easy_install(req) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/command/easy_install.py&quot;, line 659, in easy_install raise DistutilsError(msg) distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools_scm') ---------------------------------------- WARNING: Discarding https://files.pythonhosted.org/packages/69/43/3e247b7b2134b48e9a53fb387e191e5e05b5f38f2faf78ca892097c2b441/django-haystack-2.8.1.tar.gz#sha256=8b54bcc926596765d0a3383d693bcdd76109c7abb6b2323b3984a39e3576028c (from https://pypi.org/simple/django-haystack/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. Using cached django-haystack-2.8.0.tar.gz (425 kB) ERROR: Command errored out with exit status 1: command: /opt/python/run/venv/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/tmp/pip-install-ji9vxolp/django-haystack_b5f23b3fb1794ae0b1220ef21f1b8b09/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/tmp/pip-install-ji9vxolp/django-haystack_b5f23b3fb1794ae0b1220ef21f1b8b09/setup.py'&quot;'&quot;';f = getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__) if os.path.exists(__file__) else io.StringIO('&quot;'&quot;'from setuptools import setup; setup()'&quot;'&quot;');code = f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' egg_info --egg-base /tmp/pip-pip-egg-info-sd7n9ubs cwd: /tmp/pip-install-ji9vxolp/django-haystack_b5f23b3fb1794ae0b1220ef21f1b8b09/ Complete output (23 lines): Couldn't find index page for 'setuptools_scm' (maybe misspelled?) No local packages or working download links found for setuptools_scm Traceback (most recent call last): File &quot;&quot;, line 1, in File &quot;/tmp/pip-install-ji9vxolp/django-haystack_b5f23b3fb1794ae0b1220ef21f1b8b09/setup.py&quot;, line 71, in setup_requires=['setuptools_scm'], File &quot;/usr/lib64/python3.6/distutils/core.py&quot;, line 108, in setup _setup_distribution = dist = klass(attrs) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/dist.py&quot;, line 315, in __init__ self.fetch_build_eggs(attrs['setup_requires']) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/dist.py&quot;, line 361, in fetch_build_eggs replace_conflicting=True, File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/pkg_resources/__init__.py&quot;, line 850, in resolve dist = best[req.key] = env.best_match(req, ws, installer) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/pkg_resources/__init__.py&quot;, line 1122, in best_match return self.obtain(req, installer) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/pkg_resources/__init__.py&quot;, line 1134, in obtain return installer(requirement) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/dist.py&quot;, line 429, in fetch_build_egg return cmd.easy_install(req) File &quot;/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/command/easy_install.py&quot;, line 659, in easy_install raise DistutilsError(msg) distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools_scm') ---------------------------------------- WARNING: Discarding https://files.pythonhosted.org/packages/5e/33/f7978374d447abd2803a2ea8128ff7296c89da42b0e9621ca9dd3495d2fc/django-haystack-2.8.0.tar.gz#sha256=579cd2080f7ad508e909a46c027078e278aeebd133973c1c4efcf0dc57d85c10 (from https://pypi.org/simple/django-haystack/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. Using cached django-haystack-2.7.0.tar.gz (1.6 MB) ERROR: Command errored out with exit status 1: command: /opt/python/run/venv/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/tmp/pip-install-ji9vxolp/django-haystack_ef77b238789b4b61bc1f1b36fd1ccc05/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/tmp/pip-install-ji9vxolp/django-haystack_ef77b238789b4b61bc1f1b36fd1ccc05/setup.py'&quot;'&quot;';f = getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__) if os.path.exists(__file__) else io.StringIO('&quot;'&quot;'from setuptools import setup; setup()'&quot;'&quot;');code = f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' egg_info --egg-base /tmp/pip-pip-egg-info-ls_ug5_i cwd: /tmp/pip-install-ji9vxolp/django-haystack_ef77b238789b4b61bc1f1b36fd1ccc05/ Complete output (23 lines): Couldn't find index page for 'setuptools_scm' (maybe misspelled?) No local packages or working download links found for setuptools_scm Traceback (most recent call last): File &quot;&quot;, line 1, in Command output has been truncated. Please see logs for more details.</code></p>
  <p><strong>UPDATE:</strong> The problem was in the configuration of and set-up of my elastic beanstalk enviroment, also I was using some deprecated libraries that needed to be upgraded (Django-Oscar)</p>