簡體   English   中英

我無法在 Visual Studio Code 中安裝“Linter pylint”。 我使用 Python 3.9

[英]I cannot install „Linter pylint” in Visual Studio Code. I use Python 3.9

幫助!

我無法在 Visual Studio Code 中安裝“Linter pylint”。 我使用 Python 3.9 和 Windows 10。

Python 安裝在 C:\Program Files\Python39

當我啟動 Ide 時,它告訴我“Linter pyling 未安裝。 來源:Python(擴展)[安裝/Select Linter/不再顯示]”。

當我 select “安裝”它找到緩存文件時,它會向我拋出以下錯誤消息:

SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf6 in position 0: invalid start byte 
(sitecustomize.py, line 21)
WARNING: The wheel package is not available.
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf6 in position 0: invalid start byte 
(sitecustomize.py, line 21)
 
ERROR: Command errored out with exit status 1: 'C:\Program Files\Python39\python.exe' 
'C:\Users\XXX\AppData\Roaming\Python\Python39\site-packages\pip\_vendor\pep517\_in_process.py' 
prepare_metadata_for_build_wheel 

我已在代碼中將我的真實姓名更改為 XXX,因為它顯示了我的全名。

但是,pylint 在我的筆記本電腦和 Visual Studio Code 上工作正常。 我已經檢查了其他幾個主題,也搜索了這個問題。 但是,我無法解決這個問題。

這是PATH的問題嗎?

我還嘗試通過 CMD 安裝 pylint 並關閉 Visual Studio Code。 我收到以下錯誤消息:

 ERROR: Command errored out with exit status 1:
     command: 'c:\program files\python39\python.exe' 'C:\Users\XXXX\AppData\Roaming\Python\Python39\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\XXX~1\AppData\Local\Temp\tmprs1z79cr'
         cwd: C:\Users\XXXX\AppData\Local\Temp\pip-install-50w37pyv\lazy-object-proxy_19a2f4b71f224fe7bc87991bc2a8cf52
    Complete output (15 lines):
    Error in sitecustomize; set PYTHONVERBOSE for traceback:
    SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf6 in position 0: invalid start byte (sitecustomize.py, line 21)
    WARNING: The wheel package is not available.
    Error in sitecustomize; set PYTHONVERBOSE for traceback:
    SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf6 in position 0: invalid start byte (sitecustomize.py, line 21)
    running dist_info
    creating C:\Users\XXXX\AppData\Local\Temp\pip-modern-metadata-inoke7l2\lazy_object_proxy.egg-info
    writing C:\Users\XXXX\AppData\Local\Temp\pip-modern-metadata-inoke7l2\lazy_object_proxy.egg-info\PKG-INFO
    writing dependency_links to C:\Users\XXXX\AppData\Local\Temp\pip-modern-metadata-inoke7l2\lazy_object_proxy.egg-info\dependency_links.txt
    writing top-level names to C:\Users\XXXX\AppData\Local\Temp\pip-modern-metadata-inoke7l2\lazy_object_proxy.egg-info\top_level.txt
    writing manifest file 'C:\Users\XXXX\AppData\Local\Temp\pip-modern-metadata-inoke7l2\lazy_object_proxy.egg-info\SOURCES.txt'
    reading manifest file 'C:\Users\XXXX\AppData\Local\Temp\pip-modern-metadata-inoke7l2\lazy_object_proxy.egg-info\SOURCES.txt'
    writing manifest file 'C:\Users\XXXX\AppData\Local\Temp\pip-modern-metadata-inoke7l2\lazy_object_proxy.egg-info\SOURCES.txt'
    creating 'C:\Users\XXXX\AppData\Local\Temp\pip-modern-metadata-inoke7l2\lazy_object_proxy.dist-info'
    error: invalid command 'bdist_wheel'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files\python39\python.exe' 'C:\Users\XXXX\AppData\Roaming\Python\Python39\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\XXXX~1\AppData\Local\Temp\tmprs1z79cr' Check the logs for full command output.

謝謝!

我建議你在 Visual Studio Code 上的文件夾下右鍵單擊,打開集成終端,然后檢查是否先安裝了 pip。 如果未安裝 pip,請使用以下命令更新 package 列表:

sudo apt update

然后使用以下命令安裝 pip:

sudo apt-get install python3-pip

或者

sudo apt install python-pip

然后安裝pylint:

sudo pip-3.3 install pylint

or

sudo apt install pylint3

如果這些都不起作用,您可以參考以下線程: https://askubuntu.com/questions/340940/installing-pylint-for-python3-on-ubuntu

在 windows 上獲得 Chocolatey。

然后嘗試

巧克力安裝 python

巧克力安裝 pip

安裝“輪子”(pip install wheel)以某種方式解決了這個問題。

有解釋嗎? 在我的桌面上,我沒有這個問題。 這就是為什么我有點困惑,因為我是 Python 的新手。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM