I created a simple, representative example that shows what is going wrong.
I created a project with directory structure as follows:
/test_workspace
> /packageOne
> __init__.py
> moduleOne.py
> /packageTwo
> __init__.py
>
moduleOne.py is a one-liner:
import packageTwo
>
I opened moduleOne and told it to run in test_workspace. It broke on the
import, and I interactively debugged it.
Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32)
> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on
> jacob-laptop, Standard
> >>> >>>
> >>> import packageTwo
> Traceback (innermost last):
> File "<stdin>", line 1, in <module>
> ImportError: No module named packageTwo
>> >>> import sys,os,os.path as p
> >>> sys.path
> [u'/home/jacob/test_workspace/packageOne',
> '/usr/lib/python2.5/site-packages/eric4/DebugClients/Python',
> '/usr/lib/python25.zip', '/usr/lib/python2.5',
> '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk',
> '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages',
> '/usr/lib/python2.5/site-packages',
> '/usr/lib/python2.5/site-packages/Numeric',
> '/var/lib/python-support/python2.5', '/var/lib/python-support/python2.5/gtk-
> 2.0']
> >>> p.realpath(p.curdir)
> '/home/jacob/test_workspace'
> >>> sys.path = sys.path + ['']
> >>> sys.path
> [u'/home/jacob/test_workspace/packageOne',
> '/usr/lib/python2.5/site-packages/eric4/DebugClients/Python',
> '/usr/lib/python25.zip', '/usr/lib/python2.5',
> '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk',
> '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages',
> '/usr/lib/python2.5/site-packages',
> '/usr/lib/python2.5/site-packages/Numeric',
> '/var/lib/python-support/python2.5', '/var/lib/python-support/python2.5/gtk-
> 2.0', '']
> >>> import packageTwo
> >>>
>
So it worked after I added the empty path ('') to eric's pythonpath.
Please note that my path in my ordinary system python interpreter is as
follows:
['', '/usr/lib/python25.zip', '/usr/lib/python2.5',
> '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk',
> '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages',
> '/usr/lib/python2.5/site-packages',
> '/usr/lib/python2.5/site-packages/Numeric',
> '/var/lib/python-support/python2.5', '/var/lib/python-support/python2.5/gtk-
> 2.0']
>
Note that it contains the empty path. When I start the system python
interpreter in test_workspace, I am able to import packageTwo correctly.
Conclusions:
1. Eric uses a different pythonpath than the one on my system, and
excludes some paths from it. In this case, it is the empty path ('').
2. For some reason, the empty path is necessary to import packages
that are in the current working directory. I didn't know this, but I guess
that's how it works.
3. Because eric excludes the empty path, it is impossible for modules
created in packages created in the same directory to import one-another.
I'm not sure if I should file this should be filed as a bug-report, or if
this is simply a matter of configuring the pythonpath used by eric. However,
I wasn't able to find a way to configure eric's pythonpath.
I guess it's also possible that this is a regression in a recent snapshot
(I'm using eric4 4.1-snapshot20071224).
I'd greatly appreciate any guidance anyone could offer.
Much thanks.
Jake
On Dec 30, 2007 3:28 PM, Evren Esat Özkan <sleytr at gmail.com> wrote:
> But you don't have to. You can import modules from packages located in
> same folder with your script.
> As I said before, I removed django from site-packages and relocated to the
> project folder and it worked.
> I can't imagine any cause for your problem but I think it can't be related
> with pythonpath and/or eric's default settings.
> May be you should try a clean install of eric4 with a simple test script.
> (two modules importing one to other.)
>>>> On Sun, 30 Dec 2007 22:12:31 +0200, Jake B <otakuj462 at gmail.com> wrote:
>> > Tricky.
> > I guess maybe the best way to deal this, then is to symlink everything
> in
> > site-packages.
> > If anyone has any ideas about how else to do this, please let me know.
> > Thanks.
> >
> > Jake
> >
> > On Dec 30, 2007 3:08 PM, Evren Esat Özkan <sleytr at gmail.com> wrote:
> >
> >> It's sym.linked to site-packages. But just for testing I moved that
> link
> >> to the project folder and it worked again.
> >>
> >>
> >> On Sun, 30 Dec 2007 21:53:38 +0200, Jake B <otakuj462 at gmail.com> wrote:
> >>
> >> > Is your django package installed locally as part of the project, or
> >> > globally
> >> > in someplace like /usr/lib?
> >> > Please let me know. Thanks.
> >> >
> >> > Jake
> >> >
> >> > On Dec 30, 2007 2:34 PM, Evren Esat Özkan <sleytr at gmail.com> wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> I'm using eric for Django based web development for last four months
> >> but
> >> >> never used it's debugging features. I'm not using eric's shell too
> >> >> (`manage.py shell` with ipython is enough for me)
> >> >>
> >> >> But I'm just tried to run one of my projects via running manage.py
> >> with
> >> >> `runserver` argument and it succesfuly started the server then
> >> printed
> >> >> all
> >> >> output to the shell.
> >> >>
> >> >> On 12/30/07, Jake B <otakuj462 at gmail.com> wrote:
> >> >> >
> >> >> > I'm getting a bit confused now, because I've added my eric
> >> workspace
> >> >> to
> >> >> > my PYTHONPATH, and can import all the modules in my eric workspace
> >> >> from the
> >> >> > python interpreter run from any directory on my system, but when
> >> run
> >> >> from
> >> >> > within eric, the modules still cannot import one-another. Also,
> the
> >> >> eric
> >> >> > python interpreter shell cannot import these modules, even though
> >> >> they are
> >> >> > part of my project, and on my global PYTHONPATH.
> >> >> > Is there a best-practices way of making visible python packages
> >> that
> >> >> are
> >> >> > in the same directory and sharing the same project? If not, is
> >> there
> >> >> a way
> >> >> > to at least troubleshoot eric to determine what it is using for
> its
> >> >> > PYTHONPATH?
> >> >> > Please let me know. Thanks.
> >> >> >
> >> >> > Jake
> >> >> >
> >> >> > On Dec 30, 2007 11:42 AM, Jake B < otakuj462 at gmail.com> wrote:
> >> >> >
> >> >> > > PyDev has this feature. When you make a new project, it
> >> >> automatically
> >> >> > > configures your PYTHONPATH for that project. It also gives you a
> >> >> graphical
> >> >> > > way of adding additional paths to PYTHONPATH, and configuring
> >> >> PYTHONPATH to
> >> >> > > reference other projects in the workspace. This makes things
> much
> >> >> easier.
> >> >> > > Perhaps I could put this in as a feature request.
> >> >> > >
> >> >> > > Jake
> >> >> > >
> >> >> > > On Dec 30, 2007 7:45 AM, Flavio Coelho < fccoelho at gmail.com >
> >> wrote:
> >> >> > >
> >> >> > > > Hi Jake,
> >> >> > > >
> >> >> > > > As far as I know Eric does
> >> >> > > > not adds project folders to the Python (though it would be an
> >> >> interesting feature)
> >> >> > > >
> >> >> > > > What I do in my development directories, when I want to import
> >> >> from
> >> >> > > > a package sitting elsewhere (which I don't want to install
> >> >> globally), is to
> >> >> > > > add a symlink to it to a directory where it will be visible to
> >> >> scripts
> >> >> > > > wanting to import it.
> >> >> > > >
> >> >> > > > it is simple and it works for me without having to move or
> copy
> >> >> > > > source files.
> >> >> > > >
> >> >> > > > Flávio
> >> >> > > >
> >> >> > > > On 12/29/07, Jake B < otakuj462 at gmail.com> wrote:
> >> >> > > >
> >> >> > > > > Hi,
> >> >> > > > > I'm trying to use eric4 to debug a django project. To do
> >> this,
> >> I
> >> >> > > > > have django checked out of svn, as well as my application
> >> >> files, and they
> >> >> > > > > are all sharing the same workspace. I have directory
> >> structure
> >> >> that looks
> >> >> > > > > like this:
> >> >> > > > >
> >> >> > > > > workspace_eric/
> >> >> > > > > django/
> >> >> > > > > bin/
> >> >> > > > > ...
> >> >> > > > > __init__.py
> >> >> > > > > fbproject/
> >> >> > > > > fbapp/
> >> >> > > > > __init__.py
> >> >> > > > > models.py
> >> >> > > > > urls.py
> >> >> > > > > views.py
> >> >> > > > > __init.py__
> >> >> > > > > manage.py
> >> >> > > > > settings.py
> >> >> > > > > urls.py
> >> >> > > > >
> >> >> > > > > Unfortunately, my modules in fbproject package cannot import
> >> my
> >> >> > > > > modules in django package, so when I try to start the server
> >> by
> >> >> running
> >> >> > > > > fbproject/manage.py, giving it the command line argument *
> >> >> > > > > runserver*, and the working directory
> >> >> /home/jacob/workspace_eric,
> >> >> > > > > it throws an error. Is eric supposed to configure my
> >> PYTHONPATH
> >> >> for me? If
> >> >> > > > > so, could anyone please let me know what I'm missing?
> >> >> > > > > Thanks.
> >> >> > > > >
> >> >> > > > > Jake
> >> >> > > > >
> >> >> > > > > _______________________________________________
> >> >> > > > > Eric mailing list
> >> >> > > > > Eric at riverbankcomputing.com
> >> >> > > > > http://www.riverbankcomputing.com/mailman/listinfo/eric
> >> >> > > > >
> >> >> > > > >
> >> >> > > >
> >> >> > > >
> >> >> > > > --
> >> >> > > > Flávio Codeço Coelho
> >> >> > > >
> >> ----------------------------------------------------------------
> >> >> > > > "My grandfather once told me that there were two kinds of
> >> people:
> >> >> > > > those who do the work and those who take the credit. He told
> me
> >> >> to try to be
> >> >> > > > in the first group; there was much less competition."
> >> >> > > > Indira Gandhi
> >> >> > > > ====================================
> >> >> > > > registered Linux user # 386432
> >> >> > > > get counted at http://counter.li.org
> >> >> > > >
> >> ----------------------------------------------------------------
> >> >> > >
> >> >> > >
> >> >> > >
> >> >> >
> >> >> > _______________________________________________
> >> >> > Eric mailing list
> >> >> > Eric at riverbankcomputing.com
> >> >> > http://www.riverbankcomputing.com/mailman/listinfo/eric
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >> --
> >> >> Evren Esat ÖZKAN
> >> >> esat.ozkan at asyanet.com
> >>
> >>
> >>
> >> --
> >> Evren Esat Özkan
> >>
>>>> --
> Evren Esat Özkan
>-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/eric/attachments/20071231/05019463/attachment-0001.html
More information about the Eric
mailing list
‘She has never mentioned her father to me. Was he—well, the sort of man whom the County Club would not have blackballed?’ "We walked by the side of our teams or behind the wagons, we slept on the ground at night, we did our own cooking, we washed our knives by sticking them into the ground rapidly a few times, and we washed our plates with sand and wisps of grass. When we stopped, we arranged our wagons in a circle, and thus formed a 'corral,' or yard, where we drove our oxen to yoke them up. And the corral was often very useful as a fort, or camp, for defending ourselves against the Indians. Do you see that little hollow down there?" he asked, pointing to a depression in the ground a short distance to the right of the train. "Well, in that hollow our wagon-train was kept three days and nights by the Indians. Three days and nights they stayed around, and made several attacks. Two of our men were killed and three were wounded by their arrows, and others had narrow escapes. One arrow hit me on the throat, but I was saved by the knot of my neckerchief, and the point only tore the skin a little. Since that time I have always had a fondness for large neckties. I don't know how many of the Indians we killed, as they carried off their dead and wounded, to save them from being scalped. Next to getting the scalps of their enemies, the most important thing with the Indians is to save their own. We had several fights during our journey, but that one was the worst. Once a little party of us were surrounded in a small 'wallow,' and had a tough time to defend ourselves successfully. Luckily for us, the Indians had no fire-arms then, and their bows and arrows were no match for our rifles. Nowadays they are well armed, but there are[Pg 41] not so many of them, and they are not inclined to trouble the railway trains. They used to do a great deal of mischief in the old times, and many a poor fellow has been killed by them." As dusk came on nearly the whole population of Maastricht, with all their temporary guests, formed an endless procession and went to invoke God's mercy by the Virgin Mary's intercession. They went to Our Lady's Church, in which stands the miraculous statue of Sancta Maria Stella Maris. The procession filled all the principal streets and squares of the town. I took my stand at the corner of the Vrijthof, where all marched past me, men, women, and children, all praying aloud, with loud voices beseeching: "Our Lady, Star of the Sea, pray for us ... pray for us ... pray for us ...!" It had not occurred to her for some hours after Mrs. Campbell had told her of Landor's death that she was free now to give herself to Cairness. She had gasped, indeed, when she did remember it, and had put the thought away, angrily and self-reproachfully. But it returned now, and she felt that she might cling to it. She had been grateful, and she had been faithful, too.[Pg 286] She remembered only that Landor had been kind to her, and forgot that for the last two years she had borne with much harsh coldness, and with a sort of contempt which she felt in her unanalyzing mind to have been entirely unmerited. Gradually she raised herself until she sat quite erect by the side of the mound, the old exultation of her half-wild girlhood shining in her face as she planned the future, which only a few minutes before had seemed so hopeless. After he had gloated over Sergeant Ramsey, Shorty got his men into the road ready to start. Si placed himself in front of the squad and deliberately loaded his musket in their sight. Shorty took his place in the rear, and gave out: The groups about each gun thinned out, as the shrieking fragments of shell mowed down man after man, but the rapidity of the fire did not slacken in the least. One of the Lieutenants turned and motioned with his saber to the riders seated on their horses in the line of limbers under the cover of the slope. One rider sprang from each team and ran up to take the place of men who had fallen. "As long as there's men and women in the world, the men 'ull be top and the women bottom." Then, in the house, the little girls were useful. Mrs. Backfield was not so energetic as she used to be. She had never been a robust woman, and though her husband's care had kept her well and strong, her frame was not equal to Reuben's demands; after fourteen years' hard labour, she suffered from rheumatism, which though seldom acute, was inclined to make her stiff and slow. It was here that Caro and Tilly came in, and Reuben began to appreciate his girls. After all, girls were needed in a house—and as for young men and marriage, their father could easily see that such follies did not spoil their usefulness or take them from him. Caro and Tilly helped their grandmother in all sorts of ways—they dusted, they watched pots, they shelled peas and peeled potatoes, they darned house-linen, they could even make a bed between them. HoME一级毛片视频免费公开
ENTER NUMBET 0018www.enmiao.com.cn www.wxyonyou.com.cn www.yishiman.com.cn www.yachtworld.org.cn tsyny.com.cn www.julin.org.cn www.rxov.com.cn xmjoint.com.cn shuazibu.com.cn www.zjkar.com.cn