0

I am trying to set a connection with Visual Studio Code with Databricks using pyenv following these instructions: https://docs.databricks.com/dev-tools/ide-how-to.html

When I try to install dbx (pip install dbx) I have an error on the cffi package. I am using Python 3.8.9 and pip 23.00.

The blocks of errors I get are:

Building wheels for collected packages: cffi
  Building wheel for cffi (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.

      c/_cffi_backend.c:2:10: fatal error: 'Python.h' file not found
      #include <Python.h>
               ^~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cffi
  Running setup.py clean for cffi
Failed to build cffi
Installing collected packages: cffi, binaryornot, aiosignal, gitpython, databricks-cli, cryptography, arrow, aiohttp, mlflow-skinny, jinja2-time, cookiecutter, dbx
  Running setup.py install for cffi ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for cffi did not run successfully.
  │ exit code: 1

 ...


  c/_cffi_backend.c:2:10: fatal error: 'Python.h' file not found
  #include <Python.h>
           ^~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1
  [end of output]   

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> cffi

In case it helps, the machine-software specifications are (sw_vers output):

ProductName:    macOS
ProductVersion: 12.3
BuildVersion:   21E230

I am not a developer and I do not have much control about these things but I have read that it may be related to gcc. Here is the output of gcc --version:

Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

On the other hand, it is clear that cffi is not installed since pip show cffi:

WARNING: Package(s) not found: cffi
Nankin
  • 45
  • 7
  • You need to install `python-dev` or however the package is called in your distribution. You won't be able to compile anything Python-related without it. – Armin Rigo Feb 04 '23 at 02:19
  • @ArminRigo this is xcode in my case which I have already installed. `(dbx_demo) josepferre@joseps-macbook-pro dbx_demo % xcode-select --install xcode-select: error: command line tools are already installed, use "Software Update" to install updates`. I tried to run `xcode-select --reset` from the environment and it still did not help. I have dbx installed outside the environment but not inside the _(dbx_demo)_ environment. – Nankin Feb 09 '23 at 13:39
  • I'd say it is related with the fact that I have xcode-select installed for the GENERAL python version installed but not for the isolated python environment. The solution should be to find a way to install the specific version of xcode (python-dev) for the current environment? – Nankin Feb 09 '23 at 15:28
  • Sorry, can't help you with OSX issues... But try to use Google, your problem is 'how do I install any Python packages on OSX'. – Armin Rigo Feb 10 '23 at 14:06
  • @ArminRigo sorry If I did not explain myself properly. The point is: I can install it in the default shell environment since I have python-dev (xcode) installed there. However, when I try to install it in a python environment it does not read it or reference the path for it to use the python-dev tools. – Nankin Feb 13 '23 at 14:29

0 Answers0