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

brew error on M1 with macOS Monterey 12.3 #121

Closed
Leeiio opened this issue Mar 16, 2022 · 66 comments
Closed

brew error on M1 with macOS Monterey 12.3 #121

Leeiio opened this issue Mar 16, 2022 · 66 comments

Comments

@Leeiio
Copy link

Leeiio commented Mar 16, 2022

I'm getting this.

→ brew install TomAnthony/brews/itermocil
==> Downloading https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz
Already downloaded: /Users/Leeiio/Library/Caches/Homebrew/downloads/d98de4b2d4d986c9eacf67d572ad3182da5555a27ae39f38260d899047b9ef4b--PyYAML-3.11.tar.gz
==> Downloading https://github.com/TomAnthony/itermocil/archive/0.2.1.tar.gz
Already downloaded: /Users/Leeiio/Library/Caches/Homebrew/downloads/7660c48dfb6cb50ac68fa581c5de591c2db93fb698776e83084c669a45eb0299--itermocil-0.2.1.tar.gz
==> Installing itermocil from tomanthony/brews
==> python -c import setuptools... --no-user-cfg install --prefix=/opt/homebrew/Cellar/itermocil/0.2.1/libexec/vendor --install-scripts=/opt/homebrew/Cellar/itermocil/0.2.1/libexec/vendor/bin --single-version-externally-managed --r
Last 15 lines from /Users/Leeiio/Library/Logs/Homebrew/itermocil/01.python:
2022-03-16 04:59:53 +0000

python
-c
import setuptools, tokenize
__file__ = 'setup.py'
exec(compile(getattr(tokenize, 'open', open)(__file__).read()
  .replace('\r\n', '\n'), __file__, 'exec'))
--no-user-cfg
install
--prefix=/opt/homebrew/Cellar/itermocil/0.2.1/libexec/vendor
--install-scripts=/opt/homebrew/Cellar/itermocil/0.2.1/libexec/vendor/bin
--single-version-externally-managed
--record=installed.txt


If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/tomanthony/homebrew-brews/issues

These open issues may also help:
I can't install itermocil.  https://github.com/TomAnthony/homebrew-brews/issues/4
itermocil install is failing https://github.com/TomAnthony/homebrew-brews/issues/2
@scottluxford
Copy link

Python support was dropped from MacOS 12.3. The script is pointing at /usr/bin/python which is now kaput!

I'll update if I find a decent solution.

@zvictor
Copy link

zvictor commented Mar 16, 2022

Is there a temporary workaround?

@AdrienPoupa
Copy link

I am using the following very hacky, very dirty workaround:

  1. Install Python 2.7.18 through pyenv, given Homebrew no longer supports it:
> brew install pyenv
> pyenv install 2.7.18
  1. Replace the Python2 bin location in itermocil binary:
> nano /usr/local/Cellar/itermocil/0.2.1/libexec/bin/itermocil
-#!/usr/bin/python
+#!/Users/YOUR_USERNAME/.pyenv/versions/2.7.18/bin/python2.7

Now the proper solution would be to migrate the codebase to Python3 and change the Python binary location, but I don't see that happening anytime soon unfortunately.

@Leeiio
Copy link
Author

Leeiio commented Mar 16, 2022

I have uninstall the itermocil and now I can not install it any more...

@godbout
Copy link
Collaborator

godbout commented Mar 16, 2022

just in case. as this repo doesn't seem to be updated anymore, i've forked and updated for Python3: https://github.com/godbout/itermocil

@AdrienPoupa
Copy link

Oh, it was simply missing the parentheses on print? Good to know thanks!

@scottluxford
Copy link

Nice one @AdrienPoupa - this was my approach too.

But @godbout - legend. Your fork works a treat. Cheers.

@godbout
Copy link
Collaborator

godbout commented Mar 17, 2022

@scottluxford enjoy 💫 had to get this fixed before working on my projects. life without iTermocil is so sparkless.

@Leeiio
Copy link
Author

Leeiio commented Mar 17, 2022

just in case. as this repo doesn't seem to be updated anymore, i've forked and updated for Python3: https://github.com/godbout/itermocil

@godbout Nice job! But when I install the itermocil and use itermocil test, I am getting this

Traceback (most recent call last):
  File "/Users/Leeiio/.pyenv/versions/3.7.12/bin/itermocil", line 11, in <module>
    load_entry_point('itermocil==0.2.3', 'console_scripts', 'itermocil')()
  File "/Users/Leeiio/.pyenv/versions/3.7.12/lib/python3.7/site-packages/itermocil.py", line 752, in main
    instance = Itermocil(filepath, here=args.here, cwd=cwd)
  File "/Users/Leeiio/.pyenv/versions/3.7.12/lib/python3.7/site-packages/itermocil.py", line 79, in __init__
    self.process_file()
  File "/Users/Leeiio/.pyenv/versions/3.7.12/lib/python3.7/site-packages/itermocil.py", line 568, in process_file
    self.arrange_panes(len(window['panes']), layout)
  File "/Users/Leeiio/.pyenv/versions/3.7.12/lib/python3.7/site-packages/itermocil.py", line 262, in arrange_panes
    for p in range(0, second_columns):
TypeError: 'float' object cannot be interpreted as an integer

Anyone know how to solve this? I have zero knowledge in 🐍

@godbout
Copy link
Collaborator

godbout commented Mar 17, 2022

no idea sorry. zero Python here also. was not even aware that there were tests?
in my case i'm under Python 3.9. it's possible that the changes i've made are not enough for your config. they work for my owns with setting up vertical and horizontal panes though, and multiple tabs.

@godbout
Copy link
Collaborator

godbout commented Mar 17, 2022

you have the stack in the error log, and the error shows an issue between float and integer conversion. that should help. maybe an issue with your config, maybe some more changes to be made. strings needed utf8 encoding/decoding. possible that there's more type restrictions now.

@Leeiio
Copy link
Author

Leeiio commented Mar 17, 2022

I found when use layout: tiled it will cause errors.

@Leeiio
Copy link
Author

Leeiio commented Mar 17, 2022

open itermocil.py file, change the code in line 236 second_columns = num_panes / 2 to second_columns = num_panes // 2, done.

@godbout
Copy link
Collaborator

godbout commented Mar 17, 2022

nice :D do a PR!

@Lzmog
Copy link

Lzmog commented Mar 17, 2022

open itermocil.py file, change the code in line 236 second_columns = num_panes / 2 to second_columns = num_panes // 2, done.

I would like to point out, that first of all

Otherwise it will not work.
At least for me it didn't worked.

P.s. It will still throw TypeError, but hey, at least it work. :D

@godbout
Copy link
Collaborator

godbout commented Mar 17, 2022

ok so if no one does it i'll do it.
well i did it.

@godbout
Copy link
Collaborator

godbout commented Mar 17, 2022

ok so if no one does it i'll do it.
well i did it.

huh i saw the PR made by @Leeiio only after i've made the changes :D sorry, didn't receive any notification. strange. anyways, still merged. i've made the changes necessary regarding this issue for the other layouts too.

@Leeiio
Copy link
Author

Leeiio commented Mar 18, 2022

ok so if no one does it i'll do it.
well i did it.

huh i saw the PR made by @Leeiio only after i've made the changes :D sorry, didn't receive any notification. strange. anyways, still merged. i've made the changes necessary regarding this issue for the other layouts too.

Nice! But I found another bug, when I use layout: tiled, the commands in second panel doesn't work.
A sample .yam file

windows:
  - name: test
    root: ~
    layout: tiled
    panes:
      - commands:
          - ls
      - commands:
          - ls
      - commands:
          - ls
        focus: true
      - commands:
          - ls

Maybe I should talk about bugs in another place :)

@godbout
Copy link
Collaborator

godbout commented Mar 19, 2022

@Leeiio i'll check. maybe if you're using my fork it's best to report bugs there.

@godbout
Copy link
Collaborator

godbout commented Mar 19, 2022

windows:

  • name: test
    root: ~
    layout: tiled
    panes:
    • commands:
      • ls
    • commands:
      • ls
    • commands:
      • ls
        focus: true
    • commands:
      • ls

works here.

Screen Shot 2022-03-19 at 20 47 15

are you sure you're using the right iTermocil? if you make changes yourself in the itermocil.py file you need to run the file with python3 itermocil.py unless you run the setup each time.

@Leeiio
Copy link
Author

Leeiio commented Mar 20, 2022

@godbout Thanx, I have reinstalled the iTermocil, now everything is ok!

@DougThwaites
Copy link

@godbout thanks so much for doing this, worked like a charm. Do you have a buymeacoffee.com link or something?

@godbout
Copy link
Collaborator

godbout commented Mar 28, 2022

@DougThwaites if you're into Vim i built Vim Mode for macOS. license is one coffee a month: https://github.com/godbout/kindaVim.theapp and https://kindavim.app
if you're not into Vim, then i have an old ko-fi account yeah but i might use the money to buy beers instead: http://ko-fi.com/A1553NO
else thoughts and prayers for GitHub to accept my sponsorship account. i've only been waiting for 2.5 years.

thank you!

@DougThwaites
Copy link

DougThwaites commented Mar 28, 2022

@godbout Not really a Vim guy but looks cool.

Just chucked a few bob your way via Ko-fi, hope it'll get ya a couple of beers where you are.

Also that's crazy about the sponsorship account taking so long. Good luck.

@godbout
Copy link
Collaborator

godbout commented Mar 28, 2022

@DougThwaites that one's on you:

IMG_2389

(hopefully i'm better at building software than i am at taking pictures.)

thanks a lot. greatly appreciated!

@godbout
Copy link
Collaborator

godbout commented Mar 28, 2022

and of course i'll update this thread with the next beer.

@Lzmog
Copy link

Lzmog commented Mar 28, 2022

Found another solution.
TryGhost/node-sqlite3#1552 (comment)

  1. Install pyenv with brew install pyenv
  2. Install Python 2.7 with pyenv install 2.7.18 and then pyenv global 2.7.18
  3. Then set the default paths typing in the console export PATH="${HOME}/.pyenv/shims:${PATH}"

@ruudk
Copy link
Collaborator

ruudk commented Mar 28, 2022

@Lzmog Doesn't this change the default Python to 2.7.18 everywhere? Won't this break other apps?

@Lzmog
Copy link

Lzmog commented Mar 30, 2022

- Doesn't this change the default Python to 2.7.18 everywhere?
As I understand, yes it changes the default Python into 2.7.18.

- Won't this break other apps?
As it is now, I didn't notice any breaks related to other apps, but it might effect some apps in future.

@Lzmog Doesn't this change the default Python to 2.7.18 everywhere? Won't this break other apps?

@godbout
Copy link
Collaborator

godbout commented Apr 7, 2022

@godbout Thanks a lot for the suggestion. But this did not work too. Installation goes through fine, but the same runtime error still pops up. I tried uninstalling and re-installing PyYAML too, to the needed version (3.11), but no luck there as well.

just in case, i think PyAML is needed and you should put it back, if you're removed that line. not sure if it's a Python 3.8 error. i got a fresh install from last week on 12.3 and it worked fine. Python 3.9 (latest) installed from Homebrew.

@TomAnthony
Copy link
Owner

@ruudk - I have added you. I haven't had time to maintain this for sometime now, and have reached out to a few people before to find a new maintainer without much luck. Happy if someone on this thread wants to take a wider maintainer role! :)

@ruudk
Copy link
Collaborator

ruudk commented Apr 7, 2022

@TomAnthony Thanks for your reply! My Python skills are terrible.

@godbout Since you have been so helpful in this thread, would this be something for you to take on? I would be happy to offer you a few beers of coffee's 😊

@DougTGP
Copy link

DougTGP commented Apr 7, 2022

@godbout I'd chuck another few beers in the pot along with @ruudk to get the original repo all ticky boo.

@godbout
Copy link
Collaborator

godbout commented Apr 7, 2022

@DougThwaites i definitely can help with making the official repo up to date. i forked before instead because the repo didn’t seem maintained anymore. for future PRs tho i don’t think i’ll have the Python skills to judge tho. PHP JS Swift here and going full Mac apps dev so Python is definitively not on the list. if it’s fine with you guys then i’m in.

i will accept the liquid rewards eventually.

@ruudk
Copy link
Collaborator

ruudk commented Apr 7, 2022

@godbout That's great! We just need somebody to make it working again on Python 3.

@TomAnthony Could you invite @godbout ? Thanks!

@TomAnthony
Copy link
Owner

@ruudk @godbout Done! :)

@godbout
Copy link
Collaborator

godbout commented Apr 7, 2022

guys. i’m in the middle of applying for my French passport renewal after being stranded on 30 square kilometers for 2.5 FUCKING YEARS. they finally sent some consulate agent, coz it’s the French presidential elections. so i’m gonna finish this off first and only then i’ll be on iTermocil. thanks 😄

@godbout
Copy link
Collaborator

godbout commented Apr 7, 2022

oh also @TomAnthony. not sure how you want to handle the repo now. are you completely out or you still want to have a say?

because what i usually do in my own projects is support only the two latest official language versions (usually the last one being the stable, the previous one being the security fixes and bugs updates).

for iTermocil what i would do is release a v1 for Python 3 (probably 3.9) that would break for Python 2.7 most probably. like if people want iTermocil for 2.7, i guess we would need to do a versioned release in Homebrew. (like brew install itermocil@0.2.1)

again, no knowledge of Python or the Python ecosystem here. i just know pip coz it sounds very funny in French.

@ruudk
Copy link
Collaborator

ruudk commented Apr 7, 2022

Let's keep it simple. When people want to run this on Python V2, they're on their own and can use an old tag.

The project should just be bumped to Python V3 as that's the default Python in Brew now.

@godbout
Copy link
Collaborator

godbout commented Apr 7, 2022

Let's keep it simple. When people want to run this on Python V2, they're on their own and can use an old tag.

The project should just be bumped to Python V3 as that's the default Python in Brew now.

ok. @TomAnthony any reason why this has to be installed through brew install TomAnthony/brews/itermocil and not directly in Homebrew core? brew install itermocil?

@ruudk
Copy link
Collaborator

ruudk commented Apr 7, 2022

I think it's because this is not part of brew core. Just a tap, for less important projects.

@godbout
Copy link
Collaborator

godbout commented Apr 7, 2022

but iTermocil is important! can't we add this to homebrew-core? i've added stuff homebrew-cask but never to core or taps. not sure about their policies. thought brew taps where kinda obsolete now?

@godbout
Copy link
Collaborator

godbout commented Apr 7, 2022

policies here: https://docs.brew.sh/Acceptable-Formulae

@ruudk
Copy link
Collaborator

ruudk commented Apr 7, 2022

Let's first focus on fixing this, otherwise it will def never be accepted :)

@godbout
Copy link
Collaborator

godbout commented Apr 7, 2022

ok i've made a PR with all the changes for Python3. what's needed now is to make a release. what i'm not sure about yet is how we want to install iTermocil. i wanna add it to homebrew-core and just do a brew install itermocil, but not sure yet whether it would be accepted or not.

if not we may need to update @TomAnthony's brews/taps. i have no knowledge of personal taps, but it seems that one is currently outdated and would need some rework: https://github.com/TomAnthony/homebrew-brews/issues

@godbout
Copy link
Collaborator

godbout commented Apr 7, 2022

Let's first focus on fixing this, otherwise it will def never be accepted :)

i've updated to Python3. code works now. at least on my machine. not sure about M1. maybe best is that people install and try and report before we do a homebrew release. but that would require cloning the repo and installing manually. sorry can't think too much more today. got my passport done so i'm hammered.

@godbout
Copy link
Collaborator

godbout commented Apr 8, 2022

@TomAnthony your brews' syntax (https://github.com/TomAnthony/homebrew-brews/tree/master/Formula) need to be updated, currently they're not working. we can help here by:

  1. updating your current tap. if it's ok with you, can you invite us as collaborators?
  2. create a new tap, and then update the README with the new installation procedure. but then that kind of defeat the purpose of working on this current repo.

thanks.

@ruudk
Copy link
Collaborator

ruudk commented Apr 8, 2022

@godbout Didn't had my notifications set up so therefore I missed the PR. Just enabled them.
I reviewed it just yet and it seems to be good.

@TomAnthony Please invite @godbout and @ruudk to the https://github.com/TomAnthony/homebrew-brews repo so that we can fix it there too.

@TomAnthony
Copy link
Owner

ok. @TomAnthony any reason why this has to be installed through brew install TomAnthony/brews/itermocil and not directly in Homebrew core? brew install itermocil?

Just that it was a long time ago, and I tried to submit it to core a few times but couldn't get it accepted at the time.

@TomAnthony Please invite @godbout and @ruudk to the https://github.com/TomAnthony/homebrew-brews repo so that we can fix it there too.

Done!

oh also @TomAnthony. not sure how you want to handle the repo now. are you completely out or you still want to have a say?
because what i usually do in my own projects is support only the two latest official language versions (usually the last one being the stable, the previous one being the security fixes and bugs updates).

Whilst I would love to stay involved, realistically I am too time poor and I don't want to hold things back. I'm happy for you to make decisions. :) I might want to be involved more again in the future, but in that case I would expect to be more of an equal collaborator rather then benevolent dictator. :)

Thanks for your work on this!

@godbout
Copy link
Collaborator

godbout commented Apr 8, 2022

Just that it was a long time ago, and I tried to submit it to core a few times but couldn't get it accepted at the time.

you're definitely smarter than me. it took three days to understand the doc and it seems you made the right choice. doesn't go to core.

Done!

thank you!

Whilst I would love to stay involved, realistically I am too time poor and I don't want to hold things back. I'm happy for you to make decisions. :) I might want to be involved more again in the future, but in that case I would expect to be more of an equal collaborator rather then benevolent dictator. :)

tbh i'm like you, barely have time (other priorities). but on any project i work the first i do is... run iTermocil 😄️ so we'll get it working at least. definitely no issue (probably would actually prefer) if you'd stay the benevolent dictator.

Thanks for your work on this!

no worries. thanks for the amazing tool you created!

@godbout
Copy link
Collaborator

godbout commented Apr 8, 2022

Let's keep it simple. When people want to run this on Python V2, they're on their own and can use an old tag.

The project should just be bumped to Python V3 as that's the default Python in Brew now.

well, computers are not that simple 😅️

i've updated the brew and iTermocil's code. now here's the thing. by default there's not Python interpreter on macOS 12.3 anymore. but once you install Xcode and the component tools, Python is installed. but it's v3.8. installing through Homebrew with brew install python you get 3.9. but 3.10 is actually the latest version (https://www.python.org/downloads/), and you can install it with brew install python@3.10.

so. i have no idea if the changes i've made would work on the 3 versions. plus afaik (which means nothing), we need to point to an interpreter in iTermocil's code. currently it points to /usr/bin/python which is the one installed with Xcode/tools.

so bis. which one we go for? we'll have to edit the README i assume because afaik (again), iTermocil's users will have to install Python first. i'd say easiest would be just a brew install python, hence v3.9 (for now? maybe change in the future?). any thoughts?

@ruudk
Copy link
Collaborator

ruudk commented Apr 8, 2022

I'll have a look later. There are a lot of formulas that depend on Python 3 and then use a homebrew helper to get that specific path.

@godbout
Copy link
Collaborator

godbout commented Apr 9, 2022

I'll have a look later. There are a lot of formulas that depend on Python 3 and then use a homebrew helper to get that specific path.

ok, good. if you could pinpoint to something that would help. again if it was just up to me i'd hardcode to what brew install python gives and would research/update later if/when when needed. even more for this repo coz my knowledge is pretty limited here 😅️

@godbout
Copy link
Collaborator

godbout commented Apr 9, 2022

ok done. i can personally install through the usual instructions from the README (added the brew install python step tho). installs fine, then using it works well too. iTermocil itself should work with any Python3 version, but the setup is currently kinda hardcoded to 3.9. not sure how to handle that yet. will research if it's an issue for someone.

you guys please try and report! thank you.

@ruudk
Copy link
Collaborator

ruudk commented Apr 9, 2022

The problem has been fixed, please run brew update && brew install tomanthony/brews/itermocil to retry.
If you encounter issues, please create a new issue.

@ruudk ruudk closed this as completed Apr 9, 2022
Repository owner locked as resolved and limited conversation to collaborators Apr 9, 2022
@ruudk
Copy link
Collaborator

ruudk commented Apr 10, 2022

@godbout
Copy link
Collaborator

godbout commented Apr 10, 2022

hey @ruudk thanks but you did some great work too. so back to you. where's your own ko-fi page? :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests