我有windows 10。我已经完成Tensorflow的安装。它的工作原理。上面写着“你好,Tensorflow!”但这一切都摆在它面前:

2018-08-18 18:16:01.500579: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 
2018-08-18 18:16:01.769002: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1405] Found device 0 with properties: name: GeForce GTX 950 major: 5 minor: 2 memoryClockRate(GHz): 1.3545 pciBusID: 0000:01:00.0 totalMemory: 2.00GiB freeMemory: 1.64GiB 
2018-08-18 18:16:01.774030: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1484] Adding visible gpu devices: 0 
2018-08-18 18:16:02.095489: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:965] Device interconnect StreamExecutor with strength 1 edge matrix: 
2018-08-18 18:16:02.099093: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:971] 0 
2018-08-18 18:16:02.100631: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:984] 0: N 
2018-08-18 18:16:02.102156: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1097] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1401 MB memory) -> physical GPU (device: 0, name: GeForce GTX 950, pci bus id: 0000:01:00.0, compute capability: 5.2) Hello Tensorflow!

Process returned 0 (0x0) execution time : 2.327 s Press any key to continue

当我在cmb中输入pip3 install——upgrade tensorflow-gpu时,无论是管理的还是正常的,我都得到了这个:

Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\users\\dylan\\appdata\\local\\programs\\python\\python35\\Lib\\site-packages\\numpy\\.libs\\libopenblas.BNVRK7633HSX7YVO2TADGR4A5KEKXJAW.gfortran-win_amd64.dll'
Consider using the `--user` option or check the permissions.

请帮帮我。不是计算机科学家或工程师。但我编程只是为了好玩。


当前回答

只需更改访问权限,即将要安装特定包的位置。

Windows 10操作系统:

进入安装文件夹。例如:C:\Program Files (x86)\Python37 右键单击python安装根目录,然后单击属性。在本例中,是Python37文件夹。 转到安全选项卡,单击编辑按钮,并允许完全控制用户组。记得单击Apply。 尝试重新安装包。

下面是所需设置的示例:

其他回答

正如在错误中提到的,没有——user,所以您必须遵循这些步骤

打开cmd或anaconda Navigator 打开python安装目录(对于anaconda导航器,您必须指定路径,如C:/cd anaconda 最后是python -m pip install——user somepackagename

如果您使用的是windows 10 20H2,请在pip3(或pip) install命令上同时使用——user或-U检查。有些库不能识别其中的一个,因此需要同时检查两个库。一个就可以了。

pip3 install --user tensorflow-gpu

or

pip3 install -U gast==0.3.3

我需要从需求文件安装,并得到这个错误,但不想使用——user选项,因为我不想将它安装在@not2qubit所描述的位置。所以我以管理员身份运行CMD,然后启用以下目录的共享(右键单击> properties > sharing > Share…):

C:\Users\<my user name>\AppData\Local\Temp

在这样做之后,我能够从我的需求文件安装到应用程序目录(我想要它的地方),而不是疯狂的..\AppData目录没有错误。

只是这类问题的一个附加项。如果您在公司防火墙后工作,要安装任何包,您都需要为该用户安装和升级包,否则您应该有一个管理用户帐户。

这应该可以

pip install --user requests