【问题标题】:Wrong paths in pydev debugger:pydev 调试器中的错误路径:
【发布时间】:2019-02-22 10:10:32
【问题描述】:

我在 VS Code 中有来自 Microsoft 包的 Python。 当我运行一些 Python 代码时,出现错误:

pydev debugger: Unable to find real location for: threading.py
pydev debugger: Unable to find real location for: C:\Users\abukreev\AppData\Roaming\Python\Python36\site-packages
pydev debugger: Unable to find real location for: <frozen importlib._bootstrap>
pydev debugger: Unable to find real location for: genericpath.py
pydev debugger: Unable to find real location for: ntpath.py
pydev debugger: Unable to find real location for: runpy.py
pydev debugger: Unable to find real location for: pkgutil.py
pydev debugger: Unable to find real location for: <frozen importlib._bootstrap_external>
pydev debugger: Unable to find real location for: urllib\parse.py
pydev debugger: Unable to find real location for: queue.py

C:\Users\abukreev\Documents\Python367\. 我的笔记本电脑上的 Python
但是 pydev 在 C:\Users\abukreev\AppData\Roaming\Python\Python36\site-packages 中等待它 如何更改pydev 设置?

【问题讨论】:

  • 我只是看了一下这个扩展的细节。它说 PyDev Debugger 集成是一个计划中的功能(很快)。这可能是您看到错误的原因吗?我只是在使用内置的 Python 调试器,它工作得非常好
  • 可能的 pyc 损坏? find . -name '*.pyc' -delete 或任何 Windows 等效项

标签: python visual-studio-code


【解决方案1】:

我遇到了同样的问题。我使用安装程序重新安装 python,而不是 zip 文件。

Python3.7.6 下载链接为 https://www.python.org/ftp/python/3.7.6/python-3.7.6-amd64.exe

【讨论】:

  • 你能补充一下有什么区别吗?另外,根据the official Download page,最新版本是 3.8.2 - 为什么不使用该页面(始终包含指向最新版本的链接)?
【解决方案2】:

可能是扩展本身的问题。但是,您可以确保名为PYTHONPATH 的环境变量指向您的python 文件夹:C:\Users\abukreev\Documents\Python367\C:\Users\abukreev\Documents\Python367\lib

PYTHONPATH 变量告诉系统在哪里可以找到 Python 模块。如果您的环境中没有任何 PYTHONPATH 变量,您应该自己添加它。

阅读这里以获得进一步的解释:https://www.tutorialspoint.com/python3/python_environment.htm

【讨论】:

    猜你喜欢
    • 2013-04-03
    • 2022-11-28
    • 2021-12-20
    • 1970-01-01
    • 1970-01-01
    • 2021-09-25
    • 2014-10-30
    • 2011-12-29
    • 2020-04-08
    相关资源
    最近更新 更多