Comments (1)
The procedure to import third-party packages on Windows is somewhat tedious, and requires compiling gophernotes twice.
Here it is, in its full length:
- manually download gophernotes inside GOPATH, compile and install it.
The commands to enter at Windows command prompt (cmd) are:
set GOPATH=%USERPROFILE%\go
mkdir "%GOPATH%\src\github.com\gopherdata"
cd "%GOPATH%\src\github.com\gopherdata"
git clone https://github.com/gopherdata/gophernotes
cd gophernotes
go install .
You need to use these exact paths, because that's what gophernotes expects at step 4 below.
- configure jupyter notebook to find gophernotes as described at https://github.com/gopherdata/gophernotes/#windows
i.e. execute the commands
mkdir "%APPDATA%\jupyter\kernels\gophernotes"
xcopy "%GOPATH%\src\github.com\gopherdata\gophernotes\kernel" "%APPDATA%\jupyter\kernels\gophernotes" /s
then edit the file %APPDATA%\jupyter\kernels\gophernotes\kernel.json
replacing the string "gophernotes"
with the full path of gophernotes executable, surrounded by double quotes, as for example
"C:\Users\PUT_YOUR_USERNAME_HERE\go\bin\gophernotes"
- Start jupyter notebook (I am assuming it's already installed), typically by executing the command
jupyter notebook
and create a new Go notebook with New > Go
- At gophernotes prompt, import all the third-party packages you need. For example:
import (
"gonum.org/v1/gonum/mat"
"gonum.org/v1/gonum/floats"
)
for each import, you will get a message saying that a file has been created inside
C:\Users\PUT_YOUR_USERNAME_HERE\go\src\github.com\gopherdata\gophernotes
and that you need to recompile gophernotes.
Don't quit jupyter notebook yet: first, enter all the import
statements you need.
Only after you have typed all the import
statements (and got a similar message for each, saying that you need to recompile gophernotes), quit jupiter notebook.
- Recompile gophernotes with the commands:
set GOPATH=%USERPROFILE%\go
cd "%GOPATH%\src\github.com\gopherdata\gophernotes"
go install .
-
Start again jupyter notebook, and create a new Go notebook with New > Go
-
Import again the same third-party packages as in step 4. This time gophernotes will find them.
Final note: you need to repeat steps 4,5,6 and 7 each time you want to import third-party packages.
Pretty tedious, but there's currently no other solution.
from gophernotes.
Related Issues (20)
- Docker image update? HOT 4
- Error `cannot convert type <*main.b> to interface <error>` on valid Go code HOT 3
- extra output? HOT 1
- Proposal: present Gophernotes at Golab 2022 (Italy) ? HOT 3
- Running code in gophernotes is much slower than using go run HOT 4
- stop notebook on error HOT 2
- Dockerfile build image fail autocomplete HOT 1
- Import `google.golang.org/grpc` fails HOT 2
- not a package: "n" in n.multiply <*ast.SelectorExpr> HOT 1
- gophernotes and replace on go.mod
- Running in VSCode using jupyter HOT 7
- External repo not working HOT 6
- reflect.Value.Convert: value of type reflect.Value cannot be converted to type http.FileSystem
- compile: version "go1.19.4" does not match go tool version "go1.20.2" # unicode/utf16 HOT 2
- Cannot use third party libraries HOT 5
- When will the docker image use jupyter lab?
- fails to import "sync" package HOT 1
- runtime error: index out of range HOT 1
- unimplemented type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gophernotes.