gopherdata / gophernotes

The Go kernel for Jupyter notebooks and nteract.
MIT License
3.8k stars 264 forks source link

Import third party packages on freebsd #213

Closed zishucom closed 4 years ago

zishucom commented 4 years ago

i got flowing same error when i import any thirdpart package on jupyter notebook

error writing file "/projects/go/src/github.com/gopherdata/gophernotes/imports/thirdparty/github_com_nsf_gocode.go": open /projects/go/src/github.com/gopherdata/gophernotes/imports/thirdparty/github_com_nsf_gocode.go: no such file or directory

cosmos72 commented 4 years ago

Can you copy here the output of go env ? Thanks

zishucom commented 4 years ago

dvma@dvma:~ % go env GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/home/dvma/.cache/go-build" GOENV="/home/dvma/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="freebsd" GOINSECURE="" GONOPROXY="" GONOSUMDB="" GOOS="freebsd" GOPATH="/projects/go" GOPRIVATE="" GOPROXY="https://goproxy.io,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build944275286=/tmp/go-build -gno-record-gcc-switches"

zishucom commented 4 years ago

Can you copy here the output of go env ?

Thanks

Hi Thank you

cosmos72 commented 4 years ago

https://golang.org/doc/go1.14#plugin states that plugin support for freebsd/amd64 was added in Go 1.14

I will update gophernotes and use it for loading third party packages

zishucom commented 4 years ago

https://golang.org/doc/go1.14#plugin states that plugin support for freebsd/amd64 was added in Go 1.14

I will update gophernotes and use it for loading third party packages

Thanks! Waiting that

cosmos72 commented 4 years ago

Support for importing third party packages on freebsd added in commit 4ee426e96bb45036a8c0b480adea5501ba1b464f Requires Go >= 1.14

cosmos72 commented 4 years ago

P.S.: github.com/nsf/gocode does not seem to be an importable package.

zishucom commented 4 years ago

Hi again! These errors still appeared there after I modified the go.mod go.sum and update the gomacro

cosmos72 commented 4 years ago

In #214 you reported that you're still getting the same error:

i was upgraded the gomacro. and modified the go.mod and go.sum


import(
"github.com/russross/blackfriday/v2"
)

error writing file "/projects/go/src/github.com/gopherdata/gophernotes/imports/thirdparty
/github_com_russross_blackfriday_v2.go": open /projects/go/src/github.com/gopherdata/gophernotes/imports/thirdparty/github_com_russross_blackfriday_v2.go: no such file or directory

Why did you "modify the go.mod go.sum and update the gomacro" ?

The installation instructions start with

env GO111MODULE=on go get github.com/gopherdata/gophernotes

and I thought you were doing that. There is no need to modify gophernotes sources manually.

zishucom commented 4 years ago

In #214 you reported that you're still getting the same error:

i was upgraded the gomacro. and modified the go.mod and go.sum

import(
"github.com/russross/blackfriday/v2"
)

error writing file "/projects/go/src/github.com/gopherdata/gophernotes/imports/thirdparty
/github_com_russross_blackfriday_v2.go": open /projects/go/src/github.com/gopherdata/gophernotes/imports/thirdparty/github_com_russross_blackfriday_v2.go: no such file or directory

Why did you "modify the go.mod go.sum and update the gomacro" ?

The installation instructions start with

env GO111MODULE=on go get github.com/gopherdata/gophernotes

and I thought you were doing that. There is no need to modify gophernotes sources manually.

Hi i reinstalled gophernotes.

cat pkg/mod/github.com/gopherdata/gophernotes@v0.7.0/go.mod

module github.com/gopherdata/gophernotes

go 1.11

require ( github.com/cosmos72/gomacro v0.0.0-20200226181501-ca599f547e70 github.com/go-zeromq/zmq4 v0.9.0 github.com/gofrs/uuid v3.2.0+incompatible golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 )

why is not

github.com/cosmos72/gomacro v0.0.0-20200719111907-b07014b02196 ???

cosmos72 commented 4 years ago

Good catch! Then it means env GO111MODULE=on go get ... does not download the latest commit of a module, but only the latest tagged commit, i.e. something like "latest released version".

I will release gophernotes 0.7.1 to let go get pick it

cosmos72 commented 4 years ago

[UPDATE] version 0.7.1 released.

Please try again the command env GO111MODULE=on go get github.com/gopherdata/gophernotes

zishucom commented 4 years ago

Thanks! But there gets new error:

import( "github.com/360EntSecGroup-Skylar/excelize/"
)

error loading package "github.com/360EntSecGroup-Skylar/excelize/" metadata: packages.Load() could not find package "github.com/360EntSecGroup-Skylar/excelize/"


ls src/gomacro.imports/github.com/

360EntSecGroup-Skylar

And sure the package was installed in pkg

cosmos72 commented 4 years ago

Try removing the final slash, i.e.

import "github.com/360EntSecGroup-Skylar/excelize"

instead of

import "github.com/360EntSecGroup-Skylar/excelize/"  /* note the extra '/' at the end */
zishucom commented 4 years ago

Thanks for reply! Yeah I have tried this ! Still get the same error


发件人: Massimiliano Ghilardi notifications@github.com 发送时间: Wednesday, July 22, 2020 11:11:26 PM 收件人: gopherdata/gophernotes gophernotes@noreply.github.com 抄送: zishucom dvma@live.cn; Author author@noreply.github.com 主题: Re: [gopherdata/gophernotes] Import third party packages on freebsd (#213)

Try removing the final slash, i.e.

import "github.com/360EntSecGroup-Skylar/excelize"

instead of

import "github.com/360EntSecGroup-Skylar/excelize/" / note the extra '/' at the end /

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gopherdata/gophernotes/issues/213#issuecomment-662510839, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AK74BWFNYH5IM5PFALXYW7LR436R5ANCNFSM4O753CTQ.

cosmos72 commented 4 years ago

That's really strange. Can you import any package at all? For example,

import "gonum.org/v1/gonum/floats"
zishucom commented 4 years ago

That's really strange.

Can you import any package at all? For example,


import "gonum.org/v1/gonum/floats"

Need I install this package? If I don’t need do it . Then I. Get flowing errorimage

zishucom commented 4 years ago

That's really strange.

Can you import any package at all? For example,


import "gonum.org/v1/gonum/floats"

Same last error here after I installed this package

cosmos72 commented 4 years ago

Can you post the error (or a screenshot) you get with the following import?

import "gonum.org/v1/gonum/floats"

By mistake I wrote "gonum.org/v1/floats" and you tried before I corrected the path

cosmos72 commented 4 years ago

One more thing: usually there is no need to install packages before importing them.

zishucom commented 4 years ago

One more thing: usually there is no need to install packages before importing them.

image

cosmos72 commented 4 years ago

ok, then you must have some leftovers from old installations lying around.

You can try with a cleanup:

go clean
go clean -cache
go clean -modcache

then reinstall gophernotes from scratch following the Linux instructions which should work also for FreeBSD.

zishucom commented 4 years ago

ok, then you must have some leftovers from old installations lying around.

You can try with a cleanup:

go clean
go clean -cache
go clean -modcache

then reinstall gophernotes from scratch following the Linux instructions which should work also for FreeBSD.

thank you verymuch cosmos72 it's working now...