Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.94k stars 10.72k forks source link

Error on Casking VLC #84359

Closed cdr-chakotay closed 4 years ago

cdr-chakotay commented 4 years ago

Finally found out a workaround. See below

General troubleshooting steps

Description of issue

Getting this error when i try to cask the VLC Player, tried BlueJ for reference. That one worked, VLC does not. Hope you can help me out with that. Have this issue randomly appearing with random pakages. I know there have been already xattr bugs. I tried already some fixes. Would be happy if anybody knows how to solve that :) Thank you in advance!

Command that failed

brew cask install vlc

Output of command with --force --verbose --debug

==> Downloading https://get.videolan.org/vlc/3.0.10/macosx/vlc-3.0.10.dmg
==> Downloading from https://mirror.netcologne.de/videolan.org/vlc/3.0.10/macosx/vlc-3.0.10.dmg
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'vlc'.
==> Installing Cask vlc
hdiutil attach -plist -nobrowse -readonly -noidme -mountrandom /var/folders/v8/q7kk0kxn7cg8rwc66wyb5cz80000gn/T/d20200614-1188-drwc9k /Users/abc/Library/Caches/Homebrew/downloads/83d2bc6f6f5405c3154d0931b3e0b919a5572e160746c72dd8921f9fdc97f80b--vlc-3.0.10.dmg
mkbom -s -i /var/folders/v8/q7kk0kxn7cg8rwc66wyb5cz80000gn/T/20200614-1188-ocambs.list -- /var/folders/v8/q7kk0kxn7cg8rwc66wyb5cz80000gn/T/20200614-1188-10vpazx.bom
ditto --bom /var/folders/v8/q7kk0kxn7cg8rwc66wyb5cz80000gn/T/20200614-1188-10vpazx.bom -- /private/var/folders/v8/q7kk0kxn7cg8rwc66wyb5cz80000gn/T/d20200614-1188-drwc9k/dmg.m9TJB6 /var/folders/v8/q7kk0kxn7cg8rwc66wyb5cz80000gn/T/d20200614-1188-13470l6
diskutil eject /private/var/folders/v8/q7kk0kxn7cg8rwc66wyb5cz80000gn/T/d20200614-1188-drwc9k/dmg.m9TJB6
cp -pR /var/folders/v8/q7kk0kxn7cg8rwc66wyb5cz80000gn/T/d20200614-1188-13470l6/VLC.app/. /usr/local/Caskroom/vlc/3.0.10/VLC.app
cp -pR /var/folders/v8/q7kk0kxn7cg8rwc66wyb5cz80000gn/T/d20200614-1188-13470l6/.background.tiff /usr/local/Caskroom/vlc/3.0.10/.background.tiff
chmod -Rf +w /var/folders/v8/q7kk0kxn7cg8rwc66wyb5cz80000gn/T/d20200614-1188-13470l6
==> Moving App 'VLC.app' to '/Applications/VLC.app'.
==> Linking Binary 'vlc.wrapper.sh' to '/usr/local/bin/vlc'.
==> Backing App 'VLC.app' up to '/usr/local/Caskroom/vlc/3.0.10/VLC.app'.
==> Removing App '/Applications/VLC.app'.
==> Purging files for version 3.0.10 of Cask vlc
Error: Failure while executing; `/usr/bin/xattr -w com.apple.metadata:kMDItemAlternateNames \(\"vlc\"\) /usr/local/Caskroom/vlc/3.0.10/vlc.wrapper.sh` exited with 1. Here's the output:
Traceback (most recent call last):
  File "/usr/bin/xattr", line 8, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Homebrew/Library/Homebrew/system_command.rb:176:in `assert_success!'
/usr/local/Homebrew/Library/Homebrew/system_command.rb:53:in `run!'
/usr/local/Homebrew/Library/Homebrew/system_command.rb:29:in `run'
/usr/local/Homebrew/Library/Homebrew/system_command.rb:33:in `run!'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/relocated.rb:75:in `add_altname_metadata'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/symlinked.rb:67:in `create_filesystem_link'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/symlinked.rb:54:in `link'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/binary.rb:9:in `link'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/symlinked.rb:17:in `install_phase'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:218:in `block in install_artifacts'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:777:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:777:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:209:in `install_artifacts'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:101:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:22:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:16:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:16:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:36:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:150:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:92:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:9:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:110:in `<main>'

Output of brew cask doctor

==> Homebrew Version
2.4.0-41-g0125c4c
==> macOS
10.15.5
==> SIP
Enabled
==> Java
13.0.1, 11.0.7, 1.8.0_251
==> xattr issues
Traceback (most recent call last):
  File "/usr/bin/xattr", line 8, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
Error: wrong number of arguments (given 2, expected 1)

Output of brew tap

homebrew/cask
homebrew/core
ran-dall commented 4 years ago

@cdr-chakotay There seems to be an issue with your installation of Python. You can try to reinstall it with...

$ brew reinstall python3

Then maybe, if it's still not working for you...

$ pip3 install --upgrade pip setuptools wheel
cdr-chakotay commented 4 years ago

Sorry to say, but does not do the trick for me. I am still in the Error :(

Traceback (most recent call last):
  File "/usr/bin/xattr", line 8, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
cdr-chakotay commented 4 years ago

Yes Sir:

$echo $PATH
/usr/local/opt/python/libexec/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/MacGPG2/bin:/Library/Apple/usr/bin

and

$python --version         
Python 3.7.7

It's a little wired isn't it?

ran-dall commented 4 years ago

@cdr-chakotay What about $ which python and $ brew info python?

cdr-chakotay commented 4 years ago

@cdr-chakotay What about $ which python and $ brew info python?

I think were getting closer: which python replies "python not found"

And brew does this piece of output:

python: stable 3.7.7 (bottled), HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python/3.7.7 (4,007 files, 61.3MB) *
  Poured from bottle on 2020-06-14 at 18:24:00
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/python.rb
==> Dependencies
Build: pkg-config ✘
Required: gdbm ✔, openssl@1.1 ✔, readline ✔, sqlite ✔, xz ✔
==> Options
--HEAD
    Install HEAD version
==> 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/libexec/bin

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

See: https://docs.brew.sh/Homebrew-and-Python
==> Analytics
install: 184,609 (30 days), 904,076 (90 days), 5,189,932 (365 days)
install-on-request: 153,292 (30 days), 595,046 (90 days), 2,747,963 (365 days)
build-error: 0 (30 days)
ran-dall commented 4 years ago

@cdr-chakotay That is strange. Does it work if you remove the python path from your $PATH?

cdr-chakotay commented 4 years ago

Nah it does not. ... Sadly. I will try do get rid of python and reinstall XCode and Stuff which has Pyhton and will come back to you

ran-dall commented 4 years ago

@cdr-chakotay Tbh I feel like this is more a brew issue than it is a cask issue. I don't mind helping you but you might get better support if you open up an issue with them. Hence I'll be closing the issue here, but we can continue to communicate on this issue.

That said, IMPO I wouldn't use brew or any 'non-pinning' package manager to install python. FMU the main reason is that brew will overwrite your python on upgrading. Personally, I use asdf.

Anyways, to continue helping you, could you paste the output of brew doctor?

cdr-chakotay commented 4 years ago

Even the Python purge ist not a successfull option. Maybe it's a specific VLC problem ...

Regarding non pinning i do not clearly understand what your are trying to mell. Is it about new versions and resulting problems?

Thanks for your support so far!

cdr-chakotay commented 4 years ago

Regarding the brew doctor:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libtcl8.6.dylib
  /usr/local/lib/libtk8.6.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/fakemysql.h
  /usr/local/include/fakepq.h
  /usr/local/include/fakesql.h
  /usr/local/include/itcl.h
  /usr/local/include/itcl2TclOO.h
  /usr/local/include/itclDecls.h
  /usr/local/include/itclInt.h
  /usr/local/include/itclIntDecls.h
  /usr/local/include/itclMigrate2TclCore.h
  /usr/local/include/itclTclIntStubsFcn.h
  /usr/local/include/mysqlStubs.h
  /usr/local/include/odbcStubs.h
  /usr/local/include/pqStubs.h
  /usr/local/include/tcl.h
  /usr/local/include/tclDecls.h
  /usr/local/include/tclOO.h
  /usr/local/include/tclOODecls.h
  /usr/local/include/tclPlatDecls.h
  /usr/local/include/tclThread.h
  /usr/local/include/tclTomMath.h
  /usr/local/include/tclTomMathDecls.h
  /usr/local/include/tdbc.h
  /usr/local/include/tdbcDecls.h
  /usr/local/include/tdbcInt.h
  /usr/local/include/tk.h
  /usr/local/include/tkDecls.h
  /usr/local/include/tkPlatDecls.h

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
  /usr/local/lib/pkgconfig/tcl.pc
  /usr/local/lib/pkgconfig/tk.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/libtclstub8.6.a
  /usr/local/lib/libtkstub8.6.a
ran-dall commented 4 years ago

@cdr-chakotay Is there any way you installed python via an installer or some other route? The output of brew doctor would make one believe you installed python via some other method besides brew.

cdr-chakotay commented 4 years ago

Yes i did a time ago but also removed it. Turns out only partial removed it i guess? Do you know how to fix that? Can not find any residues anymore

ran-dall commented 4 years ago

@cdr-chakotay I don't install python manually like this so I don't have a 'for-sure' solution for you. Sorry.

cdr-chakotay commented 4 years ago

At least it doesn't launch when i type python3. Python launches 2. which is part of MacOS i guess. Maybe just install it with the installer over again. Well, never had those issues with Java JDK. Don't know whats happening there.

cdr-chakotay commented 4 years ago

Ah maybe this librarys are also caused by R which i am using. I think it install kind of parts of python.

miccal commented 4 years ago

@cdr-chakotay you stated that the command which python reported python not found, which will cause you a lot of problems because this implies that perhaps the system Python provided by macOS is not in your PATH.

What is the output of /usr/bin/python --version?

cdr-chakotay commented 4 years ago

/usr/bin/python --version It's:

/usr/bin/python --version
Python 2.7.16
cdr-chakotay commented 4 years ago

Did some reconfigurations and uninstalls.... I am so far:

which python
/usr/bin/python

Will reboot my mac (happens not often) and reinstall XCODE and brew. Let's see what we get. Will post the new brew doctor then

miccal commented 4 years ago

@cdr-chakotay good news.

Turning back to your original issue, does brew cask install vlc --no-quarantine work?

cdr-chakotay commented 4 years ago

So for now i am

brew doctor 
Your system is ready to brew.

And python is also fine. Let's see whats cask brings up:

brew cask doctor
==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 445763 (delta 0), reused 0 (delta 0), pack-reused 445762
Receiving objects: 100% (445763/445763), 201.02 MiB | 3.63 MiB/s, done.
Resolving deltas: 100% (315808/315808), done.
Tapped 1 command and 3580 casks (3,697 files, 215.7MB).
==> Homebrew Version
2.4.0
==> macOS
10.15.5
==> SIP
Enabled
==> Java
13.0.1, 11.0.7, 1.8.0_251
==> xattr issues
Traceback (most recent call last):
  File "/usr/bin/xattr", line 8, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
Error: wrong number of arguments (given 2, expected 1)

Seems to be more cask issue or not @ran-dall

vitorgalvao commented 4 years ago

Seems to be more cask issue or not

Not. A xattr issue is an issue with Python.

cdr-chakotay commented 4 years ago

Finally figured it out. I did: My MacOS default install had no pip (Is that normal)? So installed pip, the setuptools, wheel and xattr

$curl https://bootstrap.pypa.io/get-pip.py | sudo python
$python -m pip install --upgrade pip setuptools wheel 
$python -m pip install --upgrade xattr==0.6.4   

And here we go:

==> Downloading https://get.videolan.org/vlc/3.0.10/macosx/vlc-3.0.10.dmg
==> Downloading from https://ftp.halifax.rwth-aachen.de/videolan/vlc/3.0.10/macosx/vlc-3.
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'vlc'.
==> Installing Cask vlc
==> Moving App 'VLC.app' to '/Applications/VLC.app'.
==> Linking Binary 'vlc.wrapper.sh' to '/usr/local/bin/vlc'.
🍺  vlc was successfully installed!

Is it standard for mac not having those modules??

miccal commented 4 years ago

Is it standard for mac not having those modules??

No, but it is also not standard to have which python report python not found.

cdr-chakotay commented 4 years ago

Yeah still quite strange. Never touched system Python. Don't know how this could have happened.

At least running flawless right now.

Thanks for your inspiration and help 👍