简体   繁体   English

Python 3.7.3路径和VS代码冲突

[英]Python 3.7.3 Path and VS Code conflict

Last week I installed Anaconda but I continue to have problems using that environment in VS Code on Mac OS Mojave. 上周,我安装了Anaconda,但在Mac OS Mojave上的VS Code中使用该环境仍然遇到问题。 For 2 weekends now I've struggled and struggled to try and figure out this path conflict myself but have not been able to get the interactive terminal in VS Code to match a terminal launched from the Anaconda Navigator. 现在有两个周末,我一直在努力地尝试自己找出这种冲突的方法,但是却无法获得VS Code中的交互式终端,以匹配从Anaconda Navigator启动的终端。 There seems to be ample materials online about how to run an Anaconda ENV in VS Code but after working through the possible solutions I can't figure out the root conflict and so it persists. 关于如何在VS Code中运行Anaconda ENV的内容似乎在线上有很多资料,但是在研究了可能的解决方案之后,我无法弄清根源冲突,因此它仍然存在。

VS Code seems to indicate (bottom left status bar) that the correct 3.7.3 Conda environment is active in VS Code but $python --version returns 3.7.2 when tried. VS Code似乎表明(状态栏左下),VS Code中已激活正确的3.7.3 Conda环境,但尝试时$ python --version返回3.7.2。 VS Code setting "python.pythonPath" for the workspace is pointing at the correct 3.7.3 python.exe location so I can only assume the conflict is with my PATH setting? VS工作区的代码设置“ python.pythonPath”指向正确的3.7.3 python.exe位置,因此我只能假定与PATH设置存在冲突? Do I have to move the /Anaconda/bin to the front? 我必须将/ Anaconda / bin移到最前面吗?

I really enjoy scripting with VS Code and would really like to get it up and working again with some of the tools from Anaconda. 我真的很喜欢使用VS Code编写脚本,并且非常想重新使用它并使用Anaconda的某些工具进行工作。

在此处输入图片说明

Looks like you have both Mac python (from python.org) + anaconda, and the version from python.org is first in the PATH (the /Library/Frameworks/Python.framework stuff). 看起来您同时拥有Mac python(来自python.org)和anaconda,而python.org的版本位于PATH( /Library/Frameworks/Python.framework )中。 You can move the python.org version later in the PATH, or even remove it altogether if you'd like. 您可以稍后在PATH中移动python.org版本,或者根据需要甚至将其完全删除。

If you decide to remove the other python, be sure you don't accidentally remove the MacOS system python (in /System/Library/Frameworks ) or you will have to reinstall MacOS. 如果决定删除其他python,请确保不要意外删除MacOS系统python(在/System/Library/Frameworks ),否则必须重新安装MacOS。

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

相关问题 Linux 上 VS 代码中的 Python 路径 - Python path in VS Code on Linux 在 Windows 的 VS 代码中设置 Python 路径 - Setting Python Path in VS Code in Windows VS CODE 和 python 导入路径混淆 - VS CODE and python import path confusion VS代码和Python-安装后的问题(路径) - VS Code and Python - Problem after installation (Path) Raspberry Pi 4 上的 Visual Studio Code — Interpereter 路径从 3.7.3 更改为 3.8 - Visual Studio Code on Raspberry Pi 4 — Interpereter path changes from 3.7.3 to 3.8 相同的命令在终端中呈现不同的 output 与 PyCharm Python 3.7.3 on WIndows 10? - same command renders different output in terminal vs. PyCharm Python 3.7.3 on WIndows 10? 安装适用于Python 3.7.3的vtk工具包 - Install vtk toolkit for Python 3.7.3 python 代码中的问题 [configparser.InterpolationSyntaxError: '%' 必须后跟 '%' 或 '(', found: '%' ] 使用带有 appium 的 python 3.7.3 - Issue in python code [ configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%' ] using python 3.7.3 with appium 在 VS Code 中调试 Python 代码时显示路径的终端 - Terminal showing path while debugging Python code in VS Code 使用python 3.7.3安装keras时遇到问题 - Trouble installing keras with python 3.7.3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM