I don't write Python code for my work. Last weekend I came across an interesting Jupiter notebook and figured I'd give it a try on my work laptop. "It's probably as easy as brew install pip and then use that to load the other dependencies," I assumed. Over an hour later I had to give up. There was initially some kind of Python version conflict on my Mac. Eventually some version of JupyterLab was installed somewhere,…
> I don't think it's Python's fault. Well, there's a long legacy of half-baked solutions and kludges. And, especially, install instructions consistently suggest you do the worst thing: install stuff using pip. Everyone knows that's bad advice, because it always fails in mysterious ways, and there's no good way to roll everything back. I recommend: python3 -m pip install pipx # Don't rely on the pip3 bin. pipx install…
JupyterLab 3.0
111–120 of 145 posts
Re: JupyterLab 3.0
#112Earlier quoted context omitted.
> I don't think it's Python's fault. Well, there's a long legacy of half-baked solutions and kludges. And, especially, install instructions consistently suggest you do the worst thing: install stuff using pip. Everyone knows that's bad advice, because it always fails in mysterious ways, and there's no good way to roll everything back. I recommend: python3 -m pip install pipx # Don't rely on the pip3 bin. pipx install…
I use conda to do effectively the same thing. If my conda environment breaks and I can't roll it back, at least I can destroy it and start again. As an aside; it is really hard to explain why you should use anything but pip3 to people who only rarely need to interact with python.
And I agree, it's hard to explain not using pip3, so I just wouldn't. "For the best experience, pipx install neato-commando." And maybe link to the pipx website, in case someone actually clicks a link.
Re: JupyterLab 3.0
#113Earlier quoted context omitted.
> OSX and its tooling are just ridiculous. I have no idea to this day how macs became the premier development environment. Because: (a) it's quite easy to set things up with brew, macports, and/or Nix (b) because Python is shitty everywhere anyway, and Python isn't the be-all end-all of development work. (c) because you get a full-featured, working, coherent, take-it-or-leave-it desktop that stops one way of endless…
I think it's more inertia than any of these things. The entire point of this thread is that (a) is false -- see grandparent and the xkcd joke. It's not easy. It pretends to be easy, but is usually broken in some crazy way instead. Apt is also easy, but it actually works more often than not. (c) was relevant in 2006, when the novelty of OS X was that it was a UNIX that you could actually use as a daily driver. This is…
I've used Linux for close to 20+ years, and Unices more, and never had to jump through any major hoops to make macOS behave.
What would those be (talking about something major, not "I can't get my favorite window manager to replace the macOS window management" -- the non-tinkering-friendliness is part of the allure to me and from what I read others too)?
On the other hand, Linux on the desktop never fails to dissapoint me in one way or another because of the need of tinkering, half-sketched apps for many things I want to do (especially anything multimedia and/or document related), driver issues to get things working (sound, compositor, 3D, bluetooth, sleep, etc), and so on. And judging from the everpresent "just use " in the relevent forums, it's not something others don't have.
Thus I prefer to stick to Linux on the server and Docker, or for setups where I have investigated the hardware in advance, and only mean to use basic things (e.g. happy with just some terminals, emacs/vim, i3, and some mp3 playing).
>not because they actually ask new hires what they prefer.
Those that do found that hires generally prefer Macs. That's how they have ~ 50% of the dev surveys on Stack Overflow whereas they're just 10% of the general market...
Re: JupyterLab 3.0
#114Earlier quoted context omitted.
In a better world, the notebook you downloaded should have come with a list of dependencies and have reproducible code in it. That said, Python environment tools and package managers are still in a state of flux. Some tools make it easier, but are not helping much with reproducibility (plain venv + pip, but only if you got all required system packages installed!), other tools enable reproducibility, but have growing…
I talked to Fernando about this at Neuroinformatics 2018. In principle generating dependencies from a notebook should be as easy as parsing the ast, finding all the import statements, and then using sys to lookup what package provided that module. In practice I stopped using notebooks entirely due to many of the issues described by pavlov above, though in my case it was mostly because it was at a point in time where…
Well not really.
First, there is no link between a distribution package name (what you install with pip) and python package name (what you import).
e.g. The distribution package "foobar" can install the python package "baz". Well, it's even worst than that. There could be name space packages so multiple distribution package actually install parts of a python package. And there could be monkey patching.
Second, Python is not a static language. The import system is part of the interpretation of python code, and as such, is dynamic.
You have absolutely 0 guarantee that "import foo" on two different environments, even if they have the same version of package foo, will produce the same results. There could be an infinite amount of magic done in foo's __init__ that depend on other libraries being installed, etc.
Third, don't get me started on the actual version of these libraries.
Re: JupyterLab 3.0
#115anyone still like classic notebooks better???
Re: JupyterLab 3.0
#116anyone still like classic notebooks better???
Re: JupyterLab 3.0
#117Earlier quoted context omitted.
I use conda to do effectively the same thing. If my conda environment breaks and I can't roll it back, at least I can destroy it and start again. As an aside; it is really hard to explain why you should use anything but pip3 to people who only rarely need to interact with python.
Conda is pretty nice, and unless someone needs pypi, that's fair advice. And I agree, it's hard to explain not using pip3, so I just wouldn't. "For the best experience, pipx install neato-commando." And maybe link to the pipx website, in case someone actually clicks a link.
Re: JupyterLab 3.0
#118I don't write Python code for my work. Last weekend I came across an interesting Jupiter notebook and figured I'd give it a try on my work laptop. "It's probably as easy as brew install pip and then use that to load the other dependencies," I assumed. Over an hour later I had to give up. There was initially some kind of Python version conflict on my Mac. Eventually some version of JupyterLab was installed somewhere,…
docker run -p 8888:8888 -v ~/Code/actual-project/:/home/jovyan jupyter/datascience-notebook
Note ~/Code/actual-project/ is a git repo or a mounted Google Drive folder. Moving from one machine to an other is pain-free.[1] https://jupyter-docker-stacks.readthedocs.io/en/latest/using...
Re: JupyterLab 3.0
#119Earlier quoted context omitted.
> I've been editing a tutorial one of my coworkers wrote that targets new Python users on Windows. From my findings, the grass is not greener. Maybe check the other other side (Linux) - I found the grass is greener there - at least for Python (and programming tools in general). I'm very comfortable on the command-line, and moving from a pure Linux environment to OS X & brew felt like a huge downgrade, followed by ran…
> followed by random annoyances that remind you you are using inferior, non-GNU utilities: Well, you can switch to another ls in 10 seconds by "brew install gnutools" or some such. Not to mention the same arguments could be made for FreeBSD, commercial unices, etc. Come to think of it, I've been using Unix (including Linux) for 25 years, and never even occured to me to expect "ls my_dir -l" to work.
Re: JupyterLab 3.0
#120Earlier quoted context omitted.
I've seen it crop up here and there. I've used it a few times and its really amazing how fast. Afaik it's a drop in replacement for conda using the same cli parse. Even has miniconda (micromamba).
Did you reply to the correct comment? I can't understand what you're referencing here.