Giter Site home page Giter Site logo

Import issue about govector HOT 6 CLOSED

distributedclocks avatar distributedclocks commented on September 16, 2024
Import issue

from govector.

Comments (6)

mikegfink avatar mikegfink commented on September 16, 2024

Hi Sergey,
Did you only grab the govec package and not broker as well?

If you have both, as a stopgap measure you can change the import to refer
directly to the local broker path at probably ./../broker instead of the
absolute github path.
On Mar 6, 2016 9:49 PM, "Sergey Skovorodnikov" [email protected]
wrote:

I can't import GoVector into the project and keep getting error where it
is looking for

GoVector/govec/gopublisher.go:10:2: cannot find package "
github.com/arcaneiceman/GoVector/broker" in any of:
/usr/lib/go/src/pkg/github.com/arcaneiceman/GoVector/broker (from $GOROOT)
/home/vm/gowork/src/github.com/arcaneiceman/GoVector/broker (from $GOPATH)

And then the same thing for gopublisher.go and other components. I added
GoVector as git submodule to our project and did the import from the root
of the project "project/GoVector/govec" where project is root directory
of our project. As far as I understand GOROOT needs to be set when you
install go into a custom directory, but I haven't. GOPATH is working fine
(so far) and is pointing to $HOME/gowork where the project is as well.
Should GoVector be installed under $GOPATH as well for this to work? I was
trying to make it self contained by having it as submodule.

Some info:

  • GoVector cloned using git submodule init
  • project is at $GOPATH/src/project
  • GoVector is at $GOPATH/src/project/GoVector
  • the file that's importing GoVector is at $GOPATH/src/project/server
  • import statement "project/GoVector/govec"

I would really appreciate some help. Might be something I am doing wrong.
Thanks.


Reply to this email directly or view it on GitHub
#26.

from govector.

sergenikov avatar sergenikov commented on September 16, 2024

Hi Mike, I used git submodule and checked directory structure - it seems that everything is there. I tried the suggestion and changed import to project/GoVector/broker and got this:

GoVector/broker/pubmanager.go:12:2: cannot find package "github.com/arcaneiceman/GoVector/broker/nonce" in any of: /usr/lib/go/src/pkg/github.com/arcaneiceman/GoVector/broker/nonce (from $GOROOT) /home/sergey/gowork/src/github.com/arcaneiceman/GoVector/broker/nonce (from $GOPATH)

Then I tried changing import just to "./../GoVector/broker", which should reach GoVector directory but I get the same error.

I also tried specifying missing packages (I checked - they are in the filesystem):
"project_h2b9_s8z8_y4n8/GoVector/broker"
"project_h2b9_s8z8_y4n8/GoVector/broker/nonce"
"project_h2b9_s8z8_y4n8/GoVector/govec/vclock"

But they are still missing. Here is a full error message when I do those three imports (sorry, I can't find proper formatting for chunks of code):

GoVector/broker/pubmanager.go:12:2: cannot find package "github.com/arcaneiceman/GoVector/broker/nonce" in any of:
/usr/lib/go/src/pkg/github.com/arcaneiceman/GoVector/broker/nonce (from $GOROOT)
/home/sergey/gowork/src/github.com/arcaneiceman/GoVector/broker/nonce (from $GOPATH)
GoVector/broker/pubmessages.go:5:5: cannot find package "github.com/arcaneiceman/GoVector/govec/vclock" in any of:
/usr/lib/go/src/pkg/github.com/arcaneiceman/GoVector/govec/vclock (from $GOROOT)
/home/sergey/gowork/src/github.com/arcaneiceman/GoVector/govec/vclock (from $GOPATH)
GoVector/broker/submanager.go:15:2: cannot find package "golang.org/x/net/websocket" in any of:
/usr/lib/go/src/pkg/golang.org/x/net/websocket (from $GOROOT)
/home/sergey/gowork/src/golang.org/x/net/websocket (from $GOPATH)

from govector.

mikegfink avatar mikegfink commented on September 16, 2024

Hmmm. I see that the imports were fixed recently to point to the github paths. When I run
go get github.com/arcaneiceman/GoVector
It brings in the full package.
I haven't brought in a copy of a library to modify in a while, so I can't recall what needs editing to do it that way at the moment.

If you don't need to modify the source files, try removing the govec source from your project source files and just do the go get above. Sorry I can't be more helpful :(

from govector.

sergenikov avatar sergenikov commented on September 16, 2024

Thanks Mike. I followed instructions on the README.md file that say that I need to add GoVector to the project. I haven't thought of using go get to install it. I will do that and report here. I don't intend to modify source code. Thank you for your help.
UPDATE: I tried running go get github.com/arcaneiceman/GoVector and I am getting this error:

package github.com/arcaneiceman/GoVector
imports github.com/arcaneiceman/GoVector
imports github.com/arcaneiceman/GoVector: no buildable Go source files in /home/sergey/gowork/src/github.com/arcaneiceman/GoVector

GoVector is in $GOPATH directory completely, but does not seem to build if I understand it. I haven't had issues installing other packages (like golint and gotags) before. I am not sure if this is a problem with my environment or not.

from govector.

dan-l avatar dan-l commented on September 16, 2024

Try go get github.com/arcaneiceman/GoVector/govec https://github.com/arcaneiceman/GoVector/blob/master/example/ClientServer.go#L9

from govector.

sergenikov avatar sergenikov commented on September 16, 2024

Looks like that actually worked. It's no longer complaining about build files and project runs. Thanks for responses and your help - really nice to have that.

from govector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.