Formation icon indicating copy to clipboard operation
Formation copied to clipboard

Add macOS support

Open ObaraEmmanuel opened this issue 4 years ago • 39 comments

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 avatar Mar 07 '21 10:03 ObaraEmmanuel

Hi Obara, i'm here to help :)

SatyenderSinghRana avatar Mar 07 '21 10:03 SatyenderSinghRana

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.

ObaraEmmanuel avatar Mar 07 '21 11:03 ObaraEmmanuel

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

SatyenderSinghRana avatar Mar 07 '21 12:03 SatyenderSinghRana

@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

ObaraEmmanuel avatar Mar 08 '21 08:03 ObaraEmmanuel

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

SatyenderSinghRana avatar Mar 08 '21 09:03 SatyenderSinghRana

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

ObaraEmmanuel avatar Mar 08 '21 10:03 ObaraEmmanuel

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

SatyenderSinghRana avatar Mar 08 '21 15:03 SatyenderSinghRana

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.

ObaraEmmanuel avatar Mar 08 '21 15:03 ObaraEmmanuel

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

SatyenderSinghRana avatar Mar 08 '21 16:03 SatyenderSinghRana

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

ObaraEmmanuel avatar Mar 08 '21 17:03 ObaraEmmanuel

Alright

SatyenderSinghRana avatar Mar 08 '21 17:03 SatyenderSinghRana

did it work?

ObaraEmmanuel avatar Mar 09 '21 09:03 ObaraEmmanuel

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?

SatyenderSinghRana avatar Mar 09 '21 10:03 SatyenderSinghRana

did you delete the files i told you about?

~/Library/Preferences/formation

ObaraEmmanuel avatar Mar 09 '21 15:03 ObaraEmmanuel

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/

SatyenderSinghRana avatar Mar 09 '21 16:03 SatyenderSinghRana

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.

ObaraEmmanuel avatar Mar 09 '21 19:03 ObaraEmmanuel

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"

SatyenderSinghRana avatar Mar 10 '21 09:03 SatyenderSinghRana

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

ObaraEmmanuel avatar Mar 10 '21 10:03 ObaraEmmanuel

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"

SatyenderSinghRana avatar Mar 10 '21 15:03 SatyenderSinghRana

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

ObaraEmmanuel avatar Mar 10 '21 17:03 ObaraEmmanuel

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

SatyenderSinghRana avatar Mar 10 '21 20:03 SatyenderSinghRana

@SatyenderSinghRana-in how did it go?

ObaraEmmanuel avatar Mar 12 '21 10:03 ObaraEmmanuel

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

SatyenderSinghRana avatar Mar 12 '21 10:03 SatyenderSinghRana

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

SatyenderSinghRana avatar Mar 13 '21 12:03 SatyenderSinghRana

He is using python 2.7 which is not supported

ObaraEmmanuel avatar Mar 13 '21 13:03 ObaraEmmanuel

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.

SatyenderSinghRana avatar Mar 14 '21 12:03 SatyenderSinghRana

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

ObaraEmmanuel avatar Mar 14 '21 14:03 ObaraEmmanuel

It's working now 👍🏻

SatyenderSinghRana avatar Mar 14 '21 17:03 SatyenderSinghRana

It's working now 👍🏻

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

Are there other issues you may have noticed?

ObaraEmmanuel avatar Mar 16 '21 14:03 ObaraEmmanuel

ss

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

SatyenderSinghRana avatar Mar 16 '21 17:03 SatyenderSinghRana