英文:
Import missing despite already downloaded Python
问题
我明白这是一个初学者的问题,我刚刚开始。我正在尝试为一个简单的货币转换应用程序实现实时货币变化。
代码
我下载了forex_python.converter,但它显示为缺失。是不是下载到了错误的文件?谢谢你的帮助。
英文:
I realize this is a beginner question, I'm just starting out. I'm trying to put real time currency changes for a simple currency converter app.
Code
I download forex_python.converter and it marks it as missing. Is it going to the wrong file? Thank you for helping.
答案1
得分: 1
你的计算机上安装了多个Python版本。在你的截图中,当你运行pip3 install forex-python
时,你会看到它正在安装到一个位置C:\python311\lib\site-packages
。但是在你的交互式开发环境(IDE)中,你正在引用不同的Python版本"3.10.11"。请在你的IDE环境设置中更改Python解释器,使其指向正确的位置,然后它将正确地注册该库。请参考微软文档此处了解如何在Visual Studio Code中配置Python环境。
英文:
You have multiple python versions installed on your machine. When you call pip3 install forex-python
in your screenshot, you see that it is installing in a location C:\python311\lib\site-packages
. But in your Interactive Development Environment (IDE) you are referencing a different python version "3.10.11". Change your python interpreter in your IDE environment settings to point to the correct location and it will register the library correctly. See the Microsoft Documentation here for how to configure python environments in Visual Studio Code.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论