-
Notifications
You must be signed in to change notification settings - Fork 15
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
converturl2abspath does not work in Windows and the temporary workaround #16
Comments
I can confirm this issue on Windows 10. Also, my sincere thanks to @yishilin14 for the suggested fix and to @cycomanic for this fantastic script. I had reconciled myself with losing all my Mendeley annotations upon moving to Zotero (Mendeley is evil) but no more! I almost never work on Windows, but since Mendeley encrypted the database I've had a v1.18 installation on a Windows 10 box. That meant all the PDF paths in the Mendeley database were Windows paths, so that's why I had to run this extraction on Windows. Windows 10 with Python (pip is apparently built-in these days):
I cloned this repo, and made only the following edits (note the slightly tweaked import compared to above):
I did try
Success, and over a thousand highlights will live to see another day :-) |
I am not a programmer. I am trying to import my Mendeley database, with thousands of highlights and notes, into Zotero. I've tried using this script as described in https://www.zotero.org/support/kb/mendeley_import, as well as the various fixes here. None of them works. Any help? |
@chepec I only wrote the script with python2 initially, so the error you were encountering was an incompatibility with python3. I don't have a mendeley installation anymore, which makes keeping this updated a bit challenging. Maybe I will have to create an installation just to check things. |
@brendonyoder what OS and what are the errors? |
I'm running Windows 10 and have Python 2.7 installed. I navigate to the extracted Menextract2pdf-master folder and enter |
same here |
this worked! |
After following direction above, I receive the following error:
Help with resolving this error would be much appreciated as it may preserve countless annotations. |
I am experiencing the same issue @J-FSS has. At the moment, my Mendeley's version is 1.19.4 and am not sure whether I need to downgrade it to 1.18 for the temporary fix of @yishilin14 to work. Below is the output I get in my terminal, when I run the code from an anaconda environment with Python 2.7.
Thanks a lot! P.S.: I really would like to migrate to Zotero, but must keep my notes and highlights from Mendeley... please, help us leave Mendeley! Thanks again. |
The
bat
files do not work in Windows as indicated in #13.The python itself does not work too. The function
converturl2abspath
does not return the correct file name in Windows. Whenurl
isfile:///C:/Users/xxxxxx/xxxxxx.pdf
, it returnsC:/C:/Users/xxxxxx/xxxxxx.pdf
.Here goes my temporary fix, just in case some one need it in the future.
In
menextract2pdf.py
import urllib, urllib.request
at the beginning.converturl2abspath
, change the return line toreturn urllib.request.url2pathname(pth)
.Then run the following command.
Now it works like magic!
The text was updated successfully, but these errors were encountered: