Custom Search

Sunday, July 30, 2017

How To Set Up Jupyter Notebook for Python 3

1)
$ sudo apt-get install python3-pip python3-dev

2)
$ pip3 install -U jupyter

3)
List all installed kernelspec
$ jupyter kernelspec list

Install kernelspec for python 3
$ sudo python3 -m ipykernel install

Uninstall python 3 kernelspec
$ sudo ipython kernelspec uninstall python3

4)
$ jupyter notebook

Monday, July 24, 2017

Openstack How to do doc8 scan

1)
Got your project folder (cloned from github)

2)
$ tox -v -epep8

3)
$ source .tox/pep8/bin/activate

4)
$ doc8 -e .rst doc/source/

* .rst means scan only *.rst files


OpenStack Creating release notes with Reno

https://docs.openstack.org/reno/latest/user/usage.html

1)
https://docs.openstack.org/reno/latest/install/index.html
$ pip install reno

2)
The reno command line tool is used to create a new release note file in the correct format and with a unique name.

$ tox reno new my-new-release1

By default, the new note is created under ./releasenotes/notes.

OR

$ tox -e venv -- reno new my-new-release1
$ source .tox/venv/bin/activate

3)

Sunday, July 9, 2017

golang How to Install and Setup Jupyter notebook

1)
Download Go compiler from https://golang.org/dl/

2)
Extract it ($HOME/gocompiler/)

3)
Create a new directory for your go project ($HOME/golexamples/myproject1)

4)
Add the following lines to your $HOME/.bashrc

export GOROOT=$HOME/gocompiler/go
export PATH=$GOROOT/bin:$PATH

export GOPATH=$HOME/golexamples/myproject1
export PATH=$GOPATH/bin:$PATH



5)
$go help

6)
#we need pip >= 9
pip —version

7)
sudo pip install —upgrade pip

8)
pip —version

i)
sudo pip install jupyter

9)
#Run server
jupyter notebook

10)
Install goimports
go get golang.org/x/tools/cmd/goimports

11)
sudo apt-get install libzmq3-dev

12)
Install golang kernel
go get -tags zmq_4_x github.com/gopherds/gophernotes

Ref:
https://github.com/gopherdata/gophernotes

13)
Create a directory for the new kernel config:
mkdir -p ~/.local/share/jupyter/kernels/gophernotes

14)
Copy the kernel config into the .ipython directory:
cp -r $GOPATH/src/github.com/gopherds/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes

15)
Start the jupyter notebook:
jupyter notebook

16)
Then, select “Golang” from the “New” drop down menu

17)
import "fmt"
world := "world"
fmt.Sprintf("Hello %s", world)