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

Questions on jrnl Installation and Some Errors #231

Closed
manishsuwal opened this issue Jul 2, 2014 · 21 comments
Closed

Questions on jrnl Installation and Some Errors #231

manishsuwal opened this issue Jul 2, 2014 · 21 comments

Comments

@manishsuwal
Copy link

I'm having problem installing jrnl.

When i tried doing pip install jrnl it said command not found: pip

screen shot 2014-07-02 at 1 34 34 pm

Is there alternate way to install this? or am I missing something?

Thank you in advance. :-)

@maebert
Copy link
Contributor

maebert commented Jul 2, 2014

You may first have to install pip if not present: easy_install pip. Alternatively, you can download the source and run

python setup.py build
python setup.py install

I'm working on providing a homebrew package, but that may take a while. Let me know if that works!

@maebert maebert closed this as completed Jul 2, 2014
@grplyler
Copy link
Contributor

grplyler commented Jul 2, 2014

It looks like pip is not in your zsh path. Me personally, I just use bash.
Try $ echo $PATH
then try: $ which pip
For me, 'which pip' returns:
/Library/Frameworks/Python.framework/Versions/2.7/bin/pip

Solution 1: Add pip to your path so you can execute it in terminal
Solution 2: type 'bash' in zsh to run a bash shell and then try: $ pip install jrnl

But yes, there is an alternate way. To get the latest and greatest version of jrnl you can do it 2 ways:
If you have git on your system:

  1. $ git clone https://github.com/maebert/jrnl.git
  2. $ cd jrnl
  3. $ python setup.py install
  4. (Optional) $ jrnl just installed jrnl like a boss

If you don't have git:

  1. Download the latest jrnl source as a zip file.
  2. Unzip and cd to the source directory.
    3 $ python setup.py install

Trouble shooting:
If the jrnl command doesn't work then its the first problem: its not in your $PATH environment variable. For me jrnl was installed in /Library/Frameworks/Python.framework/Versions/2.7/bin/jrnl
So if you are in the same situation add /Library/Frameworks/Python.framework/Versions/2.7/bin/ to
your zsh path.

I'm not sure how zsh does it, but in bash the configuration file is in ~/.profile
I have these lines in my bash .profile

Setting PATH for Python 2.7

The orginal version is saved in .profile.pysave

PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export path

You'll need to restart your shell to activate the new path settings.

@manishsuwal
Copy link
Author

Thank you @maebert and @grplyler. I successfully installed pip and then jrnl.

However, when I type jrnl in the command line, it shows this error:
screen shot 2014-07-03 at 12 09 38 pm

What's wrong?

@maebert
Copy link
Contributor

maebert commented Jul 3, 2014

Hi, this is a known issue with one of the dependencies. It's caused by having two different python installations; see #160 and #172, #182 and #190 for details.

The best work-around is to download the source as a zip file, extract it and run python setup.py install in there. Let me know if that helps!

Alternatively (but not recommended), ty easy_install jrnl, or follow @james2doyle's advice.

Sorry you have to go through so much trouble to make it work, it's usually much smoother!

@manishsuwal
Copy link
Author

I did easy_install jrnl and it worked. Thanks @maebert.

Everything went smooth until I tried to encrypt using jrnl --encrypt command. After encrypting, there's no way to write a journal again using jrnl. It always shows error when I try to write journal using jrnl.

screen shot 2014-07-04 at 3 20 44 pm

I can't jrnl --decrypt either.

screen shot 2014-07-04 at 4 05 58 pm

:-(

1 question: If I encrypt my journals from my Mac, can I decrypt it from other machines? like through Windows laptop? or will I need this Mac and system every time to decrypt it? I want to be able to sync my journals on other devices as well, so.

@manishsuwal
Copy link
Author

Also, is there a way to make Ulysses III default text editor for jrnl?

For now, I've made Sublime Text default editor by modifying ~/.jrnl_config file and changing editor to "editor": "subl -w"
What do I change in subl -w to make Ulysses III default?

@maebert
Copy link
Contributor

maebert commented Jul 4, 2014

The encryption should work the same on all platforms could you post the contents of your ~/.jrnl_config please?

If you have set Ulysses as your default text editor, then you can set editor to open -Wnt. Otherwise try open -b com.soulmen.ulysses3 -Wn (no guarantees).

@manishsuwal
Copy link
Author

Could you post the contents of your ~/.jrnl_config please?

Here it is:

{
  "default_hour": 0,
  "timeformat": "%Y-%m-%d %H:%M",
  "linewrap": 79,
  "encrypt": false,
  "editor": "open -b com.soulmen.ulysses3 -Wn",
  "default_minute": 0,
  "highlight": true,
  "journals": {
    "default": "/Users/manishsuwal/dropbox/apps/jrnl/journal.txt",
    "dayone": "~/Dropbox/Apps/Day One/"
  },
  "tagsymbols": "@"
}

I just used Ulysses III instead of Sublime Text to write and it gave the same error [Nothing saved to file]:
screen shot 2014-07-05 at 12 04 52 pm

@manishsuwal
Copy link
Author

I think it's better to uninstall jrnl and re-install it again. What do you think?

@maebert
Copy link
Contributor

maebert commented Jul 7, 2014

Ha, for some reason it didn't mark your journal as encrypted in your jrnl_config. Try setting "encrypt": true there.

@manishsuwal
Copy link
Author

Thanks, it worked.

However, there's one problem (which isn't a big problem for me & I can live with it). I get this error everytime I --encrypt and --decrypt my jrnl
screen shot 2014-07-10 at 2 38 21 pm

Why do I get this:

Traceback (most recent call last):
  File "/usr/local/bin/jrnl", line 8, in <module>
    load_entry_point('jrnl==1.8.6', 'console_scripts', 'jrnl')()
  File "/Library/Python/2.7/site-packages/jrnl/cli.py", line 242, in run
    install.save_config(original_config, config_path=CONFIG_PATH)
  File "/Library/Python/2.7/site-packages/jrnl/install.py", line 51, in save_config
    with open(config_path, 'w') as f:
IOError: [Errno 13] Permission denied: '/Users/manishsuwal/.jrnl_config'

and then this:
ERROR: Your journal file seems to be corrupted. You do have a backup, don't you?

This doesn't happen if I don't --encrypt or --decrypt my journal entries. It happens only when I try to --encrypt or --decrypt my journal entries.

@maebert
Copy link
Contributor

maebert commented Jul 10, 2014

Ah. Okay, the problem is the same again, for some reason your .jrnl_config is not writable because of a permission problem. It probably decrypted your journal, but in .jrnl_config it's still marked as encrypted, hence jrnl thinks it got corrupted.

Check your permissions of jrnl and your .jrnl_config and make sure they're owned by the same user and that your .jrnl_config is writable:

$ ls -al `which jrnl`
$ ls -al ~/.jrnl_config

@manishsuwal
Copy link
Author

→ ls -al 'which jrnl'
ls: which jrnl: No such file or directory
→ ls -al ~/.jrnl_config
-rw-r--r--  1 root  staff  325 Jul 10 14:34 /Users/manishsuwal/.jrnl_config

screen shot 2014-07-10 at 2 59 31 pm

@maebert
Copy link
Contributor

maebert commented Jul 10, 2014

Oh, the quotation marks around which journal should be back ticks. But you can also just do which jrnl and then do ls -al on whatever the output is.

@manishsuwal
Copy link
Author

Does this help:
screen shot 2014-07-10 at 6 24 32 pm

@manishsuwal manishsuwal changed the title Pip Install Doesn't Work: How to Install jrnl? Questions on jrnl Installation and Some Errors Jul 10, 2014
@maebert
Copy link
Contributor

maebert commented Jul 11, 2014

Thaaaat helps. So, apparently you installed jrnl as root, and when running it without sudo it doesn't have permission to write to your config file. The easiest fix is to say sudo chmod 766 ~/.jrnl_config, making your config writable by anybody on your system. (Some unix geeks will probably tell you that this will conjure up the downfall of the occident, but if you're the only one using your machine - meh, who cares).

@Mike-McD
Copy link

Great stuff !
I'd played about with trying to install this a couple of weeks ago and failed had a lot on (still do) so I kind of gave up, but not completely.

Did a quick google tonight and came across this - used the "if you don't have git" suggestion by grplyler and it installed no problem at all :)
though I'm doing something wrong in trying to write an entry - it's late & maybe I should rethink & retry tomorrow but I'm here now - a screen grab is attached.
I'd be grateful for any input or suggestions.
Thanks.
untitled

@iggyvolz
Copy link

You're trying to run a program called "jrnl:" . There's no semicolon, it's just "jrnl this is a test entry", that's part of the problem.

Also, you haven't installed it at all. The simplest way is to run pip install jrnl (you need pip first, see instructions above), but if you want to build it from source, run python setup.py install.

@manishsuwal
Copy link
Author

Hi, this is a known issue with one of the dependencies. It's caused by having two different python installations; see #160 and #172, #182 and #190 for details.
The best work-around is to download the source as a zip file, extract it and run python setup.py install in there. Let me know if that helps!
Alternatively (but not recommended), ty easy_install jrnl, or follow @james2doyle's advice.

@maebert I have done everything you said. I have downloaded the source as a zip file and then ran python setup.py install in there.
I have also followed @james2doyle's advice step by step. But it still shows this:
screen shot 2015-01-01 at 9 16 52 am
It says [Entry added to default journal], but still shows the error.

@MinchinWeb
Copy link
Contributor

@Mike-McD : The error you get is slightly different for you as you're running Windows. jrnl requires Python. Have you installed Python yet?

If not, do that, make sure to select the option that adds Python to PATH, then open a new CMD window and run pip install jrnl and then jrnl should work.

@Mike-McD
Copy link

Mike-McD commented Jan 3, 2015

Thanks for the latest responses guys - but I gave up on this over 6 months ago - not even got it stored in an archive

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

6 participants