Python install on Windows


  • mod

    I want to use mkdocs, so I need python. Okay, whatever.

    I download Python 3, the latest. Which doesn't claim to be supported by Mkdocs, whoops. Well I'll try it anyway.

    Problem one: The installer never removes text from the current step line, writing each line over the others until it's an unreadable mash of lines. I tried to snap a screenshot but failed before it finished. I got a screenshot when I uninstalled:

    Problem two: It didn't add itself anywhere that's on my path, or add itself to my path. I have to go manually add it.

    Problem three: pip isn't on my path after I add the python install directory. It's not in the same place? Weird. It came with python, right? Says it did...

    There's a script that adds the install directory for pip into your path! I run that. It succeeds! Pip still isn't in my path? WTF?

    Problem four: My path is now: C:\C:\Users\[me]\AppData\Local\Programs\Python\Launcher;C:\Users\[me]\AppData\Roaming\npm;C:\Users\[me]\AppData\Local\Programs\Python\Python35-32;C:\Users\[me]\AppData\Local\Programs\Python\Python35-32\Scripts;

    The actual install location? C:\Users[me]\AppData\Local\Programs\Python\Python35-32\Tools\scripts. IT'S CASE FUCKING SENSITIVEENTIRELY WRONG, ASSWIPES.

    Jesus.

    So I finally can run the install for mkdocs: pip install mkdocs.

    checking if libyaml is compilable
    error: [WinError 2] The system cannot find the file specified
    

    So this package manager can't even manage fucking dependencies? Okay, whatever, I'll install it myself:

    >pip install libyaml
    Collecting libyaml
      Could not find a version that satisfies the requirement libyaml (from versio
    : )
    No matching distribution found for libyaml
    

    Well fuck me.



  • @Yamikuronue said:

    C:\Users[me]</blockquote>

    Does your name start with a backslash? If that's not the case that structure sure is weird.


  • mod

    Editing error.haha I lied, it's fucking discomagic. The slash is totally there in the raw.



  • 😉
    I think there was a thread ↖↔⤴↔ way describing the horrors of python on windows



  • You need to escape slashes? Test \test \ test \test
    Thats weird.

    \test
    \\test
    \\\test
    

  • mod

    Why does Python 2.7 want to be in C:\Python27, what is this, 1998?



  • @Yamikuronue said:

    what is this, 1998?

    No, this is python


  • mod

    C:\Users\\[me]>python --version
    'python' is not recognized as an internal or external command,
    operable program or batch file.
    
    C:\Users\\[me]>pip --version
    Fatal error in launcher: Unable to create process using '"C:\Users\\[me]\AppDat
    a\Local\Programs\Python\Python35-32\python.exe"  "C:\Users\\[me]\AppData\Local\
    Programs\Python\Python35-32\Scripts\pip.exe" --version'
    

    WHY THE FUCK DID IT LEAVE PIP BEHIND WHEN IT UNINSTALLED.


  • mod

    So python 2.7 installed mkdocs just fine.



  • @Yamikuronue said:

    ```
    C:\Users\[me]>pyt

    
    In code tags you only need one. What the hell is the discocode for troll face? :trolleybus:
    Also did they just break quotes? - of course they did.

  • sockdevs

    :trollface: ;)



  • That does not autocomplete/suggest. :trollface:


  • sockdevs

    Yeah… custom emoji autocomplete was broken by the upgrade to beta 11



  • :facepalm: i see...



  • Python3 is something that exists but nobody ever uses. Just use Python 2.7 which is what everything seems to support instead.



  • Pretty bad buy in right there...



  • I personally like the 81% + 43% = 124%

    A bar chart like that is a horrible way to describe multiple option survey results.



  • I presume you've noticed that's the way discourse does it 😝



  • @RaceProUK said:

    Yeah… custom emoji autocomplete was broken by the upgrade to beta 11

    Oh, that's what did it. I noticed it broke, but didn't know why.



  • @Yamikuronue said:

    The actual install location? C:\Users[me]\AppData\Local\Programs\Python\Python35-32\Tools\scripts. IT'S CASE FUCKING SENSITIVE, ASSWIPES.

    Huh? Windows PATH is not case sensitive.

    C:\Users\[me]\AppData\Local\Programs\Python\Python35-32\Scripts
    C:\Users\[me]\AppData\Local\Programs\Python\Python35-32\Tools\scripts

    You changed the path. (tweaked backslashes for consistency)


  • mod

    So it is. So the script was just fucking wrong about where it lives.



  • I use ActivePython (2.7). It puts itself in the PATH properly :)



  • @delfinom said:

    Python3 is something that exists but nobody ever uses. Just use Python 2.7 which is what everything seems to support instead.

    3.4 only has a bit over half the usage of 2.7, but >50% for 3.x combined isn't "nobody." I suspect a lot of the 2.7 users would like to move to 3.x, but they're forced to stay on 2.7 by legacy applications.



  • @dcon said:

    I use ActivePython (2.7). It puts itself in the PATH properly :)

    But does it put itself in Program Files (or Program Files (x86)) properly, or does it still try to install in C:\Python27?



  • Python 3.5 is at the beta stage. I supposse it still has loads of bugs that need to be squashed. The latest version is really 3.4. I've been using it for a year without any major issues.



  • C:\Python27

    I guess I could safely install 3.x and play with that in that case as that is probably \Python3... (PATH settings aside.)



  • @Yamikuronue said:

    Problem four: My path is now: C:\C:\Users[me]\AppData\Local\Programs\Python\Launcher;C:\Users[me]\AppData\Roaming\npm;C:\Users[me]\AppData\Local\Programs\Python\Python35-32;C:\Users[me]\AppData\Local\Programs\Python\Python35-32\Scripts;

    The actual install location? C:\Users[me]\AppData\Local\Programs\Python\Python35-32\Tools\scripts. IT'S CASE FUCKING SENSITIVE, ASSWIPES.

    Case sensitive? That can't be right.

    Looks to me that they somehow missed the Tools directory in there:
    C:\Users\[me]\AppData\Local\Programs\Python\Python35-32\Scripts;
    vs
    C:\Users\[me]\AppData\Local\Programs\Python\Python35-32\Tools\scripts



  • @delfinom said:

    Python3 is something that exists but nobody ever uses.

    This drives me insane because Python 3.x is far superior.


  • sockdevs

    @Dogsworth said:

    @delfinom said:
    Python3 is something that exists but nobody ever uses.

    This drives me insane because Python 3.x is far superior.

    -shrug- it's better but it's no nodejs.

    <trolling


  • sockdevs

    @accalia said:

    nodejs

    Only crazy people enjoy Node :stuck_out_tongue:

    And I'm crazy


  • Discourse touched me in a no-no place

    @HardwareGeek said:

    But does it put itself in Program Files (or Program Files (x86)) properly, or does it still try to install in C:\Python27?

    Putting spaces in a filename is an invitation for (badly written) code to break later on in unexpected ways. It shouldn't matter, yet it does anyway. :facepalm:



  • @accalia said:

    it's better but it's no nodejs.

    I'd rather have Python (2 or 3) than the linguistic house of horrors that is JS...


  • sockdevs

    @tarunik said:

    linguistic house of horrors that is JS...

    HEY! don't let the fustercluck that is DOM scare you away from the beautiful language that is javascript! it's not javascript's fault it has the DOM to deal with on the browser!


  • Discourse touched me in a no-no place

    DOM is bad everywhere. But JS has its own special quirks that sometimes make you wonder WTF is going on. For example (and this is the one that makes me really upset), exactly what this is referring to can vary in unexpected ways. I find it hard to comprehend how that could possibly be interpreted as a good thing.



  • @dcon said:

    Huh? Windows PATH is not case sensitive.

    Somewhat off-topic, but I've recently discovered that somehow a Jenkins CI slave process running on Windows has case-sensitive file paths, even though Windows itself doesn't. :headdesk:


    Filed Under: Extra features nobody wanted.


  • sockdevs

    That's only because you're thinking of this from a class-based OO POV, where this is always the instance of a class. Since JS doesn't have classes (OK, ES6 has something called classes, but it's not quite the same), this has to rely on something else; IIRC, that something else determined by the function scope.


  • sockdevs

    @dkf said:

    For example (and this is the one that makes me really upset), exactly what this is referring to can vary in unexpected ways

    it's not that hard to follow if you grok prototypical inheritence. that really trips up people who are used to classical inheritence.



  • @dkf said:

    But JS has its own special quirks that sometimes make you wonder WTF is going on.

    null vs undefined, deficient datastructures, sloppy typing, the list could go on...



  • @mott555 said:

    Somewhat off-topic, but I've recently discovered that somehow a Jenkins CI slave process running on Windows has case-sensitive file paths, even though Windows itself doesn't.

    So it's doing some internal comparison or something?


  • Discourse touched me in a no-no place

    @accalia said:

    it's not that hard to follow if you grok prototypical inheritence.

    But that's the thing: I do grok prototypical inheritance. this should refer to the current context object, which might not be the object on which the method was declared, but which damn well ought to be on that or something derived (possibly indirectly) from it. That it doesn't (or at least doesn't appear to do so) is what really bothers me.

    I also don't like the way JS in browsers doesn't have any kind of proper modularization scheme, but that could be just a misfeature of browsers.


  • sockdevs

    @dkf said:

    I also don't like the way JS in browsers doesn't have any kind of proper modularization scheme, but that could be just a misfeature of browsers.

    That's a browser thing; node does a fairly decent job of modularising


  • sockdevs

    @dkf said:

    this should refer to the current context object

    well.

    the rules for this are fairly straight forward

    • If invoked via call() or apply() this is the value of the appropriate parameter
    • If invoked directly as part of a dot notation function (something.fn()) this is theobject before the teminating dot (something in this example)
    • else this is the outermost binding object for the code segment (window in browsers, module in nodejs)

    so

    something.fn.call(otherthing);
    

    will have this set to otherthing

    something.fn();
    

    will have this set to something

    var x = something.fn;
    x();
    

    will have this set to window



  • @accalia said:

    the beautiful language that is javascriptScheme!

    FTFY

    Everything good about Javascript it has in common with Scheme.

    Everything bad about Javascript it does not have in common with Scheme.

    Should have just made it Scheme.


  • sockdevs

    Hmm… seems I didn't have it quite right… TIL :smile:


  • sockdevs

    also if you want to force the value of this regardless of what anything else thinks there's always function.bind()



  • @accalia said:

    else this is the outermost binding object for the code segment (window in browsers, module in nodejs)
    This rule is the :wtf:. The other two are reasonably fine, though I think I prefer Python's explicit self parameters for languages that you can attach & detach functions from objects at will.

    (ES5 strict mode gets it right, because it will set this to undefined in this context. Or something like that; too lazy to look it up.)


  • sockdevs

    What else would you set it to for functions that aren't attached to an object?



  • @RaceProUK said:

    What else would you set it to for functions that aren't attached to an object?
    That's the point; there already is a JavaScript value for "no object". In fact there are two, and non-strict JS went with neither of them!

    I mean, I can sorta kinda vaguely see how you can get there, because if you say function foo() { ... } then the resulting function can be accessed from window.foo, so this being window makes a small bit of warped sense. But this is set to window even for things that isn't true for ((function() { return this; })() evaluates to window), and that takes it well into :wtf: territory IMO.



  • @mott555 said:

    Somewhat off-topic, but I've recently discovered that somehow a Jenkins CI slave process running on Windows has case-sensitive file paths, even though Windows itself doesn't.

    I don't even want to know... (We use Jenkins also. But I'm not the build master!!!)



  • There's also the "minor" issue that python creates files in its directory (pyc). Needing UAC to run python would be an even larger :wtf:


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.