小编Luk*_*ith的帖子

在Azure上安装mysql-python的错误

不确定我是否应该使用Server Overflow ...在Azure上使用Django网站,通过GitHub进行部署...我在requirements.txt中有mysql-python甚至可以将site-packages添加到我的应用程序根目录...出现以下错误.

错误:需要Microsoft Visual C++ 9.0(无法找到vcvarsall.bat).从http://aka.ms/vcpython27获取它

python django azure mysql-python

8
推荐指数
1
解决办法
544
查看次数

PowerShell v5类方法 - 问题

在PowerShell v5中使用新的类函数,如果我们可以将方法放入类中,我正试图解决这个问题.

我已经尝试了以下并且玩了一下,但没有运气.

class Server {

    [string]$computerName = "192.168.0.200"
    [bool]$ping = (Test-Connection -ComputerName $computerName).count

}

$1 = [server]::new()
$1.computerName = "blah"
Run Code Online (Sandbox Code Playgroud)

我尝试通过设置属性手动输入计算机名称,但后来我假设你在创建对象时需要它

$1 = [server]::new($computerName = "192.168.0.200")
Run Code Online (Sandbox Code Playgroud)

我得到的例外情况是

[ERROR] Exception calling ".ctor" with "0" argument(s): "Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the 
[ERROR] command again."
[ERROR] At D:\Google Drive\Projects\VSPowerShell\DiscoveryFramework\DiscoveryFramework\DiscoveryFramework\class.ps1:12 char:1
[ERROR] + $1 = [server]::new()
[ERROR] + ~~~~~~~~~~~~~~~~~~~~
[ERROR]     + CategoryInfo          : …
Run Code Online (Sandbox Code Playgroud)

methods powershell class powershell-5.0

5
推荐指数
1
解决办法
2585
查看次数