Skip to content

PyCharm has problems with IPython working inside PyPy created by virtualenv #3713

@imperialguy

Description

@imperialguy

Some version info:

OS: Mac OS X 10.8.4
Python: 2.7.2 (that came with the Mac OS X)
PyPy: 2.0.2
IPython: 0.13.2
PyCharm: 2.5.1

PyCharm's Python console fails when PyPy and IPython co-exist in a virtualenv created project.

I created three virtual environment projects. I did not activate any of the virtual environments. So, the system python still exists as it is.

Env - 1:

$ virtualenv -p /path/to/system/installed/python /path/to/sample_1/virtualenv/project
$ /path/to/sample_1/virtualenv/project/bin/pip install ipython

Now, when I run the python console in PyCharm it works fine. (Interpreter in PyCharm is set to /path/to/sample_1/virtualenv/project/bin/python)

Env - 2: Works Fine when I run the python console in PyCharm

$ virtualenv -p /path/to/pypy /path/to/sample_2/virtualenv/project

Now, when I run the python console in PyCharm it works fine. (Interpreter in PyCharm is set to /path/to/sample_2/virtualenv/project/bin/python)

Env - 3:

$ virtualenv -p /path/to/pypy /path/to/sample_3/virtualenv/project
$ /path/to/sample_3/virtualenv/project/bin/pip install ipython

Now, when I run the python console in PyCharm it fails with the following error. (Interpreter in PyCharm is set to /path/to/sample_3/virtualenv/project/bin/python)

/path/to/sample_3/virtualenv/project/bin/pypy -u /Applications/PyCharm.app/helpers/pydev/pydevconsole.py 60355 60356
PyDev console: using IPython 0.13.2
Traceback (most recent call last):
  File "app_main.py", line 72, in run_toplevel
  File "/Applications/PyCharm.app/helpers/pydev/pydevconsole.py", line 361, in <module>
    StartServer(pydev_localhost.get_localhost(), int(port), int(client_port))
  File "/Applications/PyCharm.app/helpers/pydev/pydevconsole.py", line 288, in StartServer
    interpreter = InterpreterInterface(host, client_port, threading.currentThread())
  File "/Applications/PyCharm.app/helpers/pydev/pydev_ipython_console.py", line 37, in __init__
    self.interpreter = PyDevFrontEnd()
  File "/Applications/PyCharm.app/helpers/pydev/pydev_ipython_console_011.py", line 35, in __init__
    shell = TerminalInteractiveShell.instance()
  File "/path/to/sample_3/virtualenv/project/site-packages/IPython/config/configurable.py", line 318, in instance
    inst = cls(*args, **kwargs)
  File "/path/to/sample_3/virtualenv/project/site-packages/IPython/frontend/terminal/interactiveshell.py", line 360, in __init__
    user_module=user_module, custom_exceptions=custom_exceptions
  File "/path/to/sample_3/virtualenv/project/site-packages/IPython/core/interactiveshell.py", line 454, in __init__
    self.init_readline()
  File "/path/to/sample_3/virtualenv/project/site-packages/IPython/core/interactiveshell.py", line 1843, in init_readline
    self.refill_readline_hist()
  File "/path/to/sample_3/virtualenv/project/site-packages/IPython/core/interactiveshell.py", line 1851, in refill_readline_hist
    self.readline.clear_history()
  File "/tmp/pypy-2.0.2/lib_pypy/pyrepl/readline.py", line 284, in clear_history
    del self.get_reader().history[:]
  File "/tmp/pypy-2.0.2/lib_pypy/pyrepl/readline.py", line 188, in get_reader
    console = UnixConsole(self.f_in, self.f_out, encoding=ENCODING)
  File "/tmp/pypy-2.0.2/lib_pypy/pyrepl/unix_console.py", line 98, in __init__
    curses.setupterm(term, self.output_fd)
error: setupterm: could not find terminfo database
    Process finished with exit code 1

image

Seems like this is related to this, but I am not sure.

Please help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions