Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wenv ipython - terminal stays blank #7

Open
stuaxo opened this issue Dec 11, 2019 · 7 comments
Open

wenv ipython - terminal stays blank #7

stuaxo opened this issue Dec 11, 2019 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@stuaxo
Copy link

stuaxo commented Dec 11, 2019

I'm guessing this might be tricky to get working, but the ipython shell doesn't seem to do anything on launch and then I have to shut the terminal window.

I'm guessing it's because ipython is doing something weird / advanced with the console that doesn't translate well.

@s-m-e
Copy link
Member

s-m-e commented Dec 12, 2019

I am getting a little further, though only little. It hangs on first command sent.

wenv ipython
c:\python-3.7.4\lib\site-packages\IPython\core\interactiveshell.py:925: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
  warn("Attempting to work in a virtualenv. If you encounter problems, please "
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.10.1 -- An enhanced Interactive Python. Type '?' for help.
[TerminalIPythonApp] WARNING | Unknown error in handling PYTHONSTARTUP file /etc/pythonstart:
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
c:\python-3.7.4\lib\site-packages\IPython\core\shellapp.py in _exec_file(self, fname, shell_futures)
    338                                                  self.shell.user_ns,
    339                                                  shell_futures=shell_futures,
--> 340                                                  raise_exceptions=True)
    341         finally:
    342             sys.argv = save_argv

c:\python-3.7.4\lib\site-packages\IPython\core\interactiveshell.py in safe_execfile(self, fname, exit_ignore, raise_exceptions, shell_futures, *where)
   2710                 py3compat.execfile(
   2711                     fname, glob, loc,
-> 2712                     self.compile if shell_futures else None)
   2713             except SystemExit as status:
   2714                 # If the call was made with 0 or None exit status (sys.exit(0)

c:\python-3.7.4\lib\site-packages\IPython\utils\py3compat.py in execfile(fname, glob, loc, compiler)
    186     with open(fname, 'rb') as f:
    187         compiler = compiler or compile
--> 188         exec(compiler(f.read(), fname, 'exec'), glob, loc)
    189 
    190 # Refactor print statements in doctests.

Z:\etc\pythonstart in <module>
      5 import atexit
      6 import os
----> 7 import readline
      8 import rlcompleter
      9 

ModuleNotFoundError: No module named 'readline'

In [1]: a = 1 

Killed

Educated guess: In my case, there are two issues. The Python build that I am using comes without 'readline' support. This may be a problem, but ipython works without it. Second, it appears to detect Unix environment variables from the surrounding virtual environment. This should not happen. I guess I need to obfuscate them.

@stuaxo
Copy link
Author

stuaxo commented Dec 12, 2019

I seem to recall using pyreadline with ipython (can't remember which circumstances though).

@s-m-e
Copy link
Member

s-m-e commented Dec 12, 2019

I experimented with pyreadline on Wine a while ago. It did not work particularly well, though maybe I can track down the root cause.

@stuaxo
Copy link
Author

stuaxo commented Dec 12, 2019

Whatever gets used it's proably best if it to works as if it's in an ordinary terminal.
Acting as if it's in the Windows console and then having wine translate to escape sequences is going to add another layer that's not needed.

@s-m-e
Copy link
Member

s-m-e commented Dec 12, 2019

pyreadline still does not work well. It breaks the wenv python repl. ipython still hangs. The project is pretty much dead, but there are plenty of forks with useful patches. It's beyond my time to restore it, but it might be worth looking into if you're interested.

Second, it appears to detect Unix environment variables from the surrounding virtual environment. This should not happen. I guess I need to obfuscate them.

Confirmed. Added to the development branch.

@s-m-e s-m-e added bug Something isn't working help wanted Extra attention is needed labels Nov 20, 2021
@s-m-e
Copy link
Member

s-m-e commented Nov 24, 2021

On a recent versions of wenv (just released v0.3.0), Wine (6.x), Python (3.10) and ipython (7.29), I at least get to a command prompt. Hitting enter after having typed my first command crashes ipython. So, improvement, of sorts.

@stuaxo
Copy link
Author

stuaxo commented Nov 26, 2021

I haven't looked to see how wenv communicates to the wine side.

I re-created the wenv environment, and installed ipython without pyreadline. One thing I noticed is that pressing enter just displays ^M instead of sending a newline.

If this was all Linux, then it would seem like stty could sort it out. Is there some way that escaping is happening, or alternately something is interpreting the input.

I wonder if it's do with how the communication from one side to the other works, and this is confusing IPython on the other end ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants