在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):IHaskell/IHaskell开源软件地址(OpenSource Url):https://github.com/IHaskell/IHaskell开源编程语言(OpenSource Language):Jupyter Notebook 54.1%开源软件介绍(OpenSource Introduction):IHaskell
IHaskell is a kernel for the Jupyter project, which allows you to use Haskell inside Jupyter frontends (including the console and notebook). It currently supports GHC 8.0 through 9.0. For GHC 7.10 support please use the For a tour of some IHaskell features, check out the demo Notebook. More example notebooks are available on the wiki. The wiki also has more extensive documentation of IHaskell features. Interactive In-Browser NotebookInstallationLinuxSome prerequisites; adapt to your distribution. sudo apt-get install -y python3-pip git libtinfo-dev libzmq3-dev libcairo2-dev libpango1.0-dev libmagic-dev libblas-dev liblapack-dev Install These instructions assume you don't already have Stack or a Jupyter installation, please skip the relevant steps if this is not the case. curl -sSL https://get.haskellstack.org/ | sh
git clone https://github.com/gibiansky/IHaskell
cd IHaskell
pip3 install -r requirements.txt
stack install --fast
ihaskell install --stack Run Jupyter. stack exec jupyter -- notebook MacYou need to have Homebrew installed.
If you do not have it yet run You also need the Xcode command line tools.
You can install them by running These instructions assume you don't already have Stack or a Jupyter installation, please skip the relevant steps if this is not the case. brew install python3 zeromq libmagic cairo pkg-config haskell-stack pango
git clone https://github.com/gibiansky/IHaskell
cd IHaskell
pip3 install -r requirements.txt
stack install --fast
ihaskell install --stack If you have Homebrew installed to a location that Run Jupyter. stack exec jupyter -- notebook Tested on macOS Sierra (10.12.6) WindowsIHaskell does not support Windows, however it can be used on Windows 10 via Windows Subsystem for Linux (WSL). If WSL is not installed, follow the Installation Guide for Windows 10. The following assumes that Ubuntu is picked as the Linux distribution. In the Ubuntu app, follow the steps above for Linux. Jupyter Notebook is now ready to use. In the Ubuntu app, launch a Notebook Server, without opening the notebook in a browser: jupyter notebook --no-browser Returning to Windows 10, open a browser and copy and paste the URL output in the step above (the token will differ). Or copy and paste one of these URLs:
http://localhost:8888/?token=9ca8a725ddb1fdded176d9e0e675ba557ebb5fbef6c65fdf Tested on Windows 10 (build 18362.175) with Ubuntu 18.04 on WSL Alternatively, install Virtualbox, install Ubuntu or another Linux distribution, and proceed with the install instructions. DockerTo quickly run a Jupyter notebook with the IHaskell kernel, try the docker build -t ihaskell:latest .
docker run --rm -p 8888:8888 ihaskell:latest Or use the continuously updated Docker image on Docker Hub. docker run --rm -p 8888:8888 gibiansky/ihaskell In order to mount your own local files into the Docker container use following command: docker run --rm -p 8888:8888 -v "$PWD":/home/jovyan/src gibiansky/ihaskell Be aware that the directory you're mounting must contain
a resolver: lts-16.23
packages: [] It's recommended to use the same LTS version as the IHaskell image is using itself (as can be seen in its stack.yaml). This guarantees that stack doesn't have to first perform a lengthy installation of GHC before running your notebook. You can also use the following script to run IHaskell in Docker: https://gist.github.com/brandonchinn178/928d6137bfd17961b9584a8f96c18827 NixIf you have the $ nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-20.03.tar.gz release.nix --argstr compiler ghc865 --arg packages "haskellPackages: [ haskellPackages.lens ]"
<result path>
$ <result path>/bin/jupyter notebook It might take a while the first time, but subsequent builds will be much faster. You can use the https://ihaskell.cachix.org cache for prebuilt artifacts. The IHaskell display modules are not loaded by default and have to be specified as additional packages: $ nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-20.03.tar.gz release.nix --argstr compiler ghc865 --arg packages "haskellPackages: [ haskellPackages.ihaskell-blaze haskellPackages.ihaskell-charts ]" For more examples of using IHaskell with Nix, see https://github.com/vaibhavsagar/notebooks. DevelopingIHaskell is regularly updated to work with the latest version of GHC. To read how this is done, and how the development environment is set up, please see this blog post. Nix flakeThere is also a Nix flake that provides a developer environment. For details on Nix flakes, please see the documentation at https://nixos.wiki/wiki/Flakes. After this, IHaskell can be compiled as follows: nix develop # This opens a new shell with all dependencies installed
cabal update # Make sure Cabal's package index is up-to-date
cabal build # Builds IHaskell Note that this shell also provides TroubleshootingWhere are my packages? (IHaskell + Stack)Stack manages separate environments for every package. By default your notebooks
will only have access to a few packages that happen to be required for
IHaskell. To make packages available add them to the stack.yaml in the IHaskell
directory and run Packages should be added to the
The kernel keeps dying (IHaskell + Stack)The default instructions globally install IHaskell with support for only one
version of GHC. If you've e.g. installed an |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论