0

So I have installed on [my Windows 10]:

  • Python3 Anaconda Distribution
  • Sublime Text 3
  • Sublime REPL
  • Sublime Virtualenv

I am trying to get the SublimeREPL python - virtualenv to work. Currently having no luck.

The virtualEnv Repl closes out when I open it.

tools -> SublimeREPL -> Python -> python - virtualEnv

The REPL pops up, then gives me this:

C:\Users\joshu\Anaconda3\lib\site-packages\IPython\config.py:13: ShimWarning: The `IPython.config` package has been deprecated. You should import from traitlets.config instead.
  "You should import from traitlets.config instead.", ShimWarning)
C:\Users\joshu\Anaconda3\lib\site-packages\IPython\terminal\console.py:13: ShimWarning: The `IPython.terminal.console` package has been deprecated. You should import from jupyter_console instead.
  "You should import from jupyter_console instead.", ShimWarning)
Traceback (most recent call last):
  File "C:\Users\joshu\AppData\Roaming\Sublime Text 3\Packages/SublimeREPL/config/Python/ipy_repl.py", line 52, in <module>
    embedded_shell.initialize()
  File "<decorator-gen-114>", line 2, in initialize
  File "C:\Users\joshu\Anaconda3\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\joshu\Anaconda3\lib\site-packages\jupyter_console\app.py", line 137, in initialize
    self.init_shell()
  File "C:\Users\joshu\Anaconda3\lib\site-packages\jupyter_console\app.py", line 110, in init_shell
    client=self.kernel_client,
  File "C:\Users\joshu\Anaconda3\lib\site-packages\traitlets\config\configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "C:\Users\joshu\Anaconda3\lib\site-packages\jupyter_console\ptshell.py", line 252, in __init__
    self.init_prompt_toolkit_cli()
  File "C:\Users\joshu\Anaconda3\lib\site-packages\jupyter_console\ptshell.py", line 404, in init_prompt_toolkit_cli
    self.pt_cli = CommandLineInterface(app, eventloop=self._eventloop)
  File "C:\Users\joshu\Anaconda3\lib\site-packages\prompt_toolkit\interface.py", line 80, in __init__
    self.output = output or create_output()
  File "C:\Users\joshu\Anaconda3\lib\site-packages\prompt_toolkit\shortcuts.py", line 114, in create_output
    return Win32Output(stdout)
  File "C:\Users\joshu\Anaconda3\lib\site-packages\prompt_toolkit\terminal\win32_output.py", line 80, in __init__
    info = self.get_win32_screen_buffer_info()
  File "C:\Users\joshu\Anaconda3\lib\site-packages\prompt_toolkit\terminal\win32_output.py", line 150, in get_win32_screen_buffer_info
    raise NoConsoleScreenBufferError
prompt_toolkit.terminal.win32_output.NoConsoleScreenBufferError: No Windows console found. Are you running cmd.exe?

***Repl Closed***

Virtual Environment locations

I currently tried three locations for my virtual environment, none of which work.

Project folder:

C:\users\joshu\documents\Code\Sentient-CNC

Home Envs folder

C:\users\joshu\Envs

SublimeREPL default venv volder

C:\users\joshu\ .venv

in my user settings I have python_virtualenvs_paths variable set:

    // Where to look for python virtualenvs
    {
    "python_virtualenv_paths": [
        "~\\Documents\\Code\\Sentient-CNC",
        "~\\.venv",  // venv.bash https://github.com/wuub/venv
        "~\\Envs"
    ]
}

I don't think it matters, but I switched the '/' to ' \ ' as a means to troubleshoot my issue but it did not change anything.

the console log does not generate any error when running this.

I've also tried first activating a virtual environment in terminal then running SublimeREPL but this doesn't change anything.

Path information

System variables

from Cygwin:

joshua@Josh-Laptop ~
$ which python
/cygdrive/c/Users/joshu/Anaconda3/python

joshua@Josh-Laptop ~
$ where python
C:\Users\joshu\Anaconda3\python.exe
C:\cygwin64\bin\python

from cmd:

C:\Users\joshu>where python
C:\cygwin64\bin\python
C:\Users\joshu\Anaconda3\python.exe

C:\Users\joshu>which python
/usr/bin/python
Joshua Zastrow
  • 1,355
  • 4
  • 17
  • 32

1 Answers1

0

Wow finally got it to work... unfortunately I cannot explain the mechanics, but here are the steps I used:

in the cmd terminal, use conda create to make a virtual environment in my Anaconda package:

conda create venv

in Sublime Text 3, navigate to the SublimeREPL Package settings, and add the path to the Anaconda conda virtualenv folder:

// Where to look for python virtualenvs
{
"python_virtualenv_paths": [
    "~\\Anaconda3\\envs"
]

}

When you choose python - virtualenv from the sublimeREPL Menu, you should be able to select your virtual environment you created earlier and REPL should load it in and work.

Joshua Zastrow
  • 1,355
  • 4
  • 17
  • 32