1

I have installed ipython jupyter console for sublimeREPL using the link https://gist.github.com/MattDMo/6cb1dfbe8a124e1ca5af

However, I face a problem, when I start the "Jupyter Console", it doesn't load the current directory in which I am working.

For Instance, I am working on a file "text.py in directory "/home/sam/desktop/programs/" and I run a manual import "import text" in the sublimeREPL (jupyter console), I get a module not found error

ImportError                               Traceback (most recent call     last)
<ipython-input-3-0660e90ee9d4> in <module>()
----> 1 import text

ImportError: No module named text  

I refered to the link Set working directory to location of active script in SublimeREPL and checked the directory of cwd using os.getcwd()

The directory that I see is /opt/sublimetext

I even tried changing the "cwd" from "cwd": "$file_path", to the current path,"cwd": "/home/sam/desktop/programs/" in the "Main.sublime-menu" file

I was wondering if there is a way that I could register the directory manually or even better if sublimeREPL would automatically pick the directory, since I'll be importing files from different locations.

Thanks.

Community
  • 1
  • 1
Sam
  • 2,545
  • 8
  • 38
  • 59
  • Which menu item are you using to open the REPL, and which `Main.sublime-menu` file did you edit to set the `"cwd"` value? – MattDMo Jan 25 '16 at 16:04
  • I open the iPython from: tools->SublimeREPL->Python->Python-IPython. This opens my jupyter Ipython console. And the file whose cwd I edited is in : /home/sam/.config/sublime-text-/Packages/SublimeREPL/config/Python/Main.sublime-menu – Sam Jan 26 '16 at 10:15
  • Try my solution: https://stackoverflow.com/questions/45077749/why-sublimerepl-wont-import-a-python-module-or-read-a-file-in-cwd – z33k Jul 13 '17 at 11:43

0 Answers0