saleor: Not able to deploy in Heroku

Getting this error when trying to deploy Saleor using “Deploy to Heroku” button in “https://github.com/mirumee/saleor/”. Had the same problem in my own machine(kali linux), which got resolved when I removed appdirs manually beforehand using pip.

Installing collected packages: appdirs, pytz, babel, babeldjango, docutils, python-dateutil, jmespath, botocore, s3transfer, boto3, requests, braintree, pycparser, cffi, idna, pyasn1, cryptography, cssselect, cssutils, dj-database-url, dj-email-url, django, django-absolute, django-bootstrap3, django-cache-url, django-countries, lxml, premailer, django-emailit, django-materializecss-form, django-mptt, pyjwt, stripe, suds-jurko, xmltodict, django-payments, prices, django-prices, django-prices-openexchangerates, redis, django-redis, django-storages, pillow, django-versatileimagefield, django-webpack-loader, djangorestframework, urllib3, elasticsearch, faker, google-i18n-address, google-measurement-protocol, typing, promise, graphql-core, graphql-relay, graphene, iso8601, singledispatch, graphene-django, jsonfield, markdown, maxminddb, maxminddb-geolite2, pbr, mock, oauthlib, psycopg2, purl, py, pyparsing, pytest, pytest-django, requests-oauthlib, satchless, defusedxml, python3-openid, social-auth-core, social-auth-app-django, text-unidecode, uwsgi
         Found existing installation: appdirs 1.4.3
           Uninstalling appdirs-1.4.3:
             Successfully uninstalled appdirs-1.4.3
         Rolling back uninstall of appdirs
       Exception:
       Traceback (most recent call last):
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2813, in _dep_map
           return self.__dep_map
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2624, in __getattr__
           raise AttributeError(attr)
       AttributeError: _DistInfoDistribution__dep_map
       
       During handling of the above exception, another exception occurred:
       
       Traceback (most recent call last):
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2804, in _parsed_pkg_info
           return self._pkg_info
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2624, in __getattr__
           raise AttributeError(attr)
       AttributeError: _pkg_info
       
       During handling of the above exception, another exception occurred:
       
       Traceback (most recent call last):
         File "/app/.heroku/python/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
           status = self.run(options, args)
         File "/app/.heroku/python/lib/python3.5/site-packages/pip/commands/install.py", line 342, in run
           prefix=options.prefix_path,
         File "/app/.heroku/python/lib/python3.5/site-packages/pip/req/req_set.py", line 784, in install
           **kwargs
         File "/app/.heroku/python/lib/python3.5/site-packages/pip/req/req_install.py", line 851, in install
           self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
         File "/app/.heroku/python/lib/python3.5/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
           isolated=self.isolated,
         File "/app/.heroku/python/lib/python3.5/site-packages/pip/wheel.py", line 247, in move_wheel_files
           prefix=prefix,
         File "/app/.heroku/python/lib/python3.5/site-packages/pip/locations.py", line 140, in distutils_scheme
           d = Distribution(dist_args)
         File "/app/.heroku/python/lib/python3.5/site-packages/setuptools/dist.py", line 320, in __init__
           _Distribution.__init__(self, attrs)
         File "/app/.heroku/python/lib/python3.5/distutils/dist.py", line 281, in __init__
           self.finalize_options()
         File "/app/.heroku/python/lib/python3.5/site-packages/setuptools/dist.py", line 386, in finalize_options
           ep.require(installer=self.fetch_build_egg)
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2324, in require
           items = working_set.resolve(reqs, env, installer, extras=self.extras)
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 862, in resolve
           new_requirements = dist.requires(req.extras)[::-1]
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2568, in requires
           dm = self._dep_map
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2815, in _dep_map
           self.__dep_map = self._compute_dependencies()
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2824, in _compute_dependencies
           for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2806, in _parsed_pkg_info
           metadata = self.get_metadata(self.PKG_INFO)
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1468, in get_metadata
           value = self._get(self._fn(self.egg_info, name))
         File "/app/.heroku/python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1577, in _get
           with open(path, 'rb') as stream:
       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/build_e48812842771c8b173aaffba76c2598e/mirumee-saleor-79f5f26/.heroku/python/lib/python3.5/site-packages/appdirs-1.4.3.dist-info/METADATA'
 !     Push rejected, failed to compile Python app.
 !     Push failed

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 16 (4 by maintainers)

Most upvoted comments

Ah good catch, thanks @patrys. I managed to deploy to heroku with following steps:

  • buildpacks: https://github.com/heroku/heroku-buildpack-nodejs.git and https://github.com/heroku/heroku-buildpack-nodejs.git
  • NPM_CONFIG_PRODUCTION=true - otherwise npm part doesn’t build
  • pinning appdirs==1.4.3

What I don’t understand (I’m new to django and heroku) is how to build when I’ll want to do a prod release as setting npm_config_production to false fails the build.