ImportError: cannot import name etree 泪的教训

最近几天安装lxml,pip2 install lxml(因为我同时安装了2和3)!

一次过安装了!

很顺利都不用1分钟!

在cmd打开测试了from lxml import etree也没问题!

过了两天再敲代码,在pycharm运行时死活提示“ImportError: cannot import name etree”

但是我在cmd里面运行时又可以的!

重新卸了再装还是不行

后来更新了pycharm的的包

file ---> setting--->Project:你建的filename ---> 右边绿色“+”,把lxml加进去再刷新

还是不行

后来折腾了一下午

看到这篇贴https://blog.csdn.net/Amberdreams/article/details/80548742

ImportError: cannot import name etree 泪的教训_第1张图片

自己建的filename就是lxml。。。。。。。冲突了。。。。。。

然后换了名字ojbk了

5555555浪费我一天的时间

记住:名字一定不要和框架名字相同。

你可能感兴趣的:(ImportError: cannot import name etree 泪的教训)