Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails due to missing photoslibrary/v1 go package #53

Closed
betaprior opened this issue Apr 18, 2019 · 20 comments · Fixed by #74, #76 or #78
Closed

Installation fails due to missing photoslibrary/v1 go package #53

betaprior opened this issue Apr 18, 2019 · 20 comments · Fixed by #74, #76 or #78
Assignees

Comments

@betaprior
Copy link

Installation via go get -u github.com/nmrshll/gphotos-uploader-cli/cmd/gphotos-uploader-cli fails with
package google.golang.org/api/photoslibrary/v1: cannot find package "google.golang.org/api/photoslibrary/v1"

Indeed, this package is not in the list if you go to https://godoc.org/google.golang.org/api -- has it been removed?

@thefrip
Copy link

thefrip commented Apr 19, 2019

Yes, it has been removed by Google. I could fetch it manually from: https://github.com/influxdata/influxdata-operator/blob/master/vendor/google.golang.org/api/photoslibrary/v1/photoslibrary-gen.go

Recommendation from Google is to "vendor" the package directly in this git

@calisro
Copy link

calisro commented Apr 29, 2019

How does one install this now?

@coltc50
Copy link

coltc50 commented Apr 29, 2019

That's I want to know also...

EDIT: Found it... :-)

@tonymet
Copy link
Contributor

tonymet commented Apr 29, 2019

@coltc50 could you share your workaround? it looks like that library has been deprecated, so I can work to vendor it

here is a little more info.
googleapis/google-api-go-client#354

@tonymet tonymet self-assigned this Apr 29, 2019
@tonymet
Copy link
Contributor

tonymet commented Apr 29, 2019

@nmrshll I'm planning on vendoring the library and will submit a PR. let me know if you can think of a better approach.

@tonymet
Copy link
Contributor

tonymet commented Apr 29, 2019

@leoalekseyev wanted to say thanks for reporting the bug sorry for the delay.

@tonymet
Copy link
Contributor

tonymet commented Apr 30, 2019

@leoalekseyev @coltc50 please test this PR
note GO111MODULE=off

@tonymet
Copy link
Contributor

tonymet commented Apr 30, 2019

@markusgerber76
Copy link

EDIT: Found it... :-)
hi Can you type the workaround for us mere mortals! Thx

@goldcove
Copy link

@voltcraft1 @calisro

Workaround until fix is merged:
mkdir -p mkdir -p /home/{yourpath}/go/src/google.golang.org/api/photoslibrary/v1

Download https://github.com/influxdata/influxdata-operator/blob/master/vendor/google.golang.org/api/photoslibrary/v1/photoslibrary-gen.go to the directory mentioned above.

Re-run the installation as mentioned in the readme.

@poleguy
Copy link

poleguy commented May 21, 2019

@goldcove
Novice go user here... I couldn't get your workaround to work.
The instructions in the readme aren't helpful because the requirements are after the quick start.
This seemed to be working, but...

export GO111MODULE=on
mkdir -p /home/poleguy/go/src/google.golang.org/api/photoslibrary/v1
cd /home/poleguy/go/src/google.golang.org/api/photoslibrary/v1
wget https://raw.githubusercontent.com/influxdata/influxdata-operator/master/vendor/google.golang.org/api/photoslibrary/v1/photoslibrary-gen.go
go get -u github.com/nmrshll/gphotos-uploader-cli/cmd/gphotos-uploader-cli

Then it complains about non-....v1 module:

go: finding github.com/mattn/go-isatty v0.0.4
...
go: gopkg.in/h2non/filetype.v1@v1.0.8: go.mod has non-....v1 module path "github.com/h2non/filetype" at revision v1.0.8
...
go get: error loading module requirements

I found this:
https://go.ctolib.com/article/comments/8022

But it seems too many levels deep for me to succeed.

I just want to upload photos...

What step am I missing?
(Running Centos 7)

@Yexiaoxing
Copy link

I can confirm that @goldcove steps are working by slighting changing the command:

mkdir -p $GOPATH/src/google.golang.org/api/photoslibrary/v1
curl https://github.com/influxdata/influxdata-operator/raw/master/vendor/google.golang.org/api/photoslibrary/v1/photoslibrary-gen.go -o $GOPATH/src/google.golang.org/api/photoslibrary/v1/photoslibrary-gen.go
go get -u github.com/nmrshll/gphotos-uploader-cli/cmd/gphotos-uploader-cli

@poleguy
Copy link

poleguy commented May 26, 2019

I got it installed and running with the help of this thread, thanks all!

@ReidandKat
Copy link

@poleguy would you mind posting your installation steps? I can't get it working.

@brett-w-thompson
Copy link

Tried Yexiaoxing's workaround, still can't install. Am on macOS.

$ go get -u github.com/nmrshll/gphotos-uploader-cli/cmd/gphotos-uploader-cli
package google.golang.org/api/photoslibrary/v1: cannot find package "google.golang.org/api/photoslibrary/v1" in any of:
	/usr/local/Cellar/go/1.12.5/libexec/src/google.golang.org/api/photoslibrary/v1 (from $GOROOT)
	/Users/brett/go/src/google.golang.org/api/photoslibrary/v1 (from $GOPATH)```

@jledoux
Copy link

jledoux commented Jun 15, 2019

mkdir -p ~/go/src/google.golang.org/api/photoslibrary/v1
wget https://raw.githubusercontent.com/influxdata/influxdata-operator/master/vendor/google.golang.org/api/photoslibrary/v1/photoslibrary-gen.go -O ~/go/src/google.golang.org/api/photoslibrary/v1/photoslibrary-gen.go
go get -u github.com/nmrshll/gphotos-uploader-cli/cmd/gphotos-uploader-cli

Note if you get an error on the last step like

package google.golang.org/api/photoslibrary/v1:
 ../go/src/google.golang.org/api/photoslibrary/v1/photoslibrary-gen.go:7:1: expected 'package', found '<'

it means you didn't download the photoslibrary-gen.go file correctly, but instead downloaded an HTML file (either from a github page with a link to the proper raw file to download; or from a 404 page if it moved).

@rfgamaral
Copy link

I'm trying to update my rfgamaral/docker-gphotos-uploader with the latest version but I'm failing with the instructions described here.

This is what I get:

Step 5/7 : RUN mkdir -p /go/src/google.golang.org/api/photoslibrary/v1
 ---> Running in 5c1ebcf5e71d
Removing intermediate container 5c1ebcf5e71d
 ---> 51f1d6f2aaba
Step 6/7 : RUN curl https://github.com/influxdata/influxdata-operator/raw/master/vendor/google.golang.org/api/photoslibrary/v1/photoslibrary-gen.go     -o /go/src/google.golang.org/api/photoslibrary/v1/photoslibrary-gen.go
 ---> Running in 66c6424402c8
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   204  100   204    0     0    512      0 --:--:-- --:--:-- --:--:--   511
Removing intermediate container 66c6424402c8
 ---> e479b89a6460
Step 7/7 : RUN go get -u github.com/nmrshll/gphotos-uploader-cli
 ---> Running in 537c5f6b7d28
package google.golang.org/api/googleapi: /go/src/google.golang.org/api exists but /go/src/google.golang.org/api/.git does not - stale checkout?
package google.golang.org/api/photoslibrary/v1: directory "/go/src/google.golang.org/api/photoslibrary/v1" is not using a known version control system
The command '/bin/sh -c go get -u github.com/nmrshll/gphotos-uploader-cli' returned a non-zero code: 1

Thoughts?

@pacoorozco
Copy link
Member

I've reverted the previous PR. go doesn't allow to have some dependancies as vendor and others as Go Modules. I'm currently blocked at this stage.

I don't want to put all dependancies as vendor. I'd like to put only this one. One approach is converting this library into an internal module. What do you think?

@pacoorozco
Copy link
Member

Not working yet...

@pacoorozco pacoorozco reopened this Jun 25, 2019
@pacoorozco
Copy link
Member

Hi guys!
I've tried a lot of approaches to deal with google.golang.org/api/photoslibrary but It seems doesn't works. Something it's not working when you try to use go get. If you clone the repository and build the command line with make build it's working properly.
I'm afraid that go get is not using go.mod replace line...
I'll continue doing some more tests, but be aware go get method is not temporary working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment