windows10安裝python依賴報錯can‘t?create?or?remove?files?in?install?directory問題
windows10安裝python依賴報錯can‘t create or remove files in install directory
執(zhí)行python setup.py安裝依賴時,
報如下錯誤:can’t create or remove files in install directory。
>> python setup.py install
running install
error: can't create or remove files in install directoryThe following error occurred while trying to add or remove files in the
installation directory:[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-19811.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:/Library/Python/2.7/site-packages/
......
報錯
無法在安裝目錄中創(chuàng)建或刪除文件,想到是沒有權(quán)限的問題,查問題都說使用管理員權(quán)限重新執(zhí)行上面命令即可。
但是使用管理員權(quán)限打開terminal,再次執(zhí)行python setup.py install這個命令,還是報上面的錯誤。
下面通過卸載Windows自帶的Python,然后重裝解決這個問題。
在左下角搜索 設(shè)置 -> 應(yīng)用,搜索python,然后點擊卸載。

卸載后,到https://www.python.org/downloads/windows/下載對應(yīng)系統(tǒng)的可執(zhí)行文件安裝器,我的是64位,這里選擇安裝64位的Windows可執(zhí)行文件安裝器。

選擇自定義安裝,這里放到d盤softs目錄下,選擇將python添加到PATH環(huán)境變量中。
安裝成功后,在terminal中運行python命令,如下對應(yīng)版本信息,即表明安裝成功。

然后,再執(zhí)行python setup.py install命令,即可下載相關(guān)的依賴。
總結(jié)
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
- Python虛擬環(huán)境virtualenv安裝的詳細(xì)教程保姆級(Windows和linux)
- 卸載所有通過pip安裝的Python包的方法總結(jié)(Windows系統(tǒng))
- 使用python查找windows系統(tǒng)中所有程序的安裝信息
- Windows下多版本Python共享Poetry測試安裝
- python?windows安裝cuda+cudnn+pytorch教程
- windows server 2008 r2 標(biāo)準(zhǔn)版安裝python環(huán)境
- windows安裝python超詳細(xì)圖文教程
- Python3.9最新版下載與安裝圖文教程詳解(Windows系統(tǒng)為例)
- 如何在Windows下載、安裝Python和配置環(huán)境(新手、保姆級教程)
相關(guān)文章
python常用模塊(math itertools functools sys
這篇文章主要介紹了python常用模塊之math itertools functools sys shutil的使用示例講解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-06-06
Python循環(huán)緩沖區(qū)的應(yīng)用詳解
循環(huán)緩沖區(qū)是一個線性緩沖區(qū),邏輯上被視為一個循環(huán)的結(jié)構(gòu),本文主要為大家介紹了Python中循環(huán)緩沖區(qū)的相關(guān)應(yīng)用,有興趣的小伙伴可以了解一下2025-03-03
Python+Matplotlib繪制高亮顯示餅圖的示例代碼
餅圖 (Pie Chart) 是一種圓形統(tǒng)計圖,被分割成片用于表示數(shù)值間的比例關(guān)系,本文為大家介紹了Matplotlib繪制高亮顯示的餅圖的函數(shù)源碼,需要的可以參考一下2023-06-06

