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

No image at path clipboardImage1.png #1

Closed
superficialt opened this issue Aug 29, 2019 · 12 comments
Closed

No image at path clipboardImage1.png #1

superficialt opened this issue Aug 29, 2019 · 12 comments

Comments

@superficialt
Copy link

Hi,

I think this is a great idea, was really excited to find that it exists. However, it doesn't seem to work for me. Perhaps I have installed it incorrectly.

I used:
packages.install('devtools')
devtools::install_github('Timag/imageclipr')

This didn't work at all - threw an error message complaining that PIL wasn't installed. So from Terminal I ran 'sudo pip install pillow'.

Now when I run 'devtools::install_github('Timag/imageclipr')' it installs without error but when I try to paste something in I get this error:
image

MacBook Pro 2018 running OS X Mojave 10.14.6
RStudio 1.1.456
I have Python installed, I think, on this machine but I have never used it. This may be the issue - I have no idea whether it's working, whether all the paths are correct etc.

Any suggestions?

Toniiiio pushed a commit that referenced this issue Aug 29, 2019
@Toniiiio
Copy link
Owner

Toniiiio commented Aug 29, 2019

Hi @superficialt ,

thanks for your feedback. I didnt have the chance to test the package on Mac, a friend wanted to do that, but didnt find the time. So i cant reproduce it at the moment :(.

I made an update to the code. Could you re-install the latest (dev) version from github and see if there comes an error message- If that doesnt help - could you check if there was a file created in the same directory as your notebook file is?

If that doesnt help i will try to get my hands on a mac.

Best regards,
Tonio

@superficialt
Copy link
Author

Thanks for the input. I've updated the package, and restarted R. It seems to be more broken now I'm afraid. I get an error message now before the code clip (in my image above) appears:

Error in value[[3L]](cond) : Error copying the file with python. Error message reads: Error in py_run_string_impl(code, local, convert): Evaluation error: option error has NULL value. In addition: Warning messages: 1: replacing previous import ‘shiny::runExample’ by ‘shinyjs::runExample’ when loading ‘imageclipr’ 2: In if ("AttributeError: 'NoneType' object has no attribute 'save'" == : the condition has length > 1 and only the first element will be used

@Toniiiio
Copy link
Owner

Not more broken, more detailed logging :) The python code seems to fail. Checking the error leads to: rstudio/reticulate#494.
So it could be a bug in rstudio.

Could you have a look at it and check if the error occurs if you work outside a project or update rstudio to the referenced version?

@Toniiiio
Copy link
Owner

Toniiiio commented Sep 4, 2019

any update @superficialt ?

@superficialt
Copy link
Author

superficialt commented Sep 6, 2019 via email

@Toniiiio
Copy link
Owner

Toniiiio commented Sep 6, 2019

I meant you could check: rstudio/reticulate#494. There they write about the same error message.
--> Action would be:

@chlee-tabin
Copy link

I think I found the error for Mac OSX.

It looks like that the filePath from the rstudioapi is throwing a path name that has tilda (~) as the home directory. And whenever that path is given to the python code, it fails.

@chlee-tabin
Copy link

I created a pull request (although, I think due to this Windows Mac OSX differences in line breaks it shows a entire code changes) that fixes the issue and works with Mac OSX. (It is just one additional line, which I believe will not affect Windows usage).

@superficialt
Copy link
Author

OK, forgive my ignorance but how do I update to your version?

@Toniiiio
Copy link
Owner

Thanks for the PR @chlee-tabin. You are right on the "diff" he showed me -168 + 170 lines of code, but thats fine. I merged the PR, thanks for the OSX support!

@superficialt. You can update now, by downloading the current version.

@chlee-tabin
Copy link

@TiMaG Hi thanks again for the wonderful package which I am using it. I created one more pull request which I am happy if you decline, but I think it makes sense of naming the png files alongside the markdown file (I have multiple markdown files in a directory so makes it easier to pinpoint which images I pasted).

@Toniiiio
Copy link
Owner

Sure, thanks for your contribution!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants