fides icon indicating copy to clipboard operation
fides copied to clipboard

Cannot pip install fidesctl with Python 3.8

Open allisonking opened this issue 2 years ago • 5 comments

Bug Description

Trying to pip install fidesctl on Python 3.8 fails while collecting pycares

Error log
Collecting pycares>=4.0.0
  Using cached pycares-4.2.1.tar.gz (824 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      WARNING: The wheel package is not available.
        error: subprocess-exited-with-error
      
        × python setup.py bdist_wheel did not run successfully.
        │ exit code: 1
        ╰─> [6 lines of output]
            usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
               or: setup.py --help [cmd1 cmd2 ...]
               or: setup.py --help-commands
               or: setup.py cmd --help
      
            error: invalid command 'bdist_wheel'
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for cffi
      ERROR: Failed to build one or more wheels
      Traceback (most recent call last):
        File "/Users/aking/workspace/ethyca/fidesctl-plus/venv/lib/python3.8/site-packages/setuptools/installer.py", line 75, in fetch_build_egg
          subprocess.check_call(cmd)
        File "/Users/aking/.pyenv/versions/3.8.13/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/Users/aking/workspace/ethyca/fidesctl-plus/venv/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/kn/79tsdcw55n1b7bq0fqp64nc80000gp/T/tmpnjaoi7bt', '--quiet', 'cffi>=1.5.0']' returned non-zero exit status 1.
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/kn/79tsdcw55n1b7bq0fqp64nc80000gp/T/pip-install-cee51goj/pycares_d24934386f5a4b74994d2702816ed9af/setup.py", line 16, in <module>
          setup(name             = 'pycares',
        File "/Users/aking/workspace/ethyca/fidesctl-plus/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 152, in setup
          _install_setup_requires(attrs)
        File "/Users/aking/workspace/ethyca/fidesctl-plus/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 147, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Users/aking/workspace/ethyca/fidesctl-plus/venv/lib/python3.8/site-packages/setuptools/dist.py", line 721, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Users/aking/workspace/ethyca/fidesctl-plus/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 766, in resolve
          dist = best[req.key] = env.best_match(
        File "/Users/aking/workspace/ethyca/fidesctl-plus/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1051, in best_match
          return self.obtain(req, installer)
        File "/Users/aking/workspace/ethyca/fidesctl-plus/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1063, in obtain
          return installer(requirement)
        File "/Users/aking/workspace/ethyca/fidesctl-plus/venv/lib/python3.8/site-packages/setuptools/dist.py", line 780, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Users/aking/workspace/ethyca/fidesctl-plus/venv/lib/python3.8/site-packages/setuptools/installer.py", line 77, in fetch_build_egg
          raise DistutilsError(str(e)) from e
      distutils.errors.DistutilsError: Command '['/Users/aking/workspace/ethyca/fidesctl-plus/venv/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/kn/79tsdcw55n1b7bq0fqp64nc80000gp/T/tmpnjaoi7bt', '--quiet', 'cffi>=1.5.0']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Steps to Reproduce

  1. Use Python 3.8.13
  2. pip install fidesctl

Expected behavior

Should be able to install

Environment

  • Version: fidesctl 1.7.0
  • OS: M1 mac Monterey
  • Python Version: 3.8.13, but works with 3.9.11
  • Pip Version: 22.0.4
  • Docker Version: N/A

allisonking avatar Jul 20 '22 19:07 allisonking

@allisonking I think this is an M1 issue, as I'm also using 3.8.13 on windows and its fine. What I'm assuming is happening here is that there isn't a wheel built for pycares for M1 yet

ThomasLaPiana avatar Jul 20 '22 20:07 ThomasLaPiana

yeah, @sanders41 figured out that the problem is I needed to pip install wheel first to get this to work 🤔

allisonking avatar Jul 22 '22 20:07 allisonking

is that worth documenting or can we close the issue? not sure if this would be a common issue for users or a relatively rare occurrence

ThomasLaPiana avatar Jul 23 '22 08:07 ThomasLaPiana

@ThomasLaPiana i think your initial thought is correct. She needed wheel so pip could build a package that didn’t already have a version built for M1. What is weird is I could pip on my M1 without installing wheel first. I figure this has to mean I have a build tool installed that she doesn’t have, but we couldn’t figure out where our setup was different.

Since the issue is specific to M1 Macs running Python < 3.9 I think it will be a rare occurrence.

sanders41 avatar Jul 23 '22 11:07 sanders41

interesting, good to know!

ThomasLaPiana avatar Jul 23 '22 12:07 ThomasLaPiana