python (pyenv) installation memo
-Build Jupyter Lab with Docker
install matplotlib
$ pip install matplotlib
install jupyter
$ pip install jupyter
Port forwarding to access jupyter on vagrant from a PC browser.
$ vagrant ssh -- -L 8888:localhost:8888
Or add the following to the Vagrantfile
Vagrantfile
Vagrant.configure("2") do |config|
# *snip*
config.vm.network "forwarded_port", guest: 8888, host: 8888
# *snip*
end
--ip = 0.0.0.0
is required when accessing other than localhost.
$ jupyter notebook --no-browser --ip=0.0.0.0
Or
$ ipython notebook --no-browser --ip=0.0.0.0
http://localhost:8888 Or access with vagrant's IP address http://192.168.33.10:8888
Follow the pull-down menu on the upper right as follows New -> Python 3 Run sample code
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(-3, 3, 0.1)
y = np.sin(x)
plt.plot(x, y)
See here if you get an error related to No module named _tkinter
or tkinter
[If you use matplotlib, install the following first](http://qiita.com/Esfahan/items/0dfe70357549f92b23da#matplotlib%E4%BD%BF%E3%81%86%E3%81%AA%E3%82%89 % E4% B8% 8B% E8% A8% 98% E3% 82% 82% E5% 85% 88% E3% 81% AB% E3% 82% A4% E3% 83% B3% E3% 82% B9% E3 % 83% 88% E3% 83% BC% E3% 83% AB)
that's all
[reference] The story of building an ipython notebook environment with vagrant Launch ipython notebook with VM created with vagrant and access it locally What to do when the graph does not appear in the jupyter (ipython) notebook
Recommended Posts