Dep: Package is required by (root)?

Created on 10 Nov 2018  Â·  5Comments  Â·  Source: golang/dep

Hi,

I'm a new dep user. I got the following error when I try to install etherapis package. To be more specific, I just want to use this file.

$ pwd
/Users/zulhilmi/go/src/go-ethereum-get-contract-owner

$ dep ensure -add github.com/etherapis/etherapis
Fetching sources...

Solving failure: No versions of github.com/etherapis/etherapis met constraints:
    v0.0.1: Could not introduce github.com/etherapis/[email protected], as its subpackage github.com/etherapis/etherapis does not contain usable Go code (*build.NoGoError).. (Package is required by (root).)
    master: Could not introduce github.com/etherapis/etherapis@master, as it requires problematic packages from github.com/ethereum/go-ethereum (current version v1.8.17):  github.com/ethereum/go-ethereum/jsre is missing.    github.com/ethereum/go-ethereum/logger/glog is missing.

How do I fix this?

Thank you.

All 5 comments

Huh, works for me:

~/workspace/go/src/projects$ dep version
dep:
version : v0.5.0
build date : 2018-07-26
git hash : 224a564
go version : go1.10.3
go compiler : gc
platform : linux/amd64
features : ImportDuringSolve=false

~/workspace/go/src/projects$ dep ensure -add github.com/etherapis/etherapis
Fetching sources...

"github.com/etherapis/etherapis" is not imported by your project, and has
been temporarily added to Gopkg.lock and vendor/.
If you run "dep ensure" again before actually importing it, it will
disappear from Gopkg.lock and vendor/.

On Fri, Nov 9, 2018 at 6:56 PM Zulhilmi Zainudin notifications@github.com
wrote:

Hi,

I'm a new dep user. I got the following error when I try to install
etherapis https://github.com/etherapis/etherapis package. To be more
specific, I just want to use this file
https://github.com/etherapis/etherapis/blob/master/etherapis/geth/api.go
.

$ pwd
/Users/zulhilmi/go/src/go-ethereum-get-contract-owner

$ dep ensure -add github.com/etherapis/etherapis
Fetching sources...

Solving failure: No versions of github.com/etherapis/etherapis met constraints:
v0.0.1: Could not introduce github.com/etherapis/[email protected], as its subpackage github.com/etherapis/etherapis does not contain usable Go code (*build.NoGoError).. (Package is required by (root).)
master: Could not introduce github.com/etherapis/etherapis@master, as it requires problematic packages from github.com/ethereum/go-ethereum (current version v1.8.17): github.com/ethereum/go-ethereum/jsre is missing. github.com/ethereum/go-ethereum/logger/glog is missing.

How do I fix this?

Thank you.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/golang/dep/issues/2049, or mute the thread
https://github.com/notifications/unsubscribe-auth/AHJg5m4N8qln8U5p7z9PVXn7WFc-Dfjtks5uthYugaJpZM4YXsWM
.

I have the same error with a different package and I think the way the error is represented is not helpful. Lets take it apart:

Solving failure: No versions of github.com/helm/helm met constraints:
    v2.11.0: Could not introduce github.com/helm/[email protected], as its subpackage github.com/helm/helm/strvals is missing. (Package is required by (root).)
    v2.10.0: Could not introduce github.com/helm/[email protected], as it is not allowed by constraint ^2.11.0 from project xxxxx.
    v2.9.1: Could not introduce github.com/helm/[email protected], as it is not allowed by constraint ^2.11.0 from project xxxxx.

1) where is the subpackage missing, online? do I need to put it into some file, why?
2) "(Package is required by (root).)" which package is required and what do you meen by root? it is certainly not refering to the admin user, right?

Here's what github.com/etherapis/etherapis looks like at Git tag v0.0.1:

$ ll
total 88
drwxr-xr-x  11 kevin  staff   352B Jan  1 12:02 .
drwxr-xr-x   3 kevin  staff    96B Jan  1 12:01 ..
drwxr-xr-x  11 kevin  staff   352B Jan  1 12:02 .git
-rw-r--r--   1 kevin  staff   639B Jan  1 12:01 .gitignore
-rw-r--r--   1 kevin  staff    31K Jan  1 12:01 LICENSE
-rw-r--r--   1 kevin  staff   7.4K Jan  1 12:02 README.md
drwxr-xr-x   3 kevin  staff    96B Jan  1 12:02 contracts
drwxr-xr-x   4 kevin  staff   128B Jan  1 12:02 demos
drwxr-xr-x   8 kevin  staff   256B Jan  1 12:02 etherapis
drwxr-xr-x   5 kevin  staff   160B Jan  1 12:02 faucet
drwxr-xr-x  11 kevin  staff   352B Jan  1 12:02 website

required by (root) essentially says, you asked for this package, we tried to use v0.0.1 of it, but we couldn't because there isn't any Go code in the package you asked for. (There is Go code in the subpackages, but you'd want to ask for those specifically, e.g. dep ensure -add github.com/etherapis/etherapis/faucet or similar).

The master branch adds a main.go at the top level, so we have Go code there now. However it fails for a different reason.

    master: Could not introduce github.com/etherapis/etherapis@master, as it requires problematic packages from github.com/ethereum/go-ethereum (current version v1.8.17):  github.com/ethereum/go-ethereum/jsre is missing.    github.com/ethereum/go-ethereum/logger/glog is missing.

You'd probably need to figure out which version of github.com/etherium/go-ethereum actually has the packages you need and then specify that in your Gopkg.toml.

Generally the way to resolve this is to actually write a Go program that imports the library you want and then just run dep ensure and it will notice the import statement and go fetch the library for you.

@ensonic I'd suggest opening a separate ticket describing what your source code looks like and what package(s) you are trying to import and we can debug it separately.

Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks!

Was this page helpful?
0 / 5 - 0 ratings