天天看點

You don't appear to have the necessary permissions to install packages

新換了電腦,是以重新配置平時所需要的軟體等環境,對pycharm使用Anaconda 的site_packages環境(為了省掉大量安裝packages的煩惱),結果使用pycharm安裝package時候,遇到了root權限問題,不讓通路”C:\PrograData\Anaconda3”,,,。原來wins也有這個root 題。

作業系統:win10

pychrm:python3.6

一、cmd pip安裝 python package

在cmd使用pip 安裝package遇到權限問題

pip install tensorflow

被deny,permission denied

You don't appear to have the necessary permissions to install packages
You don't appear to have the necessary permissions to install packages

二、使用pycharm的interpreter安裝

給出下面的警告資訊

#
# You don't appear to have the necessary permissions to install packages
# into the install area 'C:\PrograData\Anaconda3'.
# However you can clone this environment into your home directory and
# then make changes to it.
# This may be done using the command:
#
# $ conda create -n my_root --clone=C:\PrograData\Anaconda3
           
You don't appear to have the necessary permissions to install packages

按照提示,在

cmd 執行了下面的指令,給了”C:\PrograData\Anaconda3”的my_root權限

這個時候,在cmd輸入

activate my_root
           

激活了my_root權限

You don't appear to have the necessary permissions to install packages

這個時候,使用

就可以安裝需要的packages了。

注意:權限toot後,對pycharm的Default setting要修改為下圖紅色的内容所在的位置(也就是你的root可以通路的新位置):

You don't appear to have the necessary permissions to install packages

一、這個時候我們使用+,在pycharm中試驗一下,看看權限問題解決了沒有:

You don't appear to have the necessary permissions to install packages

可以看出來,我們已經可以正常安裝新的python package啦

二、或者使用cmd

pip install tensorflow-gpu
           

也是成功的

總結:本質上其實是遇到了一個檔案通路權限的問題,解決方法

給某個檔案夾或者檔案賦予權限