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

Running python script on Mac-os with Python 3.9.16 generate lots of errors #91

Open
ghost opened this issue May 21, 2023 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented May 21, 2023

I understand many would use 2.7.16 Python came default with Mac-OS but I have a Mac-Pro 5,1 (2010) and these are steps I used to setup my command line:

  • Click on Finder to open the file explorer
  • Choose Applications folder on the left
  • Click on the Utilities on the right
  • Drag the 'Terminal' down to my taskbar at the bottom to dock the application there
  • Click on the 'Terminal' (Black Window) icon to turnoff Terminal
  • Type: 'sudo xcode-select --install' and enter password to install terminal applications and compilers etc for Mac-os
  • paste this command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

to install 'brew', which allowed me to install Python later on:

  • type the following lines in the 'Terminal' to install Python interpreter and components:
brew search python
brew install [email protected]
cd /usr/local/bin
sudo ln -s python3.9 python3
sudo python3 -m pip install --upgrade pip
sudo pip3 install requests, urllib

then running the downloaded script 'brigadier' which shown following errors:

  • print statements no longer supported
  • import requests failed
  • plistlib, urllib had changed the method names
  • data downloaded had to convert using encode('utf-8')
  • extract keys from dictionary must be converted to list

So I went the long way, debugging the script using Pycharm, and attached is the fixed code, incase anyone would be interested. I had finally managed to download the package on Mac Mojave, have to run the dmg file to open the package and copy out the windows' drivers to another directory. Thank you for doing this initial works, however,

brigadier.zip

@betapictoris
Copy link

betapictoris commented Jun 12, 2023

You're using Python 3, are you using the python3 (#61) branch?

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

1 participant