Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1087  / 2 Years ago, fri, may 20, 2022, 6:27:24

Diffuse is installed on my workstation and plays well with Mercurial so I often use it for diff'ing. However, I also am using a Python virtualenv to use some different modules in a more controlled setting (easier to ship off to other people). When I try to run Diffuse from within my virtualenv (here named sandbox) it pukes:



(sandbox)nickt@aiguadassi:/home/codes/nickt/Tape-Worms/Code
$ diffuse bread.py # fail...
Traceback (most recent call last):
File "/usr/bin/diffuse", line 124, in <module>
import pygtk
ImportError: No module named pygtk


Outside it works just fine...



(sandbox)nickt@aiguadassi:/home/codes/nickt/Tape-Worms/Code
$ deactivate
nickt@aiguadassi:/home/codes/nickt/Tape-Worms/Code
$ diffuse bread.py # works fine.


I assume Diffuse is a Python app and is relying on finding modules in the environment; is there a way to have it use the 'global' environment (e.g. via an alias)? I'm not sure what the program is doing with respect to the environment...is it searching through PATH for modules, trying to use whatever which python turns up...


More From » bash

 Answers
5

Another option is to add an alias to your ~/.bashrc file:



alias diffuse='/usr/bin/python /usr/bin/diffuse'


This prevents things breaking when diffuse is updated.


[#31197] Saturday, May 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mentpengu

Total Points: 148
Total Questions: 114
Total Answers: 119

Location: Anguilla
Member since Sun, Aug 7, 2022
2 Years ago
;