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

Why does standalone install require Python2? #371

Open
hackdefendr opened this issue Dec 10, 2022 · 5 comments
Open

Why does standalone install require Python2? #371

hackdefendr opened this issue Dec 10, 2022 · 5 comments

Comments

@hackdefendr
Copy link

Python2 on Mac OS has been fully removed at the system level and cannot be installed via Homebrew anymore. I know about #327 and that #368 is waiting for approval to work around it, but Python2 is in fact uninstallable on MacOS, so unless the core dependency on Python2 is updated we will still not be able to install or even build local versions on Macs.

@abitrolly
Copy link
Collaborator

I am not on Mac, so.. when this happens and what do you see?

@hackdefendr
Copy link
Author

Initially I see an error about python not existing, I guessed it meant the symlink to the Python2 binary. I tried to fix this by creating the symlink pointing to the Python3 binary. Then I tried again and got the crash with icu, which #368 works around.

I did manage to compile ICU 72 on my M1 Mac, but cht.sh still crashes when it tries to pull down the cheat sheets from the repository. Here is the full output minus the Test output:

macbookpro:~ jsingleton$ cht.sh --standalone-install
Where should cheat.sh be installed [/Users/jsingleton/.cheat.sh]?

>> Cloning cheat.sh locally
Cloning into '/Users/jsingleton/.cheat.sh'...
remote: Enumerating objects: 3785, done.
remote: Counting objects: 100% (248/248), done.
remote: Compressing objects: 100% (122/122), done.
remote: Total 3785 (delta 136), reused 211 (delta 123), pack-reused 3537
Receiving objects: 100% (3785/3785), 4.46 MiB | 7.20 MiB/s, done.
Resolving deltas: 100% (2363/2363), done.

>> Creating virtual environment
created virtual environment CPython3.11.0.final.0-64 in 203ms
  creator CPython3Posix(dest=/Users/jsingleton/.cheat.sh/ve, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/jsingleton/Library/Application Support/virtualenv)
    added seed packages: pip==22.3.1, setuptools==65.6.3, wheel==0.38.4
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

>> Installing python requirements into the virtual environment
      40 dependencies were successfully installed

>> Fetching the upstream cheat sheets repositories
Traceback (most recent call last):
  File "/Users/jsingleton/.cheat.sh/lib/fetch.py", line 22, in <module>
    import adapter
  File "/Users/jsingleton/.cheat.sh/lib/adapter/__init__.py", line 18, in <module>
    from . import *
  File "/Users/jsingleton/.cheat.sh/lib/adapter/question.py", line 15, in <module>
    from polyglot.detect import Detector
  File "/Users/jsingleton/.cheat.sh/ve/lib/python3.11/site-packages/polyglot/detect/__init__.py", line 1, in <module>
    from .base import Detector, Language
  File "/Users/jsingleton/.cheat.sh/ve/lib/python3.11/site-packages/polyglot/detect/base.py", line 11, in <module>
    from icu import Locale
  File "/Users/jsingleton/.cheat.sh/ve/lib/python3.11/site-packages/icu/__init__.py", line 37, in <module>
    from ._icu_ import *
ImportError: dlopen(/Users/jsingleton/.cheat.sh/ve/lib/python3.11/site-packages/icu/_icu_.cpython-311-darwin.so, 0x0002): Library not loaded: libicui18n.72.dylib
  Referenced from: <A6EB7F0C-706E-39CC-88C4-96B8B8B3B4BD> /Users/jsingleton/.cheat.sh/ve/lib/python3.11/site-packages/icu/_icu_.cpython-311-darwin.so
  Reason: tried: 'libicui18n.72.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibicui18n.72.dylib' (no such file), 'libicui18n.72.dylib' (no such file), '/usr/local/lib/libicui18n.72.dylib' (no such file), '/usr/lib/libicui18n.72.dylib' (no such file, not in dyld cache), '/Users/jsingleton/.cheat.sh/libicui18n.72.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/jsingleton/.cheat.sh/libicui18n.72.dylib' (no such file), '/Users/jsingleton/.cheat.sh/libicui18n.72.dylib' (no such file), '/usr/local/lib/libicui18n.72.dylib' (no such file), '/usr/lib/libicui18n.72.dylib' (no such file, not in dyld cache)

>> Running self-tests
...

Question, are there hardcoded paths in cht.sh? If yes, /opt/homebrew/{bin,sbin} should be added for M1/M2 Macs running HomeBrew.

Thanks for looking at this. I'm here to test and provide logs for the M1/M2 Mac support.

Repository owner deleted a comment from user-xffdsjkh Dec 21, 2022
@abitrolly
Copy link
Collaborator

Wow. I can just remove comments here. Nice. :D Well, not really, but whatever.

@abitrolly
Copy link
Collaborator

@hackdefendr try this route #372 - should get rid of the ICU.

@hackdefendr
Copy link
Author

hackdefendr commented Dec 23, 2022

Hi hi,
I just am getting to this. Let me pull that branch and see how it goes.
I will update this comment with details.

UPDATE

➜  ~ curl localhost:8002
      _                _         _    __
  ___| |__   ___  __ _| |_   ___| |__ \ \      The only cheat sheet you need
 / __| '_ \ / _ \/ _` | __| / __| '_ \ \ \     Unified access to the best
| (__| | | |  __/ (_| | |_ _\__ \ | | |/ /     community driven documentation
 \___|_| |_|\___|\__,_|\__(_)___/_| |_/_/      repositories of the world

+------------------------+ +------------------------+ +------------------------+
| $ curl cheat.sh/ls     | | $ cht.sh btrfs         | | $ cht.sh lua/:learn    |
| $ curl cht.sh/btrfs    | | $ cht.sh tar~list      | | Learn any* programming |
| $ curl cht.sh/tar~list | |                        | | language not leaving   |
| $ curl https://cht.sh  | |                        | | your shell             |
|                        | |                        | | *) any of 60           |
|                        | |                        | |                        |
+-- queries with curl ---+ +- own optional client --+ +- learn, learn, learn! -+
+------------------------+ +------------------------+ +------------------------+
| $ cht.sh go/f<tab><tab>| | $ cht.sh --shell       | | $ cht.sh go zip lists  |
| go/for   go/func       | | cht.sh> help           | | Ask any question using |
| $ cht.sh go/for        | | ...                    | | cht.sh or curl cht.sh: |
| ...                    | |                        | | /go/zip+lists          |
|                        | |                        | | (use /,+ when curling) |
|                        | |                        | |                        |
+---- TAB-completion ----+ +-- interactive shell ---+ +- programming questions-+
+------------------------+ +------------------------+ +------------------------+
| $ curl cht.sh/:help    | | $ vim prg.py           | | $ time curl cht.sh/    |
| see /:help and /:intro | | ...                    | | ...                    |
| for usage information  | | zip lists _            | | real    0m0.075s       |
| and README.md on GitHub| | <leader>KK             | |                        |
| for the details        | |             *awesome*  | |                        |
|            *start here*| |                        | |                        |
+--- self-documented ----+ +- queries from editor! -+ +---- instant answers ---+

[Follow @igor_chubin for updates][github.com/chubin/cheat.sh]

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

No branches or pull requests

2 participants