擅长:python、mysql、java
<p>我正在写一个答案,因为我还没有足够的声誉留下评论。已经提供了有效的解决方案,但是我认为对于那些来到这里并且对Python是新的(ish)的人来说,应该解决一些微妙的问题。</p>
<p>pip和conda之间存在差异,如果我理解得很好,就应该在conda环境中尽可能多地使用conda,以避免遇到浪费时间的包冲突。我建议你阅读<a href="https://jakevdp.github.io/blog/2016/08/25/conda-myths-and-misconceptions/" rel="nofollow noreferrer">this article</a>以便更好地掌握哪些是做什么的。神话2和神话10在这里特别相关。</p>
<p>对于Lightgbm,显而易见的解决方案是使用上述conda forge。如果你运行的是康达环境,不管是水蟒还是小康达。但是您应该知道,目前anaconda distribution(AD)和conda forge(CF)并不完全兼容,您可以在<a href="https://github.com/spyder-ide/spyder/issues/7357" rel="nofollow noreferrer">this thread</a>中阅读。用他们自己的话说:</p>
<blockquote>
<p>Conda-forge and The Anaconda Distribution are incompatible with each other at present.
...Please pick one or the other for now. CF or AD, never both.</p>
</blockquote>
<p>不过,到目前为止,这似乎不是lightbgm的问题。</p>
<p>快乐编码!</p>