Using a Jupyter Notebook running with the python2 kernel, I tried to import emcee
and I got an error message:
File "/home/me/.local/lib/python2.7/site-packages/emcee/ensemble.py", line 84
parameter_names: Optional[Union[Dict[str, int], List[str]]] = None,
^
SyntaxError: invalid syntax
apparently because I am using the python2 kernel.
I then installed ipykernal using: python3 -m pip install ipykernel
I then opened a Jupyter Notebook using the Python3 kernel. I again tried to import emcee
but I had the same problem. It was still looking for the emcee
module in the python2 path.
I then did pip3 install emcee
, opened a Jupyter Notebook (python3 kernel) but I still have the same issue.
I think I need to tell Jupyter Notebook to look for the python3 version of emcee, but I'm not sure how to. I just tried:
export PYTHONPATH='/home/me/.local/lib/python3.6/site-packages/'
But again, this didn't fix it. I checked the sys.path
in my Jupyter Notebook and the new python path didn't seem to be added.
Can someone tell me what I'm doing wrong please?