Modules installed in Conda environment not being found by VS code

雨燕双飞 提交于 2020-06-01 05:13:06

问题


I have Python 3.6 installed using Anaconda as the sole Python instance on my computer. Following the installation instructions on TensorFlow, I created a conda environment called tensorflow running Python 3.5, activated it and ran pip install --ignore-installed --upgrade tensorflow to install tensorflow. While inside the environment I am able to validate the installation by running import tensorflow, which works fine. To run my scripts in this environment in VS Code, I followed the instructions on configuring Python environments and selected the interpreter such that it corresponds to the conda environment I created. This adjusts the python path variable in VS Code's user settings accordingly.

{
    "window.zoomLevel": 2,
    "files.autoSave": "off",
    "workbench.colorTheme": "Abyss",
    "python.pythonPath": "C:\\Users\\osharaki\\Anaconda3\\envs\\tensorflow\\python.exe"
}

However, when I try to run a script inside VS Code that imports tensorflow I still receive the following error:

ModuleNotFoundError: No module named 'tensorflow'

The resource that came closest to answering my issue was this.

What am I missing?

来源:https://stackoverflow.com/questions/51753825/modules-installed-in-conda-environment-not-being-found-by-vs-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!