mulbc / homebrew-ceph-client

Homebrew tap for ceph client libraries
34 stars 25 forks source link

AttributeError: cython_sources monterey 12.6.7 m1 pro #31

Open pylixm opened 1 year ago

pylixm commented 1 year ago

My os info: monterey 12.6.7 m1 pro.

I got the error as below is there any solution.

==> python3 -c import setuptools... --no-user-cfg install --prefix=/opt/homebrew/Cellar/ceph-client/17.2.5_1/libexec/vendor --install-scripts=/opt/homebrew/Cellar/ceph-client/17.2.5_1/libexec/vendor/bin --install
Last 15 lines from /Users/yiche/Library/Logs/Homebrew/ceph-client/02.python3:
    self.distribution.run_command(command)
  File "/opt/homebrew/lib/python3.11/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "setup.py", line 190, in run
    _build_ext.run(self)
  File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
    self.build_extensions()
  File "setup.py", line 232, in build_extensions
    ext.sources = self.cython_sources(ext.sources, ext)
                  ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
    raise AttributeError(attr)
AttributeError: cython_sources
alexpeters1208 commented 1 year ago

I have exactly the same error as above, and have no idea what to do about it. I will update this thread if I find anything. I am running an M2 MacBook with Ventura 13.2.1.

gf0842wf commented 1 year ago

I had the same problem and it took me a few hours to fix it. The cause of this problem is that the installation of the library depends on cython3.0.0 version, and then cython3.0.0 version compilation bug caused.

  1. Uninstall cython, brew remove cython.
  2. Modify the ceph-client.rb file and delete the cython dependency. (This is brew implementation to install ceph-client library entry file, because can not change the official source file, so can only change own local cache file. Use "sudo find /|grep ceph-client.rb" to find the ceph-client.rb file location)
  3. Manually install a lower version of cython, pip3 install "cython<3.0.0"
  4. Re-install ceph-client, brew install ceph-client
subusc commented 1 year ago

@gf0842wf would you be able to list steps for removing the cython dependency?

I removed the depends line and the ENV line, but this causes issues with cmake.

 19   # depends_on "cython" => :build
...
 58     # ENV.prepend_create_path "PYTHONPATH", "#{Formula["cython"].opt_libexec}/lib/python#{xy}/site-packages"
gf0842wf commented 11 months ago

@gf0842wf @subusc would you be able to list steps for removing the cython dependency?

I removed the depends line and the ENV line, but this causes issues with cmake.

 19   # depends_on "cython" => :build
...
 58     # ENV.prepend_create_path "PYTHONPATH", "#{Formula["cython"].opt_libexec}/lib/python#{xy}/site-packages"

I only deleted one line. After you removed the line, did you install the lower version of cpython again?

class CephClient < Formula
  desc "Ceph client tools and libraries"
  homepage "https://ceph.com"
  url "https://download.ceph.com/tarballs/ceph-17.2.5.tar.gz"
  sha256 "362269c147913af874b2249a46846b0e6f82d2ceb50af46222b6ddec9991b29a"
  revision 1

  bottle do
    rebuild 1
    root_url "https://github.com/mulbc/homebrew-ceph-client/releases/download/quincy-17.2.5-1"
    sha256 cellar: :any, arm64_ventura: "b6e30275e0c5012874b73130fd0119b7f40f8180f1c6b54e3abb1f8bf8680ed5"
  end

  # depends_on "osxfuse"
  depends_on "boost@1.76"
  depends_on "openssl" => :build
  depends_on "cmake" => :build
  depends_on "ninja" => :build
  #depends_on "cython" => :build
  depends_on "leveldb" => :build
  depends_on "nss"
  depends_on "pkg-config" => :build
  depends_on "python@3.11"
  depends_on "sphinx-doc" => :build
  depends_on "yasm"
  def caveats
    <<-EOS.undent
      macFUSE must be installed prior to building this formula. macFUSE is also necessary
      if you plan to use the FUSE support of CephFS. You can either install macFUSE from
      https://osxfuse.github.io or use the following command:

      brew install --cask macfuse
    EOS
  end

  resource "prettytable" do
    url "https://files.pythonhosted.org/packages/cb/7d/7e6bc4bd4abc49e9f4f5c4773bb43d1615e4b476d108d1b527318b9c6521/prettytable-3.2.0.tar.gz"
    sha256 "ae7d96c64100543dc61662b40a28f3b03c0f94a503ed121c6fca2782c5816f81"
  end

  resource "PyYAML" do
    url "https://files.pythonhosted.org/packages/cd/e5/af35f7ea75cf72f2cd079c95ee16797de7cd71f29ea7c68ae5ce7be1eda0/PyYAML-6.0.1.tar.gz"
    sha256 "bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"
  end
...