小编Sup*_*hon的帖子

使用python 2.7导入hashlib时出错,但不能导入2.6

我在Solaris 10(x86)上.

到现在为止,我使用的是python2.6.今天,我安装了python2.7,在2.7上导入hashlib时发生了一个奇怪的错误,但在2.6上没有:

Python 2.6:

root@myserver [PROD] # python2.6 -c "import hashlib"
root@myserver [PROD] # 
Run Code Online (Sandbox Code Playgroud)

Python 2.7:

root@myserver [PROD] # python2.7 -c "import hashlib"
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 139, in …
Run Code Online (Sandbox Code Playgroud)

python solaris hashlib solaris-10 python-2.7

26
推荐指数
3
解决办法
7万
查看次数

为什么我的goroutine没有执行?

我正在学习Go,我想尝试goroutines和频道.

这是我的代码:

package main
import "fmt"
func main(){

messages := make(chan string,3)

messages <- "one"
messages <- "two"
messages <- "three"

go func(m *chan string) {
    fmt.Println("Entering the goroutine...")
    for {
        fmt.Println(<- *m)
    }
}(&messages)

fmt.Println("Done!")
}
Run Code Online (Sandbox Code Playgroud)

这是结果:

Done!
Run Code Online (Sandbox Code Playgroud)

我不明白为什么我的goroutine永远不会被执行.没有打印"输入goroutine",我没有任何错误消息.

go

12
推荐指数
2
解决办法
5170
查看次数

标签 统计

go ×1

hashlib ×1

python ×1

python-2.7 ×1

solaris ×1

solaris-10 ×1