这很奇怪。我正在我的 Azure 帐户中运行 Azure Powershell 5.0.1 并尝试创建应用服务计划来支持 this tutorial ;步骤
az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku FREE
下面的错误消息引用了“pscloudshell”文件(我已确认我的 Azure 帐户中不存在该文件)。
我已经尝试过了 - 验证文件是否存在(不存在) - 对字符串“pscloudshell”和“FileNotFoundError: [WinError 3] pscloudshell”进行网络搜索(但它非常稀疏)和
- 在 Stackoverflow 上搜索字符串“pscloudshell”,找到“您的搜索未返回任何匹配项。”。我一定是第一个经历过这种事的人?!
我所说的错误是
PS Azure:\> az appservice plan create --name myAppServicePlan2 --resource-group myResourceGroup2 --sku FREE
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\__main__.py", line 23, in <module>
exit_code = azure.cli.main.main(args)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\main.py", line 28, in main
os.makedirs(azure_folder)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\os.py", line 210, in makedirs
makedirs(head, mode, exist_ok)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\os.py", line 220, in makedirs
mkdir(name, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\ContainerAdministrator\\CloudDrive\\.pscloudshell'
az -v 给出:
azure-cli (2.0.22)
acr (2.0.16)
acs (2.0.21)
advisor (0.1.0)
appservice (0.1.21)
backup (1.0.3)
batch (3.1.7)
batchai (0.1.3)
billing (0.1.6)
cdn (0.0.10)
cloud (2.0.10)
cognitiveservices (0.1.9)
command-modules-nspkg (2.0.1)
configure (2.0.12)
consumption (0.2.0)
container (0.1.14)
core (2.0.22)
cosmosdb (0.1.15)
dla (0.0.15)
dls (0.0.18)
eventgrid (0.1.5)
extension (0.0.6)
feedback (2.0.6)
find (0.2.7)
interactive (0.3.11)
iot (0.1.14)
keyvault (2.0.14)
lab (0.0.13)
monitor (0.0.13)
network (2.0.18)
nspkg (3.0.1)
profile (2.0.15)
rdbms (0.0.9)
redis (0.2.10)
reservations (0.1.0)
resource (2.0.19)
role (2.0.15)
servicefabric (0.0.6)
sql (2.0.16)
storage (2.0.20)
vm (2.0.19)
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\ContainerAdministrator\CloudDrive\.pscloudshell\.azure\cliextensions'
Python (Windows) 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
最佳答案
I've tried - verifying that the file exists (it doesn't)
我使用旧的云 shell 重现了您的错误,我在该目录中找不到 .pscloudshell
。
然后我从 Azure 资源组中删除它并创建一个新的云 shell,它工作正常:
PS C:\Users\ContainerAdministrator\CloudDrive> pwd
Path
----
C:\Users\ContainerAdministrator\CloudDrive
PS C:\Users\ContainerAdministrator\CloudDrive> ls
Directory: C:\Users\ContainerAdministrator\CloudDrive
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 12/13/2017 4:30 AM .pscloudshell
Azure cloud shell 似乎有一些更新,请删除原来的 cloud shell 并重新创建一个新的。
关于python - Azure Powershell 中出现异常 'File not found' pscloudshell 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47785134/