Skip to content

Proofread, reorganized, and added to all the "Python on Windows" guides #794

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

Merged

Conversation

discretegames
Copy link

@discretegames discretegames commented Nov 8, 2022

As discussed in #dev-contrib I wanted to write a guide for the site on how to add Python to Path since it comes up so often in help channels. wookie already wrote a lot of good stuff on that and other Windows matters (see #773) which here I expanded on and added lots of instructional screenshots.

The changes I've made are as follows (they're all on the add-windows-guide branch):

Big changes:

  • Reorganized the "Python on Windows" and "Installing Python on Windows" guides into one guide that has installing, py launcher, and venv sections.
    • This includes new detailed screenshotted step by step instructions of "our" recommended way of installing, starting from the python.org/downloads yellow button. Want input to make sure "our" really represents PyDis.
    • wookies stuff is still there but has been much rewritten and expanded upon.
  • Moved the Windows Path info to it's own "Adding Python to the Path" guide that has two sections based on wookies stuff.
    • Safe method of having the installer add to Path. Detailed steps with screenshots.
    • Advanced method of manually editing the Path. Detailed steps with screenshots.

Smaller changes:

  • Proofread and did a few formatting changes, like using quote boxes, to "Common issues using Python on Windows" guide. Added links and tidbits here and there.
  • Proofread and added some more drawbacks and images to "Why not to install Python from the Microsoft Store" guide.
  • Proofread and added WSL to "Unix-style Python Environment" guide.
  • Tweaked the slugs, titles, and descriptions to fit new content and so the guides appear in a nice order in folder.
  • Used the VSCode Rewrap plugin to make markdown paragraphs 120 line width. (Mostly for my own sanity while editing.)

(This is my first time contributing and first PR here 😅 so I really apologize if I'm doing something wrong like having too many changes at once that are tricky to review.)

@discretegames discretegames marked this pull request as ready for review November 8, 2022 14:23
code with to ensure if it actually errors.

If your code runs fine, you could try restarting your editor. If you have newly installed a module it may just not
have detected it yet. If that doesn't help, you may need to configure your editor to ensure it is looking for the
Copy link
Member

@shtlrs shtlrs Nov 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, some editors can still show that error even if you're showing the correct virtual environment with the installed package.
I think it was opencv IIRC.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that this https://stackoverflow.com/questions/34365044/pycharm-does-not-recognize-cv2-as-a-module ?
Where the fix is something like from cv2 import cv2. Could add a note to that SO link.

Copy link
Member

@shtlrs shtlrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only had a look on two files but it looks good so far.
I'll try to have a look at the rest after work.

Beautiful content, thanks to you both for this. (@wookie184)

discretegames and others added 6 commits November 8, 2022 18:14
…/common-issues.md

Co-authored-by: Amrou Bellalouna <48383734+shtlrs@users.noreply.github.com>
…/common-issues.md

Co-authored-by: Amrou Bellalouna <48383734+shtlrs@users.noreply.github.com>
…/common-issues.md

Co-authored-by: Amrou Bellalouna <48383734+shtlrs@users.noreply.github.com>
Copy link
Contributor

@wookie184 wookie184 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I have some suggestions, feel free to disagree with any of them :)

discretegames and others added 11 commits November 12, 2022 17:46
…/installing-and-using-python.md

Co-authored-by: wookie184 <wookie1840@gmail.com>
…/installing-and-using-python.md

Co-authored-by: wookie184 <wookie1840@gmail.com>
…/installing-and-using-python.md

Co-authored-by: wookie184 <wookie1840@gmail.com>
…/common-issues.md

Co-authored-by: wookie184 <wookie1840@gmail.com>
…/installing-and-using-python.md

Co-authored-by: wookie184 <wookie1840@gmail.com>
…/putting-python-on-path.md

Co-authored-by: wookie184 <wookie1840@gmail.com>
…/putting-python-on-path.md

Co-authored-by: wookie184 <wookie1840@gmail.com>
…/putting-python-on-path.md

Co-authored-by: wookie184 <wookie1840@gmail.com>
@discretegames
Copy link
Author

One thing I wanted to be sure to resolve is whether or not the yellow downloads button on https://www.python.org/downloads/ really does download the best version the suits the computer, since I said it did in the "Recommended Installed" tutorial:

Go to python.org/downloads and click the big yellow "Download Python 3.x.x" button near the top of the page. That should start the download of the latest Windows Python installer that best suits your computer.

On Win 10 64-bit and Linux (what I'm able to test) it seems to, but I haven't been able to make sure the button downloads the 32-bit installer on a 32-bit machine. (And couldn't find code for the OS check in the pythondotorg repo.)

@wookie184
Copy link
Contributor

One thing I wanted to be sure to resolve is whether or not the yellow downloads button on https://www.python.org/downloads/ really does download the best version the suits the computer, since I said it did in the "Recommended Installed" tutorial:

Go to python.org/downloads and click the big yellow "Download Python 3.x.x" button near the top of the page. That should start the download of the latest Windows Python installer that best suits your computer.

On Win 10 64-bit and Linux (what I'm able to test) it seems to, but I haven't been able to make sure the button downloads the 32-bit installer on a 32-bit machine. (And couldn't find code for the OS check in the pythondotorg repo.)

It seems to send this HTML with downloads for each OS

<div class="download-for-current-os">
    <div class="download-os-macos" style="display: none;">
        <h1 class="call-to-action">Download the latest version for macOS</h1>
        <p class="download-buttons">
            <a class="button" href="https://www.python.org/ftp/python/3.11.0/python-3.11.0-macos11.pkg">Download Python 3.11.0</a>
        </p>
    </div>
    <div class="download-os-source" style="display: none;">
        <h1 class="call-to-action">Download the latest source release</h1>
        <p class="download-buttons">
            <a class="button" href="https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz">Download Python 3.11.0</a>
        </p>
    </div>
    <div class="download-os-windows" style="display: none;">
        <h1 class="call-to-action">Download the latest version for Windows</h1>
        <p class="download-buttons">
            <a class="button" href="https://www.python.org/ftp/python/3.11.0/python-3.11.0-amd64.exe">Download Python 3.11.0</a>
        </p>
    </div>
    <div class="download-unknown">
        <h1 class="call-to-action">Download the latest version of Python</h1>
        <p class="download-buttons">
            <a class="button" href="/downloads/release/python-3110/">Download Python 3.11.0</a>
        </p>
    </div>

And then use JS to hide/show the relevant ones.

            $.get("/box/supernav-python-downloads/",
                function(data){
                 $('li#downloads .subnav').append( data );
                    /* Toggle Download buttons by OS detection */
                    if (navigator.appVersion.indexOf("Win")!=-1) {
                        $('.download-unknown').hide();
                        $('.download-os-windows').show();
                    }
                    if (navigator.appVersion.indexOf("Mac")!=-1) {
                        $('.download-unknown').hide();
                        $('.download-os-macos').show();
                    }
                    if (navigator.appVersion.indexOf("X11")!=-1) {
                        $('.download-unknown').hide();
                        $('.download-os-source').show();
                    }
                    if (navigator.appVersion.indexOf("Linux")!=-1) {
                        $('.download-unknown').hide();
                        $('.download-os-source').show();
                    }
                }, "html");

So it seems it doesn't check for 32bit systems and would give the 64bit version either way. I think 32bit should be fairly uncommon now so it shouldn't be a massive problem as long as it's mentioned somewhere.

@discretegames
Copy link
Author

Thanks for finding that OS check code. Weird they don't check for 32-bit since it is possible. But oh well, I mention to go the the releases page on 32-bit.

@wookie184
Copy link
Contributor

Will merge into my branch now since we'll need 2 approvals on my PR before merging to main anyway, thanks again!

@wookie184 wookie184 merged commit 5641448 into python-discord:add-windows-guide Nov 17, 2022
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

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy