Bug 1283556 - Does not start if a virtualenv is active
Does not start if a virtualenv is active
Status: NEW
Product: Fedora
Classification: Fedora
Component: gnome-tweak-tool (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Mohamed El Morabity
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-11-19 04:50 EST by Gianluca Sforna
Modified: 2018-03-05 09:03 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gianluca Sforna 2015-11-19 04:50:08 EST
Activating a virtualenv and then running gnome-tweak-tools results in an error like:

$ gnome-tweak-tool 
Traceback (most recent call last):
  File "/usr/bin/gnome-tweak-tool", line 23, in <module>
    import gi
ImportError: No module named 'gi'

This is the result of the main executable running python like:

#!/usr/bin/env python

so it picks up the current python runtime and not the intended one (python 2?)

The python script should be patched to run with %{__python2}
Comment 1 Fedora End Of Life 2016-11-24 08:34:39 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. 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 '23'.

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 23 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 2 Felix Schwarz 2016-12-08 11:23:22 EST
still present in master. Mohamed: Should I send/commit a patch?
Comment 3 Jun Aruga 2017-02-27 06:59:49 EST
I have same situation for my environment (f25).

$ rpm -q gnome-tweak-tool

I am using source compiled python.

$ which python

I want you to fix this, though right now I am using changing `/usr/bin/gnome-tweak-tool` from `#!/usr/bin/env python` to `#!/usr/bin/python`.

I also show you the result of `rpmlint` as a reference.

$ rpmlint -i ./*.spec /var/lib/mock/fedora-rawhide-x86_64/result/*.rpm
gnome-tweak-tool.noarch: E: wrong-script-interpreter /usr/bin/gnome-tweak-tool /usr/bin/env python
This script uses an interpreter which is either an inappropriate one or
located in an inappropriate directory for packaged system software.

gnome-tweak-tool.noarch: W: no-manual-page-for-binary gnome-tweak-tool
Each executable in standard binary directories should have a man page.

2 packages and 1 specfiles checked; 1 errors, 1 warnings.

Thank you.
Comment 4 Fedora End Of Life 2017-02-28 04:50:35 EST
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.
Comment 5 Jun Aruga 2018-03-05 09:03:44 EST
Humm, this issue is still not fixed.

To Someone struggling for this issue.

Change the below shebang line manually to "#!/usr/bin/python3" or "#!/usr/bin/python" for old version of gnome-tweak-tool.

$ rpm -qf /usr/bin/gnome-tweak-tool

$ cat /usr/bin/gnome-tweak-tool | head -1
#!/usr/bin/env python3

I wish this logic is executed in genome-tweak-tool.spec file.

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