简体   繁体   English

导入库并在 PyCharm 中被识别

[英]Importing libraries and being recognised in PyCharm

Apologies if this has been asked before.如果之前有人问过这个问题,我们深表歉意。 I have searched this site for an answer but it fails to address my problem.我已经在该网站上搜索了答案,但未能解决我的问题。 I am trying to install a module - openpyxl- in my PyCharm application.我正在尝试在我的 PyCharm 应用程序中安装一个模块 - openpyxl-。 Although it shows as being installed, it fails to load into PyCharm and I get a run time error highlighting this problem.虽然它显示为正在安装,但它无法加载到 PyCharm 中,我收到一个运行时错误,突出显示了这个问题。

I have downloaded the openpyxl module, added it to the interpreter (shown in the screenshot), restarted the program but still get the same error.我已经下载了 openpyxl 模块,将它添加到解释器中(如屏幕截图所示),重新启动程序但仍然出现相同的错误。 I understand the PATH may be incorrect but I'm unsure as to how it can be corrected.我知道 PATH 可能不正确,但我不确定如何更正它。 Any help would be gratefully received - thank you.任何帮助将不胜感激 - 谢谢。

All sorted.全部排序。 The module was showing as being imported but wouldn't be seen in the program, hence the error.该模块显示为正在导入,但不会在程序中看到,因此出现错误。 All I did was check in the PyCharm ==> preferences ==> Interpreter box, click on the 'update' arrow and then the module loaded with no problem.我所做的只是检查 PyCharm ==> 首选项 ==> 解释器框,单击“更新”箭头,然后模块加载没有问题。

Thanks for your help;谢谢你的帮助; noted about the screenshot (it did load originally).注意到屏幕截图(它最初确实加载了)。

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

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