Hi, I think, the main problem is at which step the environment is set up. One cannot compare eric4 being started via a desktop shortcut or menu entry and a Python shell started from a terminal window because the environment will be different.
To compare the two setups, one has to start eric4 in a terminal window as well (just type "eric4") and check, if the behaviour is different. As to the matplotlib problem mentioned by Serge I wasn't able to run the samples provided because I get a segfault (even when run in a Python shell started from the terminal). That may be a problem of my computer setup over here. Regards, Detlev On Dienstag, 23. Dezember 2008, Robert Cheatham wrote: > Thanks, Serge. > > Our problems give similar results but I bet that it has something to > do with the environment I'm working in. We have hundreds of projects > and we have to import a new environment into the shell every time we > want to work on something. I suspect it has something to do with the > configuration the systems admins have set up. Like you said, you > don't have the problem with inheriting the PYTHONPATH, and neither did > Detlev or Sjujsckij. > > Hopefully I can get this fixed and start using Eric after the > holidays. We have one camp that are the hard-core command line guys > that don't really care about IDE's, and the other camp are people that > don't have a programming background but have learned to use Python and > just debug with print statements. If I can get Eric4 to work I know I > can get that second camp to use Eric and that they'd love it! :) Also > it would make my life much easier. > > Best, > Robert > > On Tue, Dec 23, 2008 at 11:03 PM, Serge Montagnac <[email protected]> wrote: > > Robert Cheatham wrote: > > > > The Python versions are the same. I think I'll need to consult some of > > the wiser people around here when they get back from holiday. I was > > hoping it was something simple but there are probably some strange things > > about our environment that I don't understand. I'll post again once I > > get it figured out. > > > > Thanks to everyone for your helpful responses! > > > >> Пожалуйста > > > > I can't compete with that. :) > > > > On Tue, Dec 23, 2008 at 8:46 AM, Sjujsckij Nickolaj <[email protected]> wrote: > >> Also see if Python shell and eric run the same Python (not 2.4 and 2.5, > >> for example), as you use quite old system. And try to work out, what's > >> the difference between PYTHONPATHs and if you're lucky eliminate the > >> reason. Dou you have Eric (and dependencies) properly installed, by the > >> way? You know, .deb's from repositories, apt-get install and so on. For > >> here Eric picks up variables all right too. > >> > >>> Tusen takk. > >> > >> Пожалуйста (-:E > >> > >>> Ha ha ha! My fault. It's actually Kubuntu 7.*, running KDE 3.5.6. > >>> Thank you for your response. > >>> > >>> Yes, when running Python from the shell, the 'sys.path' variable has > >>> included the information in the 'PYTHONPATH' variable from the shell. > >>> Additionally, running the commands "os.environ['PYTHONPATH']" and > >>> "os.system('echo $PYTHONPATH')" outputs the correct 'PYTHONPATH' > >>> information. > >>> > >>> However, it appears that Eric4 creates its own environment. The > >>> 'sys.path' variable does not include the 'PYTHONPATH' information from > >>> the shell in which Eric4 was started. Also, while the > >>> "os.environ['PATH']" and "os.system( 'echo $PATH')" commands work > >>> properly when run from Eric4, their values are different from the > >>> 'PATH' variable in the original shell. The "os.environ['PYTHONPATH']" > >>> and "os.system('echo $PYTHONPATH')" commands fail, indicating that the > >>> environment created by Eric4 is not the same as in the original shell. > >>> > >>> The above may be intentional, however I would like to be able to do > >>> one of the following: > >>> > >>> 1) Get Eric4 to inherit the PYTHONPATH information from the shell in > >>> which it is launched > >>> > >>> 2) Copy-paste the information from the PYTHONPATH variable into a > >>> search path in the Eric4 project. > >>> > >>> 3) Run a short script at the beginning of my programs something to the > >>> effect of this: > >>> newPaths = os.system( "Get PYTHONPATH info from original shell" > >>> ) sys.path.append( newPaths ) > >>> > >>> Options 1) and 3) are preferable so that all the environment info will > >>> be picked up automatically. > >>> > >>> If neither option is possible, I can manually insert the search paths > >>> using multiple "sys.path.append()" commands, but this will be a > >>> maintenance headache and will be tougher to convince others to move > >>> away from print statement debugging. I am, of course, open to > >>> other/better options. > >>> > >>> Tusen takk. > >>> --Robert > >>> > >>> On Sun, Dec 21, 2008 at 10:38 AM, Sjujsckij Nickolaj <[email protected]> wrote: > >>>> Hello > >>>> I think you should learn about modules and their paths in Python. For > >>>> example, I don't know what is module gto, probably it's your own one, > >>>> and you rely on current dir importing it... So read about PYTHONPATH > >>>> and inspect its value in your user shell, python and Eric shells > >>>> (sys.path), and remember about importing from current directory. > >>>> > >>>>> Using Eric4 v4.2.3 (r2620) on KDE 7. > >>>> > >>>> Whoops! Could you lend me your time machine? (-:E > >>>> > >>>>> I still haven't been able to figure this out. > >>>>> > >>>>> More specifics, I'm importing a module named "gto" as such: > >>>>>> import gto > >>>>> > >>>>> This works fine if I run my python script from the command line. > >>>>> When I debug the script in Eric4 I get the following error > >>>>> > >>>>>> The debugged program raised the exception ImportError > >>>>>> "No module named gto" > >>>>> > >>>>> So I'm wondering how I can get Eric4 to import the environment from > >>>>> the shell. Or at least how I can specify the paths in which Eric4 > >>>>> will look for modules. > >>>>> > >>>>> Using Eric4 v4.2.3 (r2620) on KDE 7. > >>>>> > >>>>> Thanks, > >>>>> Robert > >>>>> > >>>>> On Tue, Dec 16, 2008 at 4:18 PM, Robert Cheatham > >>>>> > >>>>> <[email protected]> wrote: > >>>>>> I'm trying to use Eric4 for python debugging in Linux > >>>>>> > >>>>>> I'm having a problem with imported modules. These modules are found > >>>>>> somewhere in our system's path variables (not sure where). The > >>>>>> project I'm trying to debug works fine when run from the command > >>>>>> line (and when debugged under pdb), but Eric4 apparently doesn't > >>>>>> pick up the environment from the shell in which it was started, so > >>>>>> an error is thrown when attempting to import certain modules. > >>>>>> > >>>>>> I'm used to working on Visual Studio, so my first instinct was to > >>>>>> just copy the information from the path variables into the the path > >>>>>> variable in the Eric4 project. I can't figure out how to do this. > >>>>>> Is there a way to get Eric4 to either pick up the environment > >>>>>> variables from the shell or to transfer the path information so that > >>>>>> Eric4 can use it? > >>>>>> > >>>>>> Using Eric4 v4.2.3 (r2620) on KDE 7. > >>>>>> > >>>>>> > >>>>>> Thank you. > >>>>> > >>>>> _______________________________________________ > >>>>> Eric mailing list > >>>>> [email protected] > >>>>> http://www.riverbankcomputing.com/mailman/listinfo/eric > >> > >> -- > >> Trollen pynkere vrekukka! > >> Ŝtérkrìg > >> _______________________________________________ > >> Eric mailing list > >> [email protected] > >> http://www.riverbankcomputing.com/mailman/listinfo/eric > > > > ________________________________ > > _______________________________________________ > > Eric mailing list > > [email protected] > > http://www.riverbankcomputing.com/mailman/listinfo/eric > > > > > > Hi Robert, > > I discussed a bit with Detlev Offenbach concerning modules inclusion in > > Eric4, due to a problem in external classes declaration with Matplotlib > > .... > > > > I think that we have a clear problem, simple to describe : > > > > In Eric4, I declare : > > from mplwidget import MyMplCanvas, Toolbar > > or, > > from mplwidget import * > > > > Eric4 finds MyMplCanvas but complains that it "can't import name Toolbar > > ". > > > > If I write the class Toolbar() in the main module .... it works, > > Toolbar class is found, for sure ;-) > > > > If I launch the program from command line : python the_program.py > > ....it works perfectly with either the first or second import > > declaration. > > > > > > I conclude that Eric4 as a problem importing several classes declared in > > an external module. > > > > What do think about that, .... I did not experienced any problem with > > PYTHONPATH, but I am using the traditional /usr/lib/python tree .... > > > > My config is Mandriva-2008-1: > > Python 2.5.2 > > From RiverBanks : > > Qt 4.3.4 > > sip 4.7.7 > > QScintilla 2.3 > > eric4 4.2.4a(r2717) > > > > Best regards, > > Serge. > > > > -- > > > > /* If Linux doesn't have the solution, you have the wrong problem */ > > -------------------------- > > Serge Montagnac > > http://www.obs-psr.com > > [email protected] > > -------------------------- > > _______________________________________________ > Eric mailing list > [email protected] > http://www.riverbankcomputing.com/mailman/listinfo/eric -- Detlev Offenbach [email protected] _______________________________________________ Eric mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/eric
