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

Add macOS support #7

Open
ObaraEmmanuel opened this issue Mar 7, 2021 · 36 comments
Open

Add macOS support #7

ObaraEmmanuel opened this issue Mar 7, 2021 · 36 comments
Labels
help wanted Extra attention is needed

Comments

@ObaraEmmanuel
Copy link
Owner

Currently, only windows and linux are supported. Formation on macOS is untested and you will most definitely run into problems. It would be nice if someone helped bring Formation to macOS.

@ObaraEmmanuel ObaraEmmanuel added the help wanted Extra attention is needed label Mar 7, 2021
@SatyenderSinghRana
Copy link

Hi Obara, i'm here to help :)

@ObaraEmmanuel
Copy link
Owner Author

Cool, you could comment on any issues you run into here and we can work to fix them ... include tracebacks for any error so it is easy for us to debug.

@SatyenderSinghRana
Copy link

I'm getting this when i run formation-studio in terminal

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/formation-studio", line 8, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/studio/main.py", line 624, in main
StudioApplication().mainloop()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/studio/main.py", line 48, in init
self._restore_position()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/studio/main.py", line 215, in _restore_position
self.wm_attributes('-zoomed', True)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/tkinter/init.py", line 1967, in wm_attributes
return self.tk.call(args)
_tkinter.TclError: bad attribute "-zoomed": must be -alpha, -fullscreen, -modified, -notify, -titlepath, -topmost, or -transparent

@ObaraEmmanuel
Copy link
Owner Author

@SatyenderSinghRana-in I think I have ironed out this issue. Try installing this particular branch like so

pip install --upgrade git+https://github.com/ObaraEmmanuel/Formation@macos-support

and see if it works

@SatyenderSinghRana
Copy link

I upgraded to the new branch and tried running formation-studio, looks like i'm still getting the same error

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/formation-studio", line 8, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/studio/main.py", line 624, in main
StudioApplication().mainloop()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/studio/main.py", line 48, in init
self._restore_position()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/studio/main.py", line 215, in _restore_position
self.wm_attributes('-zoomed', True)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/tkinter/init.py", line 1967, in wm_attributes
return self.tk.call(args)
_tkinter.TclError: bad attribute "-zoomed": must be -alpha, -fullscreen, -modified, -notify, -titlepath, -topmost, or -transparent

@ObaraEmmanuel
Copy link
Owner Author

ObaraEmmanuel commented Mar 8, 2021

I don't think that's the right version you are using coz line 215 is a very different thing in the mac os branch. Ensure you run the command exactly as I gave you before and ascertain that the installation is successful.... the --upgrade is very important

@SatyenderSinghRana
Copy link

I have shared the steps I followed and the message after each command

  1. pip install formation-studio
    Message: Installing collected packages: argparse, mss, entrypoint2, EasyProcess, pyscreenshot, Pillow, lxml, appdirs, formation-studio
    Successfully installed EasyProcess-0.3 Pillow-8.1.2 appdirs-1.4.4 argparse-1.4.0 entrypoint2-0.2.3 formation-studio-0.2.1 lxml-4.6.2 mss-6.1.0 pyscreenshot-2.3

  2. pip install --upgrade git+https://github.com/ObaraEmmanuel/Formation@macos-support
    Message: Collecting git+https://github.com/ObaraEmmanuel/Formation@macos-support
    Cloning https://github.com/ObaraEmmanuel/Formation (to revision macos-support) to /private/var/folders/rv/t2gt2d9d6lg6g6cvrm_rvf0w0000gn/T/pip-req-build-86od_0hx
    Running command git clone -q https://github.com/ObaraEmmanuel/Formation /private/var/folders/rv/t2gt2d9d6lg6g6cvrm_rvf0w0000gn/T/pip-req-build-86od_0hx
    Running command git checkout -b macos-support --track origin/macos-support
    Switched to a new branch 'macos-support'
    Branch 'macos-support' set up to track remote branch 'macos-support' from 'origin'.
    Requirement already satisfied: lxml in ./.pyenv/versions/3.9.1/lib/python3.9/site-packages (from formation-studio==0.2.1) (4.6.2)
    Requirement already satisfied: Pillow in ./.pyenv/versions/3.9.1/lib/python3.9/site-packages (from formation-studio==0.2.1) (8.1.2)
    Requirement already satisfied: appdirs in ./.pyenv/versions/3.9.1/lib/python3.9/site-packages (from formation-studio==0.2.1) (1.4.4)
    Requirement already satisfied: pyscreenshot in ./.pyenv/versions/3.9.1/lib/python3.9/site-packages (from formation-studio==0.2.1) (2.3)
    Requirement already satisfied: entrypoint2 in ./.pyenv/versions/3.9.1/lib/python3.9/site-packages (from pyscreenshot->formation-studio==0.2.1) (0.2.3)
    Requirement already satisfied: mss in ./.pyenv/versions/3.9.1/lib/python3.9/site-packages (from pyscreenshot->formation-studio==0.2.1) (6.1.0)
    Requirement already satisfied: EasyProcess in ./.pyenv/versions/3.9.1/lib/python3.9/site-packages (from pyscreenshot->formation-studio==0.2.1) (0.3)
    Collecting argparse
    Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
    Installing collected packages: argparse
    Successfully installed argparse-1.4.0

  3. formation-studio
    Message: Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.8/bin/formation-studio", line 8, in
    sys.exit(main())
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/studio/main.py", line 624, in main
    StudioApplication().mainloop()
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/studio/main.py", line 48, in init
    self._restore_position()
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/studio/main.py", line 215, in _restore_position
    self.wm_attributes('-zoomed', True)
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/tkinter/init.py", line 1967, in wm_attributes
    return self.tk.call(args)
    _tkinter.TclError: bad attribute "-zoomed": must be -alpha, -fullscreen, -modified, -notify, -titlepath, -topmost, or -transparent

@ObaraEmmanuel
Copy link
Owner Author

It seems you have multiple python versions installed on your computer ... while the pip installation is going to python 3.9 you are running formation-studio installed on python 3.8... uninstall the one on 3.8 or pip ugrade install to the one in 3.8.

@SatyenderSinghRana
Copy link

I uninstalled python 3.8 and 3.9 (also manually removed leftovers from library)
ran "pip freeze" followed by removing all the modules previously installed to start fresh
then installed python 3.9.2 and ran these in terminal:

  1. pip3 install formation-studio
  2. pip3 install --upgrade git+https://github.com/ObaraEmmanuel/Formation@macos-support
  3. formation-studio

now i'm getting this

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/formation-studio", line 8, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/studio/main.py", line 623, in main
ResourceLoader.load()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/studio/resource_loader.py", line 73, in load
style = StyleDelegator(pref.get("resource::theme"))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/ui/styles.py", line 129, in init
styles = parse(files)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/ui/styles.py", line 117, in parse
bundles = re.findall(patterns["bundle"], merged_files(files))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/ui/styles.py", line 95, in merged_files
return "".join([read_file(file) for file in files])
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/ui/styles.py", line 95, in
return "".join([read_file(file) for file in files])
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/ui/styles.py", line 86, in read_file
with open(file_name, "r") as test_file:
FileNotFoundError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/hoverset/ui/themes/default.css'

not sure how to run the package installed via pip3 for python 3.9

@ObaraEmmanuel
Copy link
Owner Author

ObaraEmmanuel commented Mar 8, 2021

The app is having problems reading the config and cache files from the previous versions ... let me remedy that .... stand by for a fix ... I'll inform you when it's done

meanwhile delete everything inside this folder

~/Library/Preferences/formation/

and try again. It will work

@SatyenderSinghRana
Copy link

Alright

@ObaraEmmanuel
Copy link
Owner Author

did it work?

@SatyenderSinghRana
Copy link

SatyenderSinghRana commented Mar 9, 2021

I uninstalled formation-studio, here are the steps with messages after uninstalling:

pip --version
pip 21.0.1 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)

pip uninstall formation-studio
Found existing installation: formation-studio 0.2.1
Uninstalling formation-studio-0.2.1:
Would remove:
/Library/Frameworks/Python.framework/Versions/3.9/bin/formation-studio
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/formation/*
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/formation_studio-0.2.1.dist-info/*
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/*
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/studio/*
Proceed (y/n)? y
Successfully uninstalled formation-studio-0.2.1

pip show formation-studio
WARNING: Package(s) not found: formation-studio

pip install formation-studio
Collecting argparse
Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Installing collected packages: argparse, formation-studio
Successfully installed argparse-1.4.0 formation-studio-0.2.1

pip install --upgrade git+https://github.com/ObaraEmmanuel/Formation@macos-support
Collecting argparse
Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Installing collected packages: argparse
Successfully installed argparse-1.4.0

formation-studio
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/formation-studio", line 8, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/studio/main.py", line 623, in main
ResourceLoader.load()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/studio/resource_loader.py", line 73, in load
style = StyleDelegator(pref.get("resource::theme"))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/ui/styles.py", line 129, in init
styles = parse(files)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/ui/styles.py", line 117, in parse
bundles = re.findall(patterns["bundle"], merged_files(files))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/ui/styles.py", line 95, in merged_files
return "".join([read_file(file) for file in files])
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/ui/styles.py", line 95, in
return "".join([read_file(file) for file in files])
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hoverset/ui/styles.py", line 86, in read_file
with open(file_name, "r") as test_file:
FileNotFoundError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/hoverset/ui/themes/default.css'

I hope i'm not doing anything wrong at my end? Do I need to change any path variables?

@ObaraEmmanuel
Copy link
Owner Author

did you delete the files i told you about?

~/Library/Preferences/formation

@SatyenderSinghRana
Copy link

I double checked it, I don't have any formation related file/folder in
~/Library/Preferences/formation

All the modules are installed here instead
/Library/Frameworks/Python.framework/Versions/3.9/bin/
and
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/

@ObaraEmmanuel
Copy link
Owner Author

Try the following commands in that order

pip install --upgrade git+https://github.com/ObaraEmmanuel/Formation@macos-support
formation-cli --remove config
formation-studio

formation-cli is a cool tool i added to help you clean config and cache files as well as modify config files without necessarily opening formation studio.

@SatyenderSinghRana
Copy link

SatyenderSinghRana commented Mar 10, 2021

I tried the commands in given order, i'm getting this now

formation-cli --remove config
zsh: command not found: formation-cli

also tried this

pip3 formation-cli --remove config (using pip also gave the same error)
ERROR: unknown command "formation-cli"

@ObaraEmmanuel
Copy link
Owner Author

Your installation probably wasn't successful... you are sure the pip install worked? ... try uninstalling then installing once more.

@SatyenderSinghRana
Copy link

I have tried uninstalling then installing and I still get the same message 🤔
pip install shows "Successfully installed argparse-1.4.0 formation-studio-0.2.1"

@ObaraEmmanuel
Copy link
Owner Author

ObaraEmmanuel commented Mar 10, 2021

don't run the command like this ... this doesn't make sense

pip3 formation-cli --remove config

formation cli is a standalone application so run it like this

formation-cli --remove config

the new version definitely has formation-cli ... I tested it in a virtual environment and it worked. The problem has to be on your end.

edit:
the latest version should be able to handle the config issue without you necessarily running formation-cli so u can upgrade and run the studio directly

@SatyenderSinghRana
Copy link

SatyenderSinghRana commented Mar 10, 2021

I tried reinstalling it again and it's not working on my system. I also think that the problem might be with my system. I have asked one of my friends to install formation-studio, once he does that I'll inform you

@ObaraEmmanuel
Copy link
Owner Author

@SatyenderSinghRana-in how did it go?

@SatyenderSinghRana
Copy link

He is out of station for some work. I've reminded him to check it, I'll message you once he replies.

@SatyenderSinghRana
Copy link

SatyenderSinghRana commented Mar 13, 2021

Sorry for the delay, here's the screenshot he sent me
IMG_20210313_182930.jpg

@ObaraEmmanuel
Copy link
Owner Author

He is using python 2.7 which is not supported

@SatyenderSinghRana
Copy link

SatyenderSinghRana commented Mar 14, 2021

It's working on his system now

He is using python 3.7 and he installed it like this:
pip3.7 install formation-studio

pip3.7 install --upgrade git+https://github.com/ObaraEmmanuel/Formation@macos-support

formation-studio

I have installed python 3.7 on my system but same is not working on my system so there's probably something wrong in my system.

@ObaraEmmanuel
Copy link
Owner Author

What exactly is the issue with yours? I told you I pushed a version that will work even if you don't run formation-cli. Try again and send the issue here if any

@SatyenderSinghRana
Copy link

It's working now 👍🏻

@ObaraEmmanuel
Copy link
Owner Author

ObaraEmmanuel commented Mar 16, 2021

It's working now 👍🏻

Could you kindly send a screenshot? Make it look good.

Are there other issues you may have noticed?

@SatyenderSinghRana
Copy link

ss

Demo login interface to share, I'll explore it more later, nice work so far ✌️

@ObaraEmmanuel
Copy link
Owner Author

looks good ... a couple of visual hitches but nothing that can't be fixed ... I will try and set up macOS on an emulator and polish it up.

@ObaraEmmanuel
Copy link
Owner Author

@SatyenderSinghRana Hello, I managed to set up mac on an emulator and fix a few things, If you have the time you could take a look at the master branch and point out any issues that may come up. The emulator is a bit limited and I may not be able to get the full experience as on real mac hardware.

pip install --upgrade git+https://github.com/ObaraEmmanuel/Formation@master

@SatyenderSinghRana
Copy link

Hi Obara, I sold my MacBook :( sometime ago and now I'm using a Windows laptop. Due to this, I won't be able to review the changes related to Formation Studio.

@SatyenderSinghRana
Copy link

I have a tight schedule these days, but I'll try to contribute to the windows version of Formation Studio :)

@ObaraEmmanuel ObaraEmmanuel added this to the Mac OS support milestone May 16, 2022
@Kastakin
Copy link

Hello, I have a M3 Pro Macbook. I am a PhD student with kind of a tight schedule but I love the potential of the project and I would really like to help in any way I could.

@ObaraEmmanuel
Copy link
Owner Author

ObaraEmmanuel commented May 15, 2024

Hello @Kastakin. I appreciate your interest in the project. I don't use MacOS so I don't have very clear insights into what MacOS issues the studio has. I know the entire shortcut-keys system does not work on Mac because I haven't gotten round to figuring out the keycodes. The last time I tried I did not get consistent keycodes on Mac so I gave up. It can be worth looking at in your free time. The code for that is in hoverset/data/keymap.py. Other than that, feel free to identify and report/fix any other issues you notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants