News for hackers. Stuff that matters.
Re:Show HN: A modern Jupyter client for macOS by BaculumMeumEst on Sunday July 07, 2024 @04:11PM (#40900113)
Dude I just started getting into deep learning and have been flabbergasted getting stuff working. I installed jupyter and torch via homebrew, but when I try to use torch in a notebook it cannot find the module, whether I use a venv or not. I tried running !pip install torch but it's trying to use pip for some random system python that is apparently not the same as the Jupyter python. I am so confused as to how this works or what I am supposed to be doing.
Re:Show HN: A modern Jupyter client for macOS by nickvazz on Sunday July 07, 2024 @04:26PM (#40900203)
Hey, I used to run into the same issue and figured out installing conda, and utilizing its python was the easiest to keep things straight. Once you install conda and can activate your environment, then when using pip, don’t just call `pip install` because your path could be using a different pip than you expect. Instead use `python -m pip install` after activating your conda environment but make sure you’re using the right Python (`which python` & `conda env list`)
Re:Show HN: A modern Jupyter client for macOS by adammarples on Sunday July 07, 2024 @04:27PM (#40900213)
Python packaging etc can be a real pain point. I would suggest not using homebrew for these, in fact uninstall them. For jupiter/torch heavy work, I would install anaconda and then use that exclusively. Best of luck, it can be annoying but follow a good guide online you'll be OK.
Re:Show HN: A modern Jupyter client for macOS by jackhodkinson on Sunday July 07, 2024 @04:31PM (#40900240)
It can be confusing. The key is that you probably have multiple versions of python installed on your computer (that's normal). Secondly, the default "kernel" in Jupyter was probably not the one you used to install torch.

I'd suggest 2 things to help: 1. Try `pyenv` for python version management 2. See this tutorial for how to create a virtual environment and add it as a Jupyter kernel: https://selvamsubbiah.com/run-jupyter-notebook-in-a-virtual-...

Satyrn makes it easier to add virtual environments as a kernel, but you still will need to create the virtual environment and install torch there yourself.

That's a really great point you made about how confusing it is to pip install stuff with `!pip` when working in the notebook. Right now Satyrn does not support the `!` commands, but I will add this soon and try to make it so `!pip` works with the expected virtual environment you are working with.

Re:Show HN: A modern Jupyter client for macOS by threePointFive on Sunday July 07, 2024 @04:37PM (#40900287)
Jupyter and pytorch can be installed completely as python packages via pip thanks to the modern wheel distribution format. Because of that, I would generally not recommend using an external package manager for project dependencies. I prefer installing python via the Python.org downloads, then creating a dedicated virtual environment where I can pip install any packages. That way I known where all my dependencies are installed, and I can make seperate environments for different Python or library versions.
Re:Show HN: A modern Jupyter client for macOS by amelius on Sunday July 07, 2024 @05:26PM (#40900569)
Package management is a fundamentally hard problem, and it's not all technical.

Nowadays, before I try anything new, I mentally reserve one or two days for the inevitable problems with configuring, compiling and installing. Also, it happens regularly that the cost of trying something turns out to be too high, and I just move on to the next thing.

Of course, sometimes stuff works out of the box, but that is only in a small fraction of cases.

It is sad that it has come to this, and it makes me wonder how we'll cope in a future when software has even more layers of complexity.