python遇到错误ImportError:
python遇到错误ImportError: cannot import name create_prompt_application?
cannot import name create_prompt_application?
你是不是装了 jupyter包,这个包依赖prompt-toolkit版本是2.0.0以上的版本, 而ipython包依赖的是1.0.15的版本,估计是装Jupyter时,将版本更新了,所以运行的时候报错 你把版本切成1.0.15即可 pip install --upgrade prompt-toolkit1.0.5
consider to do和consider doing有什么区别?
通常情况下没有consider to do的写法,只有consider doing。只有在被动时才有be considered to do,此时是“认为”的意思。consider doing是“考虑做某事”的意思。
consider doing是考虑做某事 如:I am considering visiting you
consider to do是认为的意思
如:China is considered to be one of the greatest country in the world.中国被认为是世界上最伟大的国家之一
它的习惯用法有consider 名词或代词等,consideration 宾语从句,还有“consider somebody or something for something or somebody”或者是“consider somebody or something as something or somebody”。
例句:
1. We have considered your application carefully, but cannot offer you the job. 我们已经仔细地考虑了你的申请, 认为不能聘请你做这份工作。
2. We are considering Mary for a job. 我们正在考虑让玛丽做这份工作。
3. We are considering you as a candidate. 我们一直在考虑让你作为候选人。
4. Have you considered how to get there 你是否考虑过如何到达那里
从以上4个例句中,我们可以得出一个结论,consider作为考虑做某事这个意思解释时是及物动词,它后面如果要跟动词的话,要使用这个动词的动名词形式,即:consider doing something,不能用动词不定式“consider to do something”。
例句:
We are considering going to Canada to spend our holidays . 我们正考虑到加拿大去度假