Could not get context for py


Instructions on the website says to execute

$ pip install
$ python -m stencila register

I ran

$ python -m pip install
Successfully built stencila
$ python -m stencila register

but stencila-desktop-0.28.2-x86_64.AppImage still give me

Could not get context for py

Did I miss something?

$ uname -a
Linux ssi 4.14.47-1-MANJARO #1 SMP PREEMPT Thu May 31 06:19:52 UTC 2018 x86_64 GNU/Linux
$ which python
$ python
Python 3.5.4 |Anaconda, Inc.| (default, Nov  3 2017, 20:01:27) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import stencila


@rgaiacs: if python -m stencila register was successful then you should have a file called py.json in ~/.stencila/hosts. This is the file that Stencila Desktop looks for and uses to launch a new PythonContext and will say “Could not get context for py” if it’s not there.

Could you try find on py.json in your home directory.

If you open up the “Hosts” panel you will see what execution contexts have been successfully registered on your machine:


you should have a file called py.json in ~/.stencila/hosts.

The file was at /root/.stencila/hosts because I run the command as root but call Stencila as my user. It works now. Thanks.


@rgaiacs : glad you found the problem. Would :heart: a pull request :wink: on where you think documentation could be improved so that others down’t have the same problem.