5 ms·
Using jupyter notebooks with a virtual environment
- lukasm 9y agoNice. Here is my starter https://gist.github.com/lukasz-madon/ecf5813fddbbee7a261151d5634778c6 https://gist.github.com/lukasz-madon/ecf5813fddbbee7a261151d...
- acosmism 9y agohere is a hosted playable version of your starter notebook (on gryd) https://beta.gryd.us/notebook/published/gryd/notebook-starter.ipynb https://beta.gryd.us/notebook/published/gryd/notebook-starte...
- itodd 9y agoThanks for this. I've been running separate instances of jupyter on different ports. This is more elegant.
- colcarroll 9y agoI've also got a small CLI on PyPI to do the same: https://pypi.python.org/pypi/callisto https://pypi.python.org/pypi/callisto
- iandanforth 9y agoI encourage the OP and readers to also try pipenv. From the author of Requests it is like a breath of fresh air and gets the combination of pip and virtual environments just right. https://docs.pipenv.org/ https://docs.pipenv.org/
- mcintyre1994 9y agoThis looks amazing, thanks for sharing! I wish Kenneth Reitz designed the interface for everything I use :)
- iicc 9y agohttps://saythanks.io/to/kennethreitz https://saythanks.io/to/kennethreitz
- angelobasile 9y agoFantastic! Thanks.
- batat 9y agoLooks awesome, but requirements.txt still seems pretty sufficient for me. Simple is better than complex :)
- iandanforth 9y agoMoving away from requirements.txt is only warranted when you are also trying to use virtual env. This passes my "simple is better" test by reducing two tools into a unified one that works.
- stuaxo 9y agoI use virtualenvwrapper with my notebooks.
- gjlawran 9y agoAlso consider using Conda - to replace and simplify use of venv and pip. http://stuarteberg.github.io/conda-docs/_downloads/conda-pip-virtualenv-translator.html http://stuarteberg.github.io/conda-docs/_downloads/conda-pip...
- monkmartinez 9y agoI agree 1000%! I honestly could not imagine using Jupyter without a virtual env. I don't worry about anything related to Python / virtual envs since I started using the Anaconda distribution. Further, every sciency tool is at my fingertips with almost ZERO configuration on my part... If I had to vote on: "There should be one-- and preferably only one --obvious way to do it." for Python dev, I would choose Conda so hard.
- bocklund 9y agoHow do you develop new packages? I think conda-build develop is not maintained
- msarahan 9y agothe develop command in conda-build is indeed not really kept up. From https://github.com/conda/conda-build/issues/1992#issuecomment-322588270 https://github.com/conda/conda-build/issues/1992#issuecommen... : Instead, I recommend creating whatever environment you want, activating it, and then running python setup.py develop or pip install -e . so that your package is installed in develop mode in that environment.
- brootstrap 9y agoThanks for the writeup , and others for interesting suggestions. Always on the look out for people thinking about making scientific python more reproducible and accessible! For myself, i just activate the venv and then open a notebook in that terminal and it seems to work? never had to install any other libraries to handle the VENV + notebook combo.
- deleted 9y ago[deleted]