简体   繁体   English

在 VSCode 中从 conda 环境导入 python package

[英]Importing python package from conda environment in VSCode

enter image description here在此处输入图像描述

Somebody please explain why I am not able to import package in VSCode even though I can do it in terminal both in VSCode and in system有人请解释为什么我无法在 VSCode 中导入 package,即使我可以在 VSCode 和系统中的终端中做到这一点

Check out https://code.visualstudio.com/docs/python/environments VSCode uses multiple python binaries.查看https://code.visualstudio.com/docs/python/environments VSCode 使用多个 python 二进制文件。 Each one has a seperate list of installed modules and packages.每个都有一个单独的已安装模块和包的列表。 By default VSCode uses a custom Anaconda binary.默认情况下,VSCode 使用自定义 Anaconda 二进制文件。 When you invoke the python command, you are using a system wide install of Anaconda.当您调用 python 命令时,您正在使用 Anaconda 的系统范围安装。 You need to change the binary version of python VSCode is using, to point at the system-wide install, where you installed your modules您需要更改 VSCode 正在使用的 python 的二进制版本,以指向安装模块的系统范围安装

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

相关问题 从 Python 3.6 中的虚拟环境导入 package - Importing package from a virtual environment in Python 3.6 我在python脚本中从conda导入软件包错误吗? - Am I importing a package from conda wrong in my python script? VSCode 不再识别我的 Python Conda 环境 - VSCode no Longer Recognises my Python Conda Environment vscode python interactive window timed out on running python script on other conda environment 除了基础环境 - Vscode python interactive window timed out on running python script on other conda environment apart from base environment Python不在conda环境中时不导入文件 - Python not importing files when not inside conda environment 如何从 vscode 中删除 conda 环境? - How to remove conda environment from vscode? Python 解释器(VScode)“激活”一个 conda 环境,但环境没有改变 - Python interpreter (VScode) "activates" a conda environment, but the environment doesn't change 将特定的 Python 全局包插入到 Conda 环境中 - Insert a specific Python global package to Conda environment 我从 Anaconda 打开 VScode 并在基于 conda 的 python 环境中运行它,但未激活 numpy - I opened VScode from Anaconda and running it in conda based python environment, but numpy is not activated 在 Conda 虚拟环境中使用 Github 中的包 - Use package from Github in Conda Virtual Environment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM