Closed yanskun closed 3 years ago
I will check later.
For now, to avoid the problem, try:
brew install git
.Even if you sourced the brew-wrap, you can call brew
command directly with command
:
$ command brew install git
Could you check:
$ brew file version
before uninstalling brew-file?
I could reproduce the error when I tried:
$ python2 /usr/local/bin/brew-file
File "/usr/local/bin/brew-file", line 86
for kk in [f"${k}", f"${{{k}}}"]:
So, somehow brew
command used python2.
Could you please check followings?:
$ /usr/local/bin/brew-file
This should show just an usage.
$ brew-file
Should same as above
$ type brew
I think it uses brew-wrap.
$ type python3
This should be like /usr/local/bin/python3 or some python3.
I'm using python3.
$ brew file
File "/usr/local/bin/brew-file", line 86
for kk in [f"${k}", f"${{{k}}}"]:
^
SyntaxError: invalid syntax
$ pyenv versions
system
3.10.0
* 3.5.10 (set by ...)
$ pyenv install 2.7.18
$ pyenv global 2.7.18
$ python --version
Python 2.7.18
$ brew file
usage: brew-file [-f INPUT] [-b BACKUP] [-F FORM] [--leaves] [--on_request]
[--top_packages TOP_PACKAGES] [-U] [-r REPO] [-n] [--caskonly]
[--appstore APPSTORE] [--no_appstore] [-C] [-y] [-V VERBOSE] [-h]
[command] ...
Execute `brew-file help` to get help.
Refer https://homebrew-file.readthedocs.io for more details.
$ brew install git
Updating Homebrew...
...
I was able to confirm that there is no problem if I downgrade the python version from 3 to 2.
The problem is resolved!
thank you very much!!!!
I'm using pyenv installed with anyenv to version control python.
@rcmdnk
Is it incompatible?
It worked when I tried to use python2.x
OK, I understand.
The main problem is that the python you used does not have f-string function. It is introduced in Python 3.6. Python3.5 (and Python2.X) does not have it.
When you set pyenv global 2.7.18
, there was no python3
in your virtual environment.
Then, the script called python3 of the system (maybe /usr/local/bin/python3, installed by homebrew (python3.9)).
Current homebrew-file needs python3.6 or later and it is automatically installed by homebrew when homebrew-file is installed.
If you need to work with python3.5 or former,
you need to run brew
command outside of the virtual environment or remove brew-wrap lines from your .bashrc/.zshrc.
brew install / uninstall command not working
for example
/usr/local/bin/brew-file
is read-only. So I haven't edited it.versions
tried
This error prevents you from even uninstalling.
please help me...