News for hackers. Stuff that matters.
Re:JupyterLab 3.0 by pavlov on Tuesday January 05, 2021 @03:04PM (#25650298)
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, but it couldn't find any dependencies for the notebook. As a complete newbie to the Python ecosystem, I googled for instructions and found various environment managers, which then failed possibly because something is incompatible with Big Sur. More googling revealed instructions with complex CFLAGS environment setups to fix it, which didn't — and at that point it was very far from the supposed convenience of scripting languages anyway.

I don't think it's Python's fault. Probably all the programming toolchains are this hard to a newbie! But it was a humbling experience after 34 years of programming, not being able to load a piece of sample code in a Sunday afternoon.

Re:JupyterLab 3.0 by ben509 on Tuesday January 05, 2021 @09:16PM (#25654015)
> 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
    # Now jupyter has an independent virtualenv.
    # To install dependencies:
    pipx inject jupyterlab numpy
    # Where is everything?
    pipx list
    venvs are in /Users/ben/.local/pipx/venvs
    apps are exposed on your $PATH at /Users/ben/.local/bin
    ...
Once you've done that, never install anything directly with pip3 again. If you're working on a project, use pipx to install poetry / dephell / pipenv and use them to manage the virtualenv.

And you can get rid of it all:

    pipx uninstall-all
    python3 -m pip uninstall pipx
Re:JupyterLab 3.0 by ImaCake on Tuesday January 05, 2021 @10:10PM (#25654313)
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.

Re:JupyterLab 3.0 by ben509 on Tuesday January 05, 2021 @11:06PM (#25654568)
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 by xapata on Wednesday January 06, 2021 @12:47AM (#25654965)
Conda works fine with Pip/PyPI.
Re:JupyterLab 3.0 by mikecoles on Wednesday January 06, 2021 @11:47AM (#25659379)
Interesting coincidence: I'm currently side-watching a Youtube video about poetry.

The video discusses python packaging in general. You have to skip through several minutes of pre-roll though. https://www.youtube.com/watch?v=tNlurLxcf68&feature=emb_logo

Re:JupyterLab 3.0 by atg_abhishek on Tuesday January 05, 2021 @10:51PM (#25654493)
Yup this is a good way to go around it, similar to another comment below, I use conda to manage all the stuff
Re:JupyterLab 3.0 by specialist on Wednesday January 06, 2021 @12:00PM (#25659558)
As someone who has done driveby python work, how would I even know how to do that? Noob me found all sorts of howtos and getting started guides. Seemingly contradictory, mutual exclusive.

My (extended) team couldn't even get all the Pythonistas to agree on The One True Python Stack™.

Re:JupyterLab 3.0 by ben509 on Friday January 08, 2021 @01:08PM (#25687679)
Following Python and Java is always informative because, between them, they manage to make almost every mistake imaginable, despite having very smart people putting careful thought into the design.

Looking at the amount of polish on the Python docs and the fact that people still don't know how to install Python, it gives you a sense of how hard explaining things is. Maybe the Python site could do with an official "managing Python for end-users."

> Noob me found all sorts of howtos and getting started guides. Seemingly contradictory, mutual exclusive.

Python's a victim of its own success as the signal to noise ratio in online tutorials is very low; worse, the good management tools are relatively new.

Even for smaller audiences, obsolescence is a big problem. The most painful aspect of working with LaTeX was I'd struggle with one buggy package recommended by a tutorial for ages, then search for "why am I getting this error" and find the answer was, "oh, yeah, that's horribly broken, use this one instead."

[1]: https://www.python.org/doc/sunset-python-2/ [2]: https://www.python.org/doc/versions/

Re:JupyterLab 3.0 by disgruntledphd2 on Wednesday January 06, 2021 @12:34PM (#25660002)
You don't. It's a total nightmare for newbies.

I ended up putting off learning Python for years as this kind of stuff kept happening (first the 2/3 transition, and then massive pip breakage).

Re:JupyterLab 3.0 by neumann on Wednesday January 06, 2021 @02:40AM (#25655470)
Thank you! I've been using virtualenv+pip, conda+pip and a few other virtualenv wrappers lately, and never heard of pipx!
Re:JupyterLab 3.0 by typomatic on Tuesday January 05, 2021 @03:34PM (#25650660)
I have used Python on OSX for years and it is and always will be a horrorshow. Using the system Python installation is a nonstarter for many reasons, chief among them is that I don't have any interest in using py2. So then you're using pyenv or homebrew, but your vim install still thinks that it should be using the system python. And whoops, you fixed that and now virtualenv is not finding your interpreter. And etc., etc.

OSX and its tooling are just ridiculous. I have no idea to this day how macs became the premier development environment.

As always xkcd has a comic for it: https://xkcd.com/1987/

Re:JupyterLab 3.0 by coldtea on Tuesday January 05, 2021 @06:20PM (#25652637)
>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 tinkering and procrastinating available in Linux to get things "just right"

(d) because it's still a UNIX with a full support for unicy tools, not a hack like WSL or WSL2.

(e) because it has good hardware (mostly - BS keyboard-era aside) and good resale value

(f) because you get to enjoy most/all the proprietary tools you like too (from MS Office and Adobe Creative Suite, to whatever)

(g) because in 2020 Docker, remote environments, etc, make many "local dev environment" points moot anyway

Re:JupyterLab 3.0 by ohazi on Tuesday January 05, 2021 @09:25PM (#25654057)
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 what initially got developers to move to Mac. But it's been fifteen years, and all jokes aside, the "year of the Linux desktop" for developers was probably around 2012. Linux may still have issues, but they're not worse than the hoops you have to jump through to make today's macOS behave.

Trendy tech companies are still buying macbook pros for their employees because that's what's been trendy for the last decade, not because they actually ask new hires what they prefer. Practical tech companies do, and at places like that you usually see a mix of macs and thinkpads.

Re:JupyterLab 3.0 by coldtea on Tuesday January 05, 2021 @11:24PM (#25654651)
>(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 what initially got developers to move to Mac. But it's been fifteen years, and all jokes aside, the "year of the Linux desktop" for developers was probably around 2012. Linux may still have issues, but they're not worse than the hoops you have to jump through to make today's macOS behave.

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 <name of another distro>" 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 by ImaCake on Tuesday January 05, 2021 @10:16PM (#25654347)
>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 what initially got developers to move to Mac. But it's been fifteen years

My anecdata for this is that I bought a MacBook in 2020 for precisely this reason. I am not a programmer, mostly my use case is bioinformatics and processing large datasets. Native terminal is better than WSL (although WSL is good now) and macOS is much more reliable than linux ever has been for me.

Re:JupyterLab 3.0 by krona on Tuesday January 05, 2021 @07:50PM (#25653465)
b and g are mutually exclusive, though?
Re:JupyterLab 3.0 by coldtea on Tuesday January 05, 2021 @08:01PM (#25653546)
Not in any logical sense (e.g. violating any Logic rule). They just cover different use cases.

(b) makes the "macOS is particularly bad for development because I found Jupyter/Python deps difficult there" argument moot, as messed up Python dependencies are the case in Windows and Linux as well.

And (g) says that Docker and co has superceded manually setting up Python environments for many (not necessarily all or even most) devs, mitigating concerns about managing multiple local versions different deps/libs/language versions to work with different projects (since you can now do that in different, isolated, virtual environments which are mini-OSes in themselves).

So (b) basically amounts to: "It's not macOS which is makes Python deps shitty, they are inherently shitty".

And (g) basically amounts to: "Since Docker and co make local development dep issues mostly obsolete, even if macOS was bad at local deps, it wouldn't matter as much today anyway as virtualization levels the field".

And of course, with the field levelled by (g), if you go for virtualized dev envrironments, you still get all the other benefits like e, f, c, and d.

Re:JupyterLab 3.0 by jackson1442 on Tuesday January 05, 2021 @04:11PM (#25651108)
> I have no idea to this day how macs became the premier development environment.

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.

Granted, geospatial Python is somewhat of a mess, but a lot of tools I have to use are somewhat messy forks of Unix tools (looking at you, pyenv-win) with tons of incompatible extensions. For development, Windows is the exception because you can transfer just about anything from Linux to macOS.

On my Mac, I can easily install all of the Python packages I need without needing to install Visual Studio, pipwin, anaconda, etc. I have bash/zsh as my default system shell. Maybe it's easier to native Windows users, but bash/brew is a much better combination than anything I've found in Windows.

WSL is a step in the right direction, but it still feels secondary. If a first-class terminal experience existed on Windows, I have a strong feeling that it could be the premier development environment, or at least closer to Mac.

Maybe I'm using it wrong, but it definitely hasn't been made clear on how to use it right.

Re:JupyterLab 3.0 by sangnoir on Tuesday January 05, 2021 @05:37PM (#25652196)
> 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 random annoyances that remind you you are using inferior, non-GNU utilities:

  $ ls my_dir -l
  ls: -l: No such directory
Really - Mac OS? I know its minor, but that's just user-hostile and it happens every few weeks; I can't get over it.
Re:JupyterLab 3.0 by coldtea on Tuesday January 05, 2021 @06:22PM (#25652657)
>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 by mkl on Wednesday January 06, 2021 @01:39AM (#25655199)
What do you do if you want to add extra arguments when your cursor's at the end? Navigate back near (not to) the beginning? I usually just put them at the end, as almost every program I've used supports it. I add extra arguments after running commands constantly; after pressing up to get it back, you're at the end.
Re:JupyterLab 3.0 by coldtea on Wednesday January 06, 2021 @09:26AM (#25658000)
>What do you do if you want to add extra arguments when your cursor's at the end? Navigate back near (not to) the beginning?

Yes. In most shells it's trivial to go back by a word (e.g. skip in front of the path with one shortcut).

That said, this happens so rare that it's not even something that ever registered with me as a problem. I know what arguments I want for ls. And if I don't it's usually some bizarro infrequent flag that I have to look up how it's used anyway.

And other programs where it would be actually useful don't allow it anyway (having flags after the "main" argument). Git, for one.

Re:JupyterLab 3.0 by sangnoir on Wednesday January 06, 2021 @05:10PM (#25663317)
> Well, you can switch to another ls in 10 seconds by "brew install gnutools" or some such.

I did - but I never remember to type "gls" instead of "ls" - if I were that mindful, I'd always put in the flags at the start, where the BSD utils expect them. As sibling comment noted, trailing flags usually happens when I run a command and decide to amend the flags by up-arrowing and typing. A typical result is "ls -al my_dir -tr" when I realize I want to sort by mod date, post-facto.

I've been using GNU utils 95% of the time I've used Unix(-like) systems: I expect "ls -al my_dir -tr" to work: it's 2021 - recognizing flags isn't rocket science.

Re:JupyterLab 3.0 by analog31 on Tuesday January 05, 2021 @05:17PM (#25651963)
>>>> 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.

I've been using WinPython for a few years. It's the closest thing to "just works" that I've found, and non-programming colleagues have been able to install it successfully.

Because it works almost like an isolated "container," it's also possible to test your code on a clean install of WinPython to make sure it will run on someone else's computer before you share it.

I don't know the technical difference between WinPython and a true container, but you can have multiple WinPython installs on one machine, and they don't interfere with one another, or with a pre-existing mainstream Python installation on the same PC. So you can share your stuff without worrying about screwing up someone else's stuff.

Re:JupyterLab 3.0 by jackson1442 on Thursday January 07, 2021 @03:20AM (#25668602)
Good to know, thank you!
Re:JupyterLab 3.0 by sooheon on Tuesday January 05, 2021 @09:13PM (#25653999)
> I have no idea to this day how macs became the premier development environment.

    s/macs/python
    s/development environment/scripting language
Re:JupyterLab 3.0 by paozac on Tuesday January 05, 2021 @03:29PM (#25650593)
True. I like Python, but the ecosystem can be very confusing for a quick dive. It's easy to get lost between pyenv, virtualenv, pipenv, pip, pip3, easy_install and friends.
Re:JupyterLab 3.0 by fwip on Tuesday January 05, 2021 @03:58PM (#25650934)
Very true - further evidenced by the five or six different approaches your sibling comments are recommending.
Re:JupyterLab 3.0 by zsellera on Wednesday January 06, 2021 @01:13AM (#25655067)
Don't even try. Use docker, there are official pre-built images. It's easy:

  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 by fulafel on Wednesday January 06, 2021 @06:41AM (#25656817)
PSA: Don't use docker run -p xxx:xxx lightly. Even (or especially!) not in examples and documentation. It will listen to connections from anywhere in the internet and go out of its way to manipulate firewall rules on your machine to make a hole for it.

Instead, use: docker run -p 127.0.0.1:8888:8888

Re:JupyterLab 3.0 by kristjansson on Tuesday January 05, 2021 @06:06PM (#25652497)
At the risk of contributing my own probably-subtly-broken advice to the collection already present in this thread, I would note that there is a relatively sane system python3 on Catalina/Big Sur, and most projects are building and distributing compatible wheels [1] (binary packages). So something like:

    /usr/bin/python3 -m venv ./venv # create a virtual environment in ./venv
    ./venv/bin/pip install wheel # optional
    ./venv/bin/pip install dep1 dep2 dep3 ...
    ./venv/bin/python ... # up and running
is enough to get started in most cases. Of course, all bets are off for GPU or Apple Silicon support...

[1]: https://pythonwheels.com/

Re:JupyterLab 3.0 by zelphirkalt on Tuesday January 05, 2021 @05:58PM (#25652405)
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 pains and are more difficult to use or get working (pipenv, poetry).

If you are in luck, your required libraries and appropriate versions are available as GNU Guix packages and you can use that.

Re:JupyterLab 3.0 by tgbugs on Tuesday January 05, 2021 @07:01PM (#25653068)
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 the Gentoo python ecosystem was having a rough time dealing with the 2/3 transition and there was no minimal amount of work that could be done to get the jupyter server up and running.

As for the reason why this still hasn't happened? I'm guessing because it is because the people who care about reproducibility have found other ways to achieve it, and as a result have no need nor incentive to implement it as part of the notebook format. Also because, if someone is running notebooks at all they know enough to bootstrap the jupyter server, which is non-trivial, or they are using a managed environment (be it remote, conda, etc.) where they are blissfully unaware that all their code has massive implicit and undocumented context.

In the mean time I have implemented the start of an equivalent system for org files because the implicit environment is much worse given normal Emacs workflows. I have encountered some significant issues and considerations which the notebook ecosystem would have to deal with, and which the default python packaging ecosystem (or any ghettoized language specific packaging solution for that matter) is not equipped to handle.

The primary issues is that only language agnostic package managers can actually bootstrap the environment that is required. What do you do if someone doesn't have a toolchain to build numpy and they are on some strange arch where there are no wheels? Do you just fail? The 80% solution here is the one we have with conda or managed solutions. The 90% solution requires that all the language communities stop pretending that they are the only language in the world and stop wasting time on their bespoke package manager.

Re:JupyterLab 3.0 by Galanwe on Tuesday January 05, 2021 @11:46PM (#25654741)
> 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.

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 by zelphirkalt on Wednesday January 06, 2021 @04:14AM (#25655988)
I agree on some of your points. I just want to add:

Then comes the point, where one of your dependencies in conda simply wont install on the machine of your coworker or a windows machine of another coworker, or in your docker image and you are screwed, scrambling for the next package manager. Been there, experienced that.

I can only recommend to people not to go that route and to not get into trying to get the same environment on windows. A lot of headaches. It will be simpler to tell people to use another OS, if they want to use the same environment. Ultimately I ended up providing a virtual machine.

A managed solution -- Yes, this takes a lot of load off of the shoulders of people, who would like to actually get productive in other ways.

Re:JupyterLab 3.0 by philsnow on Tuesday January 05, 2021 @06:23PM (#25652672)
> Python environment tools and package managers are still in a state of flux

They've pretty much always been a moving target, haven't they? Nothing has ever been good enough that the community agrees "okay, this is it, we can stop churning on this tooling for a while".

Re:JupyterLab 3.0 by zelphirkalt on Wednesday January 06, 2021 @05:18AM (#25656339)
Probably because the typical culprits are really not good enough. I mean, follow the package manager repos on Github (pipenv for example) for a while. They have loads of issues, which one would think are unthinkable for a package manager to have. There are regressions and sometimes environments that were created just fine in an older version, is not creatable any longer, even though all the specification is, is a bunch of package names and version numbers, which do actually exist.

Probably testing package managers is not a simple thing to do.

Re:JupyterLab 3.0 by yshvrdhn on Tuesday January 05, 2021 @03:12PM (#25650390)
can look into google colab to directly load the notebook. Link : https://colab.research.google.com/
Re:JupyterLab 3.0 by baldfat on Tuesday January 05, 2021 @04:50PM (#25651638)
Python is AMAZING and Awesome TILL You want to spread what you are doing to more then one computer. Though I have to say I love domain specific languages and personal enjoy Racket as my most fun language to use. It is sad that this has gotten so much worse over the years.
Re:JupyterLab 3.0 by philsnow on Tuesday January 05, 2021 @06:26PM (#25652714)
re:re:re:

  A: it works on my computer
  B: then we'll ship your computer
  and that's how docker was born
Re:JupyterLab 3.0 by auchtopus on Tuesday January 05, 2021 @07:16PM (#25653197)
What do you enjoy about racket?

I used it for a semester in college, and it was next to unbearable. I can appreciate it as a fun little functional programming gimmick, but nothing more than that.

Re:JupyterLab 3.0 by baldfat on Tuesday January 05, 2021 @09:31PM (#25654086)
I just love Lisp and you pretty much have a fun small language you can fit in my small brain with Racket. The biggest issue is the libraries. Everyone writes their own specific libraries for their problems, because its easy and fun.

I could have done it in Python but portability was always the issue.

At my former job I had to make charts from pictures with English and Spanish lettering. Took me 30 minutes to have a working client that got installed in a dozen computers that afternoon.

I needed to also re-structure the companies file system for every computer in our company.

Personally I worked in audio video contract work from time to time and I was able to make a dozen short cut programs that actually saved my biscuit several times. I could have done it in python but the portability kicked my butt. Racket made executables super easy.

Also I went through How to Design Programs and I learned a ton.

Re:JupyterLab 3.0 by vmchale on Tuesday January 05, 2021 @04:05PM (#25651041)
> I don't think it's Python's fault. Probably all the programming toolchains are this hard to a newbie!

Python is a little worse in that in pushes its dirtiness downstream to your users too.

Re:JupyterLab 3.0 by flaviocopes on Tuesday January 05, 2021 @04:02PM (#25650997)
Not sure about the Jupyter-specific issues but macOS comes with Python 2 installed, so you have to install Python separately and use the `python3` binary, or alias `python` to the `python3` binary.

Then remember to run pip using `python3 -m pip <command>` and use virtual environments (venv)

I stumbled on this a couple weeks ago and documented the process here https://flaviocopes.com/python-installation-macos/

I found the same problem with Ruby (old version preinstalled on macOS)

Re:JupyterLab 3.0 by bitanarch on Tuesday January 05, 2021 @03:38PM (#25650704)
You should use Anaconda instead of pip to install data science related tools in Python.

```

$ conda create -n {new_environment_name} python

$ conda activate {new environment name}

$ conda install jupyterlab

```

Re:JupyterLab 3.0 by modriano on Tuesday January 05, 2021 @03:56PM (#25650915)
You also have to manually add the kernel for that environment via:

({new_environment_name}) ...$ python -m ipykernel install --user --name {new_environment_name} --display-name "Python ({new environment display name})"

The env won't be accessible in jupyter (lab or notebook) until you do this step.

[0] https://stackoverflow.com/questions/39604271/conda-environme...

Re:JupyterLab 3.0 by tmvphil on Tuesday January 05, 2021 @07:50PM (#25653462)
Nope, what he wrote works just fine at least for conda. That advice is only if you want to be able to choose environments as kernels in the frontend. If you just run jupyter lab/notebook in a conda env which has it installed, the default kernel will be in the activated environment.
Re:JupyterLab 3.0 by auxym on Tuesday January 05, 2021 @09:27PM (#25654064)
Note that you now have to pay for a commercial anaconda license if you're using it for anything that isn't education or hobbyist stuff.

https://www.anaconda.com/blog/anaconda-commercial-edition-fa...

Re:JupyterLab 3.0 by hcrisp on Tuesday January 05, 2021 @09:50PM (#25654199)
I don't think that is true if you install miniconda.

https://docs.conda.io/en/latest/miniconda.html

Re:JupyterLab 3.0 by p1esk on Tuesday January 05, 2021 @08:28PM (#25653718)

    conda install -c conda-forge jupyterlab=3
Re:JupyterLab 3.0 by eggie5 on Tuesday January 05, 2021 @08:48PM (#25653857)
why?
Re:JupyterLab 3.0 by getpost on Tuesday January 05, 2021 @08:02PM (#25653557)
I'm in the same boat. That's why I use repl.it[0] for nearly all my programming now. Haven't tried jupyter on repl.it, but here's[1] the first DDG result, which suggests jupyter is supported.

[0] https://repl.it/ [1] https://repl.it/talk/templates/Jupyter-Notebook/49993

Re:JupyterLab 3.0 by pm90 on Tuesday January 05, 2021 @07:10PM (#25653148)
Funny. I wanted to try this so I just ran the docker image and it worked. Time spent: 2 mins.

docker run -p 8888:8888 jupyter/scipy-notebook

Re:JupyterLab 3.0 by specialist on Wednesday January 06, 2021 @11:55AM (#25659502)
Had same experience.

Hoping to help clear some backlog, I tried to help with some ML & data pipeline house cleaning. Had never used Python before, but how hard could it be? OMG. One really doesn't appreciate ease and simplicity of multiple simultaneous JDK installs, all peacefully coexisting, until working on some python and nodejs projects.

Just running user space dev env via Docker was recently front paged here on HN. I believe that will become the norm.

Being a macOS user, I looked to see if there was something more lightweight. Like maybe a port of podman. Lighter than running a virtual Linux instance.

Again as a macOS user, I feel like I'm overdue to embrace the remote dev desktop set up. I've read that Googlers don't do any work locally; they all remote shell into servers running the tool stack. So very X Windows; what is old is new again.

Re:JupyterLab 3.0 by syntaxing on Tuesday January 05, 2021 @03:44PM (#25650763)
Always try using a virtual env. Also try using pip directly through ‘python3 -m pip install jupyter’ . Same to run it to bypass path issues ‘python3 -m jupyter notebook’. You should be up and running in a couple mins!
Re:JupyterLab 3.0 by pavlov on Tuesday January 05, 2021 @05:01PM (#25651767)
These were among the suggestions that I tried. I think the virtual env failed because of Big Sur, but not sure.
Re:JupyterLab 3.0 by syntaxing on Tuesday January 05, 2021 @08:30PM (#25653727)
Hmm that’s super weird, M1 or Intel CPU? Also where does ‘which python3’ point to?
Re:JupyterLab 3.0 by jonathanyc on Tuesday January 05, 2021 @08:27PM (#25653714)
I find that everything in Jupyter-land is as inconvenient to reproduce as it is convenient to experiment with. Case in point: last I checked, you still had to do gymnastics in order to even store your notebooks in Git in a meaningful way (e.g. allowing merges).

It really throws me off the whole thing (Julia + Jupyter is even worse...) because I’m not keen on putting effort into stuff that nobody, myself included, will be able to use in a year or two.

Re:JupyterLab 3.0 by ChrisRackauckas on Tuesday January 05, 2021 @08:38PM (#25653792)
For Julia you might as well use Pluto (https://github.com/fonsp/Pluto.jl) or an IDE.
Re:JupyterLab 3.0 by jonathanyc on Tuesday January 05, 2021 @08:47PM (#25653847)
Thanks, I’ll check those out! It’s hard to know what’s recommended by the community sometimes. I was using Julia + Jupyter through CoCalc which is great for collaborating but the non reproducibility aspect was starting to raise alarm bells for me.
Re:JupyterLab 3.0 by mynameisash on Tuesday January 05, 2021 @10:23PM (#25654383)
My most recent professional project involves - among other things - a Python API deployed to AKS. I'd used Python here and there for fun and on the periphery of work, but this was the first time I had to dive into it full-on.

While I know it has earned its praise for good reason -- as I'm sure all the data scientists I work with would attest to -- as an engineer, Python has been really frustrating to work with.

Re:JupyterLab 3.0 by WrtCdEvrydy on Tuesday January 05, 2021 @03:48PM (#25650802)
Yeah, I use portainer and then load a docker image of Jupiter and import the notebook there.

Dependency management hell isn't just a Javascript problem these days.

Re:JupyterLab 3.0 by turtlebits on Tuesday January 05, 2021 @03:26PM (#25650549)
Yeah I've had this issue in the past with Jupyter. Now I generally look for docker images when I want to check out something new.
Re:JupyterLab 3.0 by coldtea on Tuesday January 05, 2021 @06:15PM (#25652585)
>I don't think it's Python's fault.

Actually it is:

https://xkcd.com/1987/

That said, you would be up and running if you used conda.

And this is not the usual "just try distro X" Linux advocate BS when somebody has an issue with distro Y.

Conda does makes thing more user friendly by focusing on whole environments. Actually that's why it was built for.

Note that this applies for this situation. For other uses cases, e.g. deploying something to production, having used conda would have made your life more difficult.

Re:JupyterLab 3.0 by antpls on Tuesday January 05, 2021 @03:30PM (#25650618)
Not sure about Mac, but on Linux, you install some docker images and it just works (modulo some docker flags to learn if you don't already know docker)
Re:JupyterLab 3.0 by loopz on Wednesday January 06, 2021 @02:40AM (#25655467)
When following the docs, Go just works. It compiles fast, though not so dynamic as Ruby and Python. Tooling and runtime also matters in one's work.
Re:JupyterLab 3.0 by fastball on Tuesday January 05, 2021 @03:35PM (#25650662)
Re:JupyterLab 3.0 by deepsun on Tuesday January 05, 2021 @06:00PM (#25652438)
No problems on Linux. I use pyenv for managing python versions and virtualenvs.
Re:JupyterLab 3.0 by cwyers on Tuesday January 05, 2021 @06:57PM (#25653031)
That doesn't help you install the dependencies for a notebook, if you don't know what they are.
Re:JupyterLab 3.0 by unixhero on Tuesday January 05, 2021 @03:50PM (#25650823)
Re:JupyterLab 3.0 by knuthsat on Tuesday January 05, 2021 @06:41PM (#25652869)
virtualenv makes things a breeze