Benjaminbl12 Posted June 8, 2022 Posted June 8, 2022 Hi all, Has anyone managed to actually get Pygame working correctly on a school network? Students can't access CMD so they can't import the libraries that way. We have PyScripter however, when I go to run it in 'remote mode' it just hangs when I enter the install command. If you've managed to get it working, how?!
chris_uk Posted June 8, 2022 Posted June 8, 2022 SCCM script - "C:\Program Files\Python39\Scripts\pip.exe" install -U pygame" Detection Rule - Check the following folder exists. %ProgramFiles%\Python39\include\pygame 1
supportman Posted June 8, 2022 Posted June 8, 2022 (edited) We use this script to install modules in python for students. Its just a batch file: Pastebin.com Edited June 8, 2022 by supportman
mavhc Posted June 8, 2022 Posted June 8, 2022 They could write a bat file to do the same thing as on the cmd line surely
browolf Posted June 8, 2022 Posted June 8, 2022 if the paths are the same on every computer you conceivably install a virtual environment on one and copy it to all the other machines.
Benjaminbl12 Posted June 8, 2022 Author Posted June 8, 2022 Thanks all - I think this started to work but it just gets stuck on 'Defaulting to user installation because normal site-packages is not writeable'. Then comes up in yellow that the connection was broken and has timed out connecting to 'pypi.org'? I've added that url to Smoothwall but nothing...
mavhc Posted June 8, 2022 Posted June 8, 2022 Are you running it as elevated admin? Does it know about proxies?
Benjaminbl12 Posted June 8, 2022 Author Posted June 8, 2022 They could write a bat file to do the same thing as on the cmd line surely Should be! And don't call me Shirley...
Benjaminbl12 Posted June 8, 2022 Author Posted June 8, 2022 Are you running it as elevated admin? Does it know about proxies? How would it know about proxies? We don't use a proxy.
DaveTheTech Posted June 8, 2022 Posted June 8, 2022 Surely anything 'malicious' that can be done at the command prompt, could be done elsewhere? So by taking away that acess you wouldnt be accompishing anyhting? 1
dhicks Posted June 8, 2022 Posted June 8, 2022 Students can't access CMD so they can't import the libraries that way. Sorry, I have no experience of the particular issue you're trying to fix, I just thought I'd add that you could also look at using pip's (the Python package manager) "requirements.txt" file to configure installed Python packages, possibly at machine boot / user login time.
browolf Posted June 8, 2022 Posted June 8, 2022 (edited) Thanks all - I think this started to work but it just gets stuck on 'Defaulting to user installation because normal site-packages is not writeable'. Then comes up in yellow that the connection was broken and has timed out connecting to 'pypi.org'? I've added that url to Smoothwall but nothing... iirc you have to tell smoothwall not to inspect the domains as it breaks the certificate chain. you can also use the command parameters --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypy.org to ignore the certificate errors. Edited June 8, 2022 by browolf
Benjaminbl12 Posted June 9, 2022 Author Posted June 9, 2022 iirc you have to tell smoothwall not to inspect the domains as it breaks the certificate chain. you can also use the command parameters --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypy.org to ignore the certificate errors. Do you put those commands in the pygame cmd script?
supportman Posted June 9, 2022 Posted June 9, 2022 Put python in c:\python not c:\program files\python.
DGardiner Posted June 9, 2022 Posted June 9, 2022 This is the error that comes up [ATTACH=CONFIG]65668[/ATTACH] you need to set the smoothwall to not ssl inspect the traffic to the domains pip is trying to hit.
browolf Posted June 9, 2022 Posted June 9, 2022 (edited) Do you put those commands in the pygame cmd script? they're for use with pip. aka this is through our smoothwall we also have the domains in do not inspect in smoothwall. Edited June 9, 2022 by browolf
BOOT Posted June 9, 2022 Posted June 9, 2022 I download the .whl files for each package they want and put them in a folder. Then install for all users: pip.exe install --no-index --find-links "Path_to_whl_folder" package_name No proxies, SSL bypasses or command prompts needed. 3
mavhc Posted June 9, 2022 Posted June 9, 2022 You can also install modules in python code https://stackoverflow.com/questions/12332975/installing-python-module-within-code
msi_school Posted June 9, 2022 Posted June 9, 2022 I download the .whl files for each package they want and put them in a folder. Then install for all users: pip.exe install --no-index --find-links "Path_to_whl_folder" package_name No proxies, SSL bypasses or command prompts needed. I do this as well, you sometimes have to install the dependency's as well but it just seems simpler to me than fighting the webfilter.
jthompson Posted June 9, 2022 Posted June 9, 2022 We only make python available as part of a sandboxed VM. The VM has no network connectivity, so we install PyGame as part of the initial VM build. They can't run python on the host machines as they can't be trusted to be sensible with it.
jthompson Posted June 9, 2022 Posted June 9, 2022 (edited) What were they doing that was not sensible? Infinite loops spawning notepad, calc, etc. which then leads to host machines getting a hard reboot in order to become usable again. If that happens in a VM it doesn't bring the host down. That's the daft end of things, but then we also had kids bringing in and running whatever L334-HaXoR-looking python code they were finding on the web for things like chat apps, which we weren't keen on. Edit: the whole "sandbox or no sandbox" debate has been had before RE: Python, more than once, so I'll just end with a ¯\_(ツ)_/¯ on that point. Edited June 9, 2022 by jthompson
mavhc Posted June 9, 2022 Posted June 9, 2022 Doesn't sound too bad, I hear that students are allowed to chat with each other in a new technology called "playgrounds" these days
CHiLL Posted June 14, 2022 Posted June 14, 2022 (edited) We've been asked to install Pygame on our systems, but honestly, I can't figure out how to do this. Other Pyhton based software we've deployed, Like Mu Editor and Thonny have had separate installers, which made it easier. Our Python is installed in C:\Program Files\Python39. However, there is no Scripts folder located within here, so I can't use pip. We deploy software via SCCM and I can't figure out if it's possible to install Pygame this way. Edit: I saw there is an MSI in another thread, though it says to get the MSI that matches the version of Python. The latest MSI I can see is for 3.2, despite we're running Python 3.9. Edited June 14, 2022 by CHiLL
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now