Bug 1402486 - workon completion barfs when only python 3 virtualenvwrapper installed
Summary: workon completion barfs when only python 3 virtualenvwrapper installed
Keywords:
Status: CLOSED DUPLICATE of bug 1386134
Alias: None
Product: Fedora
Classification: Fedora
Component: python-virtualenvwrapper
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Charalampos Stratakis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-07 16:16 UTC by Ville Skyttä
Modified: 2018-02-13 03:04 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-13 03:04:49 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1386134 0 unspecified CLOSED mkvirtualenv does not work with python3-virtualenvwrapper 2021-02-22 00:41:40 UTC

Internal Links: 1386134

Description Ville Skyttä 2016-12-07 16:16:38 UTC
When just python3-virtualenvwrapper is installed (no python2-virtualenvwrapper), the workon bash completion barfs:

| $ workon <TAB>
| /usr/bin/python: No module named virtualenvwrapper
| virtualenvwrapper.sh: There was a problem running the initialization hooks. 
| 
| If Python could not import the module virtualenvwrapper.hook_loader,
| check that virtualenvwrapper has been installed for
| VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
| set properly.

Most likely in this case the script should be invoking python3 instead of /usr/bin/python.

Comment 1 Rodolfo Carvalho 2017-01-05 10:14:52 UTC
I ran into the same problem today.

Perhaps the culprit is that /usr/bin/virtualenvwrapper.sh provided by python3-virtualenvwrapper has these lines (that work well for Python 2):

---

# Locate the global Python where virtualenvwrapper is installed.
if [ "$VIRTUALENVWRAPPER_PYTHON" = "" ]
then
    VIRTUALENVWRAPPER_PYTHON="$(command \which python)"
fi

---


I think the python3-virtualenvwrapper package could be patched to look for python3 instead?

As a workaround, one can set VIRTUALENVWRAPPER_PYTHON explicitly (e.g., in ~/.bashrc).

Adding VIRTUALENVWRAPPER_PYTHON=python3 in .bashrc works for me.

Comment 2 Rodolfo Carvalho 2017-01-05 10:16:22 UTC
I think the underlying problem is the same as in
https://bugzilla.redhat.com/show_bug.cgi?id=1386134

Comment 3 Fedora End Of Life 2017-11-16 19:47:55 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2017-12-12 10:51:00 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Mike Goodwin 2018-02-13 02:57:54 UTC
Resurrecting this due to the fact that it is still an issue.

As fedora drags kicking and screaming into being all python3 by default, i think we seriously need to get this fixed. 

Beyond this just not working correctly, it also creates Python2 virtual environments! I'll try and evaluate whether or not that warrants another bug.

Comment 6 Mike Goodwin 2018-02-13 03:04:49 UTC

*** This bug has been marked as a duplicate of bug 1386134 ***


Note You need to log in before you can comment on or make changes to this bug.