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

Out of the box xonsh will not execute within a Python Virtual Env on Windows 10 #4

Open
eruber opened this issue Jul 12, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@eruber
Copy link

eruber commented Jul 12, 2019

After downloading and unarchiving xonsh-master.zip, and then following the "Windows Install from Source" directions at https://xon.sh/windows.html, the following (abbreviated) console output was generated;

python -m venv TEST_XONSH
TEST_ONSH\Scripts\activate.bat
(TEST_ONSH) > pip list
Package Version


pip 10.0.1
setuptools 39.0.1

(TEST_XONSH) xonsh-master>python
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

^Z

(TEST_ONSH) > pip install prompt-toolkit
(TEST_ONSH) > pip list
Package Version


pip 19.1.1
prompt-toolkit 2.0.9
setuptools 39.0.1
six 1.12.0
wcwidth 0.1.7
(TEST_ONSH) > cd xonsh-master
(TEST_ONSH) xonsh-master> python setup.py install
<<much output deleted, which I have if questions arise.>>
(TEST_XONSH) > xonsh-master>xonsh
xonsh-master\xonsh_amalgam_.py:16197: UserWarning: prompt_toolkit is not available, using readline instead.
"prompt_toolkit is not available, using " "readline instead."
Skipping setup. Because no readline implementation available.
Please install a backend (readline, prompt-toolkit, etc) to use
xonsh interactively.
See xonsh/xonsh#1170

After looking at xonsh code and sampling sys.path at runtime, I determined what the problem and fix was...

The reason this error happens is because the xonsh.bat file is making decisions about what Python interpreter to use; namely the one in C:\Windows\py.exe (who put that there??) rather than the one in the defined virtual env.

Replacing xonsh.bat with just the single line:
python -m xonsh %*
fixes the problem; so does just invoking the xonsh module like this:

(TEST_XONSH) xonsh-master>python -m xonsh --version
xonsh/0.9.6

My expectations were that the application would do nothing to automatically select a python interpreter; since the virtual environment creation and "activation" takes care of all those details so the virtual environment is usable.

I am looking forward to playing with xonsh. Thanks for working so hard, writing so much code, and releasing it for others to use!!

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

@scopatz
Copy link
Member

scopatz commented Jul 22, 2019

Thanks for opening this @eruber - PRs very welcom here!

@anki-code anki-code added the bug Something isn't working label Feb 13, 2021
@anki-code anki-code transferred this issue from xonsh/xonsh Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants