Mac上安装visual studio code安装pylint失败的解决方案

操作系统:mac os

visual studio code版本: 1.23.1

问题描述:

Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/n_/39l7dhgs2rb4hryp6_8c77z00000gn/T/pip-PXKAF3-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

解决方案:

python -m pip install -U pylint --user

tip:

pylint是python2,3兼容的,支持python2.4以后的所有的python版本。



Visual Studio Code上运行Python代码的步骤如下: 1. 首先,安装Visual Studio Code。你可以从官方网站下载最新版本的安装程序并按照提示进行安装。[1] 2. 安装完毕后,打开Visual Studio Code并点击菜单栏中的"文件",然后选择"首选项",再选择"设置"。 3. 在设置页面中,搜索"Python"并点击搜索结果中的"Python"选项。这将打开Python相关的设置选项。 4. 如果你的电脑已经安装了Python,那么你不需要再次安装Python或者配置Python路径。 5. 现在你可以使用Visual Studio Code来调试和运行Python代码了。你可以创建一个新的Python文件,编写你的代码,并保存文件。然后,点击页面上方的调试按钮来运行代码。 6. 如果你想在代码中使用pylint工具,并且遇到了错误提示的问题,你可以在左下角的设置项中搜索"python.linting.pylintArgs",然后在设置中写入代码以忽略错误提示。 总结起来,你可以通过以下步骤在Visual Studio Code上运行Python代码: 1. 安装Visual Studio Code并打开它。 2. 在设置中搜索"Python",确保Python相关的设置正确。 3. 创建一个新的Python文件并编写你的代码。 4. 点击调试按钮来运行你的代码。 5. 如果需要,可以配置pylint工具以忽略错误提示。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [Visual Studio Code + python 开发环境搭建](https://blog.csdn.net/oHanTanYanYing/article/details/73038117)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值