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

Python support 3.x #82

Open
bandaid opened this issue Feb 2, 2023 · 3 comments
Open

Python support 3.x #82

bandaid opened this issue Feb 2, 2023 · 3 comments

Comments

@bandaid
Copy link

bandaid commented Feb 2, 2023

This is not so much of an issue, but mostly security. Since python 2.x has been phased out, has brigadier moved to support current versions of phython 3.x ?

In the Wiki:Readme:

you'll need Python for Windows (this was tested with the latest 2.7 release) in order to execute the script.

I'm looking to get the full functionality of the Magic Keyboard on a non-mac, non-apple, Microsoft Windows system. Additionally, read battery levels to determine why the Magic Keyboard is suddenly draining batteries in less than a day. Potentially a Microsoft update, though Bluetooth drivers have not changed nor anything else other than PowerToys.

https://www.bluetoothgoodies.com/info/apple-devices/ ,
also magicutilities but not in agreement with this particular developer.

@mrded
Copy link

mrded commented May 15, 2023

In the meantime it's quite a challenge to get Python 2 running on a modern macOS. Even brew no longer supports it.

@jaredstanko
Copy link

First, I support the idea of migrating this to Python v3. But, I don't know how much extra time @timsutton has currently. There is an old PR for Python 3 support. I actually recommend pyenv for your primary Python. Apple is still shipping v3.9.6 from June 2021. Maybe the are backporting security fixes. But, I doubt it.

So while I suggest you make pyenv permanent, I will write these instructions so there is no permanent change to your system.

pyenv - Simple Python Version Management
https://github.com/pyenv/pyenv

# Using Homebrew (assumes zsh)
#
# Install pyenv
brew install pyenv

# Temporarily point all python stuff to Pyenv
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

# Install the environment you want
pyenv install 2

# Make it the default for this shell session
pyenv shell 2

# View python version
python -V

# Go to the repo
cd brigadier/

# Make and activate a python virtual environment
python -m virtualenv venv
source venv/bin/activate

# Install the python requests modules 
python -m pip install requests

./brigadier

# Clean up
pyenv uninstall 2
brew uninstall pyenv

@tomasi-o
Copy link

tomasi-o commented Aug 29, 2023

@jaredstanko Thx a lot for the pyenv Install Guide! Just want to add that under MacOS 11.13 (High Sierra) with an iMac 12,2 (27", mid 2011) I got an error while trying to run this:

NameofComputer:brigadier username$ python -m virtualenv venv
/Users/username/.pyenv/versions/2.7.18/bin/python: No module named virtualenv

This was easy to solve, I just installed virtualenv via
NameofComputer:brigadier username$ pip install virtualenv

After that I could run the brigadier script without any problems. Thank you so much @timsutton for writing this! Now I am a step further in reinstalling bootcamp :)

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

4 participants