简体   繁体   English

Eclipse无法导入已安装的pip包

[英]Eclipse cannot import already installed pip package

So basically I used pip to import the docx python package and it installed correctly, (verified by the freeze command). 因此,基本上我使用pip导入了docx python软件包,并正确安装了该软件包(已通过Frozen命令验证)。 However I cannot import the package in eclipse. 但是我不能在eclipse中导入包。

Through some serious effort I've noticed that I can import the package using the 32 bit IDLE shell whereas I cannot when using the 64 bit IDLE shell. 经过一些认真的努力,我注意到我可以使用32位IDLE Shell导入软件包,而使用64位IDLE Shell不能导入。 My PC is 64 bit and so I do not why I cannot import a 32 bit package in eclipse, a problem I've never encountered before. 我的PC是64位的,所以我不为什么不能在eclipse中导入32位的程序包,这是我从未遇到过的问题。

Does anybody have any insights as to how I can import this package properly in eclipse? 是否有人对我如何在Eclipse中正确导入此软件包有任何见解? I'm sure there's a very reasonable cause and hopefully solution as to why this is happening and would really appreciate if anyone could help with this issue as I need to use this package for the specific project I aim to do. 我敢肯定有一个非常合理的原因,并且希望能找到导致这种情况发生的原因的解决方案,如果有人可以帮助解决这个问题,我将不胜感激,因为我需要将此软件包用于我打算做的特定项目。

side note: I'm using python 3.6 if that's of any relevance 旁注:如果有任何相关性,我正在使用python 3.6

You Should try to install the 64 bit version of python. 您应该尝试安装python的64位版本。 And don't go for latest version use. 而且不要去使用最新版本。 3.5 instead. 3.5相反。 Make sure you install the pip libraries when you are installing python. 确保在安装python时安装了pip库。 And your try to configure your eclipse. 然后尝试配置日食。 Try install updates for python in eclipse. 尝试在Eclipse中安装python更新。 and configure it. 并配置它。

Check this documentation it might help. 查看此文档可能会有所帮助。

https://www.ics.uci.edu/~pattis/common/handouts/pythoneclipsejava/eclipsepython.html https://www.ics.uci.edu/~pattis/common/handouts/pythoneclipsejava/eclipsepython.html

thanks for the reply. 谢谢回复。

The actual problem was that I was using python 3.6 where eclipse only accepts python grammar versions up to 3.5. 实际的问题是我使用的是python 3.6,而eclipse仅接受python语法版本不超过 3.5。 The docx package also only works with python 2.6, 2.7, 3.3, or 3.4 so I installed python 3.4 and docx is now working! docx包也仅适用于python 2.6、2.7、3.3或3.4,因此我安装了python 3.4,而docx现在可以使用了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM