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

Fixes to get for python3 virtualenvs working #140

Closed
wants to merge 2 commits into from

Conversation

jeethu
Copy link

@jeethu jeethu commented Apr 23, 2014

I've been happily using powerline-shell on OSX for quite some time now. Thanks for building it.

I created a Python 3.4 virtualenv using Python3's builtin pyvenv command and powerline-shell would break anytime I activate it, powerline-shell would barf out. I decided to spend some time making things cross compatible between python2 (>= 2.6) and python3. It turned out to be far easier than I'd anticipated it to be.

I've been using this patched version for the past couple of days with Python 2.7 and Python 3.4. I found that this issue had been reported earlier on #118, but I couldn't find a way to attach a pull request against that issue. I've also got another branch with a few pep8 fixes on top of this, but that should probably be addressed separately.

@b-ryan b-ryan mentioned this pull request Nov 20, 2015
8 tasks
@b-ryan b-ryan closed this Nov 22, 2015
@benklaasen
Copy link

Hi - I'm on the latest powerline-shell on Xubuntu 15.10. Invoking bin/activate in a virtualenv created with pyvenv from the 15.10 repo still effectively hangs my shell. Here's the output of source bin/activate after running set -x:

+ source bin/activate
++ deactivate nondestructive
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n /bin/bash -o -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/home/ben/bin/Jupyter
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/home/ben/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/ben/bin:/home/ben/.local/bin/:.
++ PATH=/home/ben/bin/Jupyter/bin:/home/ben/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/ben/bin:/home/ben/.local/bin/:.
++ export PATH
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1='\[\e[38;5;250m\]\[\e[48;5;240m\] \u \[\e[48;5;238m\]\[\e[38;5;240m\]\[\e[38;5;250m\]\[\e[48;5;238m\] \h \[\e[48;5;31m\]\[\e[38;5;238m\]\[\e[38;5;15m\]\[\e[48;5;31m\] ~ \[\e[48;5;237m\]\[\e[38;5;31m\]\[\e[38;5;250m\]\[\e[48;5;237m\] bin \[\e[48;5;237m\]\[\e[38;5;244m\]\[\e[38;5;250m\]\[\e[48;5;237m\] Jupyter \[\e[48;5;236m\]\[\e[38;5;237m\]\[\e[38;5;15m\]\[\e[48;5;236m\] \$ \[\e[0m\]\[\e[38;5;236m\]\[\e[0m\] '
++ '[' 'x(Jupyter) ' '!=' x ']'
++ PS1='(Jupyter) \[\e[38;5;250m\]\[\e[48;5;240m\] \u \[\e[48;5;238m\]\[\e[38;5;240m\]\[\e[38;5;250m\]\[\e[48;5;238m\] \h \[\e[48;5;31m\]\[\e[38;5;238m\]\[\e[38;5;15m\]\[\e[48;5;31m\] ~ \[\e[48;5;237m\]\[\e[38;5;31m\]\[\e[38;5;250m\]\[\e[48;5;237m\] bin \[\e[48;5;237m\]\[\e[38;5;244m\]\[\e[38;5;250m\]\[\e[48;5;237m\] Jupyter \[\e[48;5;236m\]\[\e[38;5;237m\]\[\e[38;5;15m\]\[\e[48;5;236m\] \$ \[\e[0m\]\[\e[38;5;236m\]\[\e[0m\] '
++ export PS1
++ '[' -n /bin/bash -o -n '' ']'
++ hash -r
++ _update_ps1
+++ /home/ben/bin/powerline-shell/powerline-shell.py 0
++ PS1=

Let me know if you need more information.

This isn't specific to pyvenv; the same thing happens using virtualenv to set up a Python 3 virtual environment:

$ virtualenv -p $(which python3) .
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in ./bin/python3
Also creating executable in ./bin/python
Installing setuptools, pip...done.
$ source bin/activate

@benklaasen
Copy link

Just to correct an earlier mistaken claim: my shell is responsive, there's just no prompt. Line editing works fine.

@benklaasen
Copy link

OK, I was being a dope; I'd failed to run install.py after doing a git pull.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants