简体   繁体   English

vscode + python + 交互模式 + 变量资源管理器缓慢且不准确

[英]vscode + python + interactive mode + variable explorer slow and inaccurate

I'm trying to switch from Spyder to VScode in order to integrate git into my workflow.我正在尝试从 Spyder 切换到 VScode,以便将 git 集成到我的工作流程中。 However I'm running into some (I think related?) issues that I'd love some help with.但是,我遇到了一些(我认为相关的?)问题,我希望得到一些帮助。

  1. Interactive mode and the variable explorer can take up to 20 seconds to define a=5交互模式和变量资源管理器最多可能需要 20 秒来定义 a=5
  2. the variable explorer really struggles to show me a dataframe with more than 100k rows.变量资源管理器真的很难向我展示超过 100k 行的 dataframe。
  3. the variable explorer can't open pandas index objects变量资源管理器无法打开 pandas 索引对象
  4. the variable explorer does not show the data as its stored, example: my EAN18 code's had their last 2 digits transformed into a 0. It took me 3 hours to figure out that was what's happening.变量资源管理器没有将数据显示为存储的数据,例如:我的 EAN18 代码的最后 2 位数字转换为 0。我花了 3 个小时才弄清楚这是怎么回事。

info: I'm using a conda environment信息:我正在使用 conda 环境

  • python 3.9.12 python 3.9.12
  • vscode 1.70 vscode 1.70
    • vscode python plugin v2022.12.1 vscode python 插件 v2022.12.1

I told VSCode to use my anaconda environment through: ctrl+shift+p --> python: select interpreter --> choosing my anaconda environment from the list I told VSCode to use my anaconda environment through: ctrl+shift+p --> python: select interpreter --> choosing my anaconda environment from the list

I cannot imagine anyone getting anything done with issues like these, so I must be doing something wrong.我无法想象有人能解决这样的问题,所以我一定做错了什么。 What could be a good place to start troubleshooting one or multiple of my issues?什么是开始解决我的一个或多个问题的好地方?

It's definitly not usual, that there are these delays.有这些延误绝对不常见。 Although it is quite hard to tell what the problem is, because there are two many "variables" at play (Your PC-Setup, installed Software, ...).尽管很难说出问题所在,因为有两个“变量”在起作用(您的 PC 设置、已安装的软件……)。

But there are some things you could try as a solution.但是您可以尝试一些方法作为解决方案。

  1. Make sure you use the 64 Bit Version of VS Code.确保使用 64 位版本的 VS Code。 (If you accidently downloaded the 32-BIT Version that would explain the slowness). (如果您不小心下载了 32 位版本,这可以解释速度慢)。
  2. Try to use a regular python enviroment (not using conda).尝试使用常规的 python 环境(不使用 conda)。 Maybe it has something to do with the many modules which come pre-installed with conda.也许它与 conda 预装的许多模块有关。

These are the things you could try to fix your VS-Code setup.这些是您可以尝试修复 VS-Code 设置的事情。

On a further note, on personal experience I'd recommand using the PyCharm IDE.另外,根据个人经验,我建议使用 PyCharm IDE。 It is entirly free too (the community version at least) and has an even better GIT integration compared to the VS-Code's one.它也是完全免费的(至少是社区版),与 VS-Code 的集成相比,它具有更好的 GIT 集成。

If you can't fix your mentioned issues this might be a good option to choose as an alternative.如果您无法解决您提到的问题,这可能是一个不错的选择。

Hope this helps:)希望这可以帮助:)

This does not seem to be a common problem.这似乎不是一个普遍的问题。

I can give some suggestion:我可以给一些建议:

  1. Add the following code to your setting.json :将以下代码添加到您的设置中setting.json

    "search.followSymlinks": false, “search.followSymlinks”:假,

  2. Set high performance mode for vscode in graphics card settings在显卡设置中为vscode设置高性能模式

  3. Power settings enable high performance电源设置可实现高性能

The problem is related to my personal hardware and other aspects, posting this to try and accept this answer so I can delete this post.问题与我的个人硬件和其他方面有关,发布此帖子以尝试接受此答案,以便我可以删除此帖子。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM