[英]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.