-
Notifications
You must be signed in to change notification settings - Fork 5
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
crashing on test mode #2
Comments
I'm getting a similar error on test mode:
It fails in non-test mode, too:
I have Python 3.7.7 via brew on MacOS 10.15.4 |
@mromanuk can you try again? Just to make sure use this version: BEAR_TEST=true /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/cglacet/bear/61e00fc226afb5781878548185fdc62cdefd3ff0/install.sh)" I've updated a bit widely as I had no idea if anyone was testing this. I'll keep things clean in master now 👍 (let me know if this works). |
@klickreflex That's strange, what happens if you run the following: python -c "nb_links_inserted=3; print(f'Inserted {nb_links_inserted} new links to your notes.')" It may be because I call |
@cglacet running
Thanks for your help :) |
If I remove the alias that link
Background: I've had the following alias in my .zshrc file because Python 3 installed via brew is only available via the |
@klickreflex I used to pull my hairs off with python versions then I started using pyenv never had any problem since (the article you linked also suggest not bothering with python versions and use Since you have an alias maybe the following doesn't give the same version as straight ❯ /bin/bash -c "python --version" If that's the case pyenv would solve that problem too and you would have the same python version in both cases: ❯ python --version ; /bin/bash -c "python --version"
Python 3.8.2
Python 3.8.2
❯ pyenv global 3.7.7
❯ python --version ; /bin/bash -c "python --version"
Python 3.7.7
Python 3.7.7 I guess your system python version is still a python 2 which causes problems with the "new" print (I could import With the alias you have, your python version of choice is only linked to your shell (zsh). If you start using pyenv, I would suggest removing any alias you have on python interpreters, just in case: ❯ alias python=echo ; python --version ; /bin/bash -c "python --version"
--version
Python 3.7.7 |
@cglacet Awesome, this was the problem, my system Python got called. Pyenv solved it, thanks for recommending it. Should have done this long time ago, Python versioning is so confusing. Now I'm still having trouble getting the expected references into my notes, but maybe I'm using it wrong. Will check again in the evening. |
You could also install everything manually if you already have git and python, most of the install script is made to install these (and made for non-developpers, I should add a line for developpers), the rest of it is more or less equivalent to this: git clone git@github.com:cglacet/bear.git
cd bear
BEAR_TEST=true python insert_backreferences.py |
Yes, the xkcd drawing is pretty accurate 😛 |
it works! thanks! |
@mromanuk Great! let me know if you try it on your notes. Don't forget to backup before, just in case 🦺. One problem I can't solve for now is the modification date of updated notes will be set to "now". Which I find sad as adding back reference shouldn't be considered a modification in the note, but the API from Bear doesn't allow to modify a note without altering the modification date. |
it worked like a charm 🙌 |
@mromanuk ah, very good news, so you and I are the only two person to have used it successfully so far. You doubled the number of successes 🤣! |
I have the very same issue, however can't follow your suggested solution with pyenv. After installation I still get the mac os default version of 2.7.x displayed with Help is needed 🙋♂️ |
I confirmed this also works with a virtualenv environment activated--the correct python interpreter gets called |
Could also get it to work after digging into the implementation notes. Can't believe I haven't figured this out earlier: Instead of using the 'Link to note' feature I've always used the wiki-style links with Is there any way to include wiki-style links as well? For me those are a lot handier, since I can simply create a new page without manually creating one and getting the link of it. I wouldn't mind the reference links to be in the bear-style in order to avoid the circle reference described in your implementation notes. |
@benjaminharr Once you have installed pyenv you also need to use it to install a newer version of python and then set this version as the global version. For example with python 3.7.7: pyenv install 3.7.7
pyenv global 3.7.7 Concerning wiki-style links I don't know what they are so I can't tell you for now 😛. But I can have a look at that. By the way how did you installed python on your machine? I think the auto-install script I wrote is not good. It should install a newer version of python I think. Thanks for the feedback. |
I modified the installation script, now it should install Hopefully this should work and be more or less equivalent to running: mkdir -p ~/.github/bear/back-references
cd ~/.github/bear/back-references
git clone git@github.com:cglacet/bear.git .
brew install pyenv
pyenv install 3.7.7
pyenv local 3.7.7 Which should be enough to run the script, for example: BEAR_TEST=true python insert_backreferences.py If you plan on using python yourself, you could also run |
Thanks for giving the additional info on pyenv, have managed to set it up and have a global updated version by now! Concerning wiki-style links: there are two ways to link notes in bear.
I only use the later ones in my workflow, since I barely have the notes list visible and find it a lot more intuitive to link the pages this way. |
I tried to run your script in test mode, but it is crashing:
The text was updated successfully, but these errors were encountered: