knowsuchagency / hugo_jupyter

Publish Jupyter notebooks with Hugo
https://pypi.org/project/hugo_jupyter/
MIT License
81 stars 6 forks source link

init command fails with TypeError: invalid file #2

Closed ngulden closed 7 years ago

ngulden commented 7 years ago

Description

I wanted to try Hugo Jupyter with a fresh setup Hugo site. The init command failed.

What I Did

  1. I installed Hugo Jupyter via pip.
  2. I tried to setup Hugo Jupyter and run the command hugo_jupyter --init on the command line.
  3. The command gives the following traceback:
$ hugo_jupyter --init
Traceback (most recent call last):
  File "/home/user/.virtualenvs/hugo_jupyter/bin/hugo_jupyter", line 11, in <module>
    sys.exit(main())
  File "/home/user/.virtualenvs/hugo_jupyter/lib/python3.5/site-packages/hugo_jupyter/cli.py", line 33, in main
    with open(Path(Path(__file__).parent, '__fabfile.py')) as fp:
TypeError: invalid file: PosixPath('/home/user/.virtualenvs/hugo_jupyter/lib/python3.5/site-packages/hugo_jupyter/__fabfile.py')
knowsuchagency commented 7 years ago

Thanks for submitting the issue.

Latest release should fix the problem by using pkg_resources api as opposed to manual filepaths.