Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"'int' object has no attribute 'split'" when pip installing zstandard on Big Sur #66096

Closed
4 tasks done
mitchhentges opened this issue Dec 2, 2020 · 8 comments
Closed
4 tasks done
Labels
outdated PR was locked due to age

Comments

@mitchhentges
Copy link
Contributor

mitchhentges commented Dec 2, 2020

Bug report

  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
    (Kept saying "Error: Not Found" when I ran brew gist-logs 'python@3.9' or just brew gist-logs python)
  • if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?
mhentges@mhentges-64lvdr ~ % brew config
HOMEBREW_VERSION: 2.6.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 1d5e354cc2ff048bd7161d95b3fa7f91dc9dd081
Last commit: 34 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 1b08fa6df20bc4361f41f4a833c5117b34f1def6
Core tap last commit: 64 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 16
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 16-core 64-bit kabylake
Clang: 12.0 build 1200
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.0.1-x86_64
CLT: 12.2.0.0.1.1604076827
Xcode: 12.2
mhentges@mhentges-64lvdr ~ % brew doctor
Your system is ready to brew.

Python version:

mhentges@mhentges-64lvdr ~ % brew info 'python@3.9'
python@3.9: stable 3.9.0 (bottled)
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python@3.9/3.9.0_3 (4,454 files, 72.2MB) *
  Poured from bottle on 2020-12-02 at 17:03:36
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/python@3.9.rb
License: Python-2.0
==> Dependencies
Build: pkg-config ✘
Required: gdbm ✔, openssl@1.1 ✔, readline ✔, sqlite ✔, xz ✔
==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python@3.9/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.9/site-packages

See: https://docs.brew.sh/Homebrew-and-Python
==> Analytics
install: 696,307 (30 days), 1,113,447 (90 days), 1,113,447 (365 days)
install-on-request: 198,001 (30 days), 231,869 (90 days), 231,871 (365 days)
build-error: 0 (30 days)

What you were trying to do (and why)

I did pip3 install --user zstandard, because I like zstandard.

What happened (include command output)

Command output
Collecting zstandard
  Using cached zstandard-0.14.0.tar.gz (676 kB)
Building wheels for collected packages: zstandard
  Building wheel for zstandard (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-install-e6kqd258/zstandard_1546aec4733a47ba810f7c6d608d1506/setup.py'"'"'; __file__='"'"'/private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-install-e6kqd258/zstandard_1546aec4733a47ba810f7c6d608d1506/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-wheel-sa_bjd2i
       cwd: /private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-install-e6kqd258/zstandard_1546aec4733a47ba810f7c6d608d1506/
  Complete output (63 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-11-x86_64-3.9
  creating build/lib.macosx-11-x86_64-3.9/zstandard
  copying zstandard/cffi.py -> build/lib.macosx-11-x86_64-3.9/zstandard
  copying zstandard/__init__.py -> build/lib.macosx-11-x86_64-3.9/zstandard
  running build_ext
  building 'zstd' extension
  creating build/temp.macosx-11-x86_64-3.9
  creating build/temp.macosx-11-x86_64-3.9/c-ext
  creating build/temp.macosx-11-x86_64-3.9/zstd
  creating build/temp.macosx-11-x86_64-3.9/zstd/common
  creating build/temp.macosx-11-x86_64-3.9/zstd/compress
  creating build/temp.macosx-11-x86_64-3.9/zstd/decompress
  creating build/temp.macosx-11-x86_64-3.9/zstd/dictBuilder
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Izstd/dictBuilder -Izstd/common -Izstd/decompress -Izstd/compress -Izstd -Ic-ext -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c c-ext/bufferutil.c -o build/temp.macosx-11-x86_64-3.9/c-ext/bufferutil.o -DZSTD_MULTITHREAD -DZSTDLIB_VISIBILITY= -DZDICTLIB_VISIBILITY= -DZSTDERRORLIB_VISIBILITY= -fvisibility=hidden
  Traceback (most recent call last):
    File "", line 1, in 
    File "/private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-install-e6kqd258/zstandard_1546aec4733a47ba810f7c6d608d1506/setup.py", line 94, in 
      setup(
    File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 290, in run
      self.run_command('build')
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 79, in run
      _build_ext.run(self)
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
      self._build_extensions_serial()
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
      self.build_extension(ext)
    File "/usr/local/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
      _build_ext.build_extension(self, ext)
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 529, in build_extension
      objects = self.compiler.compile(sources,
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/ccompiler.py", line 574, in compile
      self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/unixccompiler.py", line 117, in _compile
      self.spawn(compiler_so + cc_args + [src, '-o', obj] +
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/ccompiler.py", line 910, in spawn
      spawn(cmd, dry_run=self.dry_run)
    File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/spawn.py", line 66, in spawn
      if _cfg_target_split > [int(x) for x in cur_target.split('.')]:
  AttributeError: 'int' object has no attribute 'split'
  ----------------------------------------
  ERROR: Failed building wheel for zstandard
  Running setup.py clean for zstandard
Failed to build zstandard
Installing collected packages: zstandard
    Running setup.py install for zstandard ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-install-e6kqd258/zstandard_1546aec4733a47ba810f7c6d608d1506/setup.py'"'"'; __file__='"'"'/private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-install-e6kqd258/zstandard_1546aec4733a47ba810f7c6d608d1506/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-record-8ahv8gdm/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/mhentges/Library/Python/3.9/include/python3.9/zstandard
         cwd: /private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-install-e6kqd258/zstandard_1546aec4733a47ba810f7c6d608d1506/
    Complete output (65 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-11-x86_64-3.9
    creating build/lib.macosx-11-x86_64-3.9/zstandard
    copying zstandard/cffi.py -> build/lib.macosx-11-x86_64-3.9/zstandard
    copying zstandard/__init__.py -> build/lib.macosx-11-x86_64-3.9/zstandard
    running build_ext
    building 'zstd' extension
    creating build/temp.macosx-11-x86_64-3.9
    creating build/temp.macosx-11-x86_64-3.9/c-ext
    creating build/temp.macosx-11-x86_64-3.9/zstd
    creating build/temp.macosx-11-x86_64-3.9/zstd/common
    creating build/temp.macosx-11-x86_64-3.9/zstd/compress
    creating build/temp.macosx-11-x86_64-3.9/zstd/decompress
    creating build/temp.macosx-11-x86_64-3.9/zstd/dictBuilder
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Izstd -Izstd/common -Izstd/decompress -Ic-ext -Izstd/dictBuilder -Izstd/compress -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c c-ext/bufferutil.c -o build/temp.macosx-11-x86_64-3.9/c-ext/bufferutil.o -DZSTD_MULTITHREAD -DZSTDLIB_VISIBILITY= -DZDICTLIB_VISIBILITY= -DZSTDERRORLIB_VISIBILITY= -fvisibility=hidden
    Traceback (most recent call last):
      File "", line 1, in 
      File "/private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-install-e6kqd258/zstandard_1546aec4733a47ba810f7c6d608d1506/setup.py", line 94, in 
        setup(
      File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.9/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/install.py", line 546, in run
        self.run_command('build')
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 79, in run
        _build_ext.run(self)
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
        self._build_extensions_serial()
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
        self.build_extension(ext)
      File "/usr/local/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
        _build_ext.build_extension(self, ext)
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 529, in build_extension
        objects = self.compiler.compile(sources,
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/ccompiler.py", line 574, in compile
        self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/unixccompiler.py", line 117, in _compile
        self.spawn(compiler_so + cc_args + [src, '-o', obj] +
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/ccompiler.py", line 910, in spawn
        spawn(cmd, dry_run=self.dry_run)
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/spawn.py", line 66, in spawn
        if _cfg_target_split > [int(x) for x in cur_target.split('.')]:
    AttributeError: 'int' object has no attribute 'split'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-install-e6kqd258/zstandard_1546aec4733a47ba810f7c6d608d1506/setup.py'"'"'; __file__='"'"'/private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-install-e6kqd258/zstandard_1546aec4733a47ba810f7c6d608d1506/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/bl/f1zf29l94f570sc6ljd4j3rh0000gn/T/pip-record-8ahv8gdm/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/mhentges/Library/Python/3.9/include/python3.9/zstandard Check the logs for full command output.
  

What you expected to happen

I expected zstandard to be installed

Step-by-step reproduction instructions (by running brew install commands)

  1. brew install python
  2. pip3 install --user zstandard

Other notes

This is similar to this patch. I think that that issue got resolved with an early patch (cd26ccbb) to at least get Python installable again.
However, the patch for upstream python has a reviewer comment pointing out the bug I'm running into, and the patch has changed since (6511bf5).
I'm guessing that this ticket I'm reporting right now (so that other confused users will see what's going on) will be resolved when the python formula is updated again (either to an improved upstream, or to include a newer patch)

@fxcoudert
Copy link
Member

Updated patch is currently under testing: #66063

@fxcoudert
Copy link
Member

Fix is merged

@swghosh
Copy link

swghosh commented Dec 3, 2020

python@3.8 is also affected. While doing:

brew install python@3.8

Logs: https://gist.github.com/a2c9930155dc4162ea7788ec32d9e935

I think the #66063 patch was applied only on python@3.9.

@MikeLund
Copy link
Contributor

MikeLund commented Dec 6, 2020

I am experiencing the same issue as @swghosh regarding python@3.8. Should we open a new issue about it @fxcoudert ? (Sorry for the noise, I just can't find any relevant issues open about it right now, nice to know :))

@fxcoudert
Copy link
Member

Has the upstream patch been backported? If so, it should be applied to 3.8 as well.

@swghosh
Copy link

swghosh commented Dec 6, 2020

Has the upstream patch been backported? If so, it should be applied to 3.8 as well.

@fxcoudert
You mean the one from CPython repo, right? I don't think so. As downloading and building from Python3.8.tar.gz still fails.

@marcMWI

This comment has been minimized.

@fxcoudert
Copy link
Member

Backport to 3.8 in progress: #66594

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Jan 9, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Jan 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

6 participants