相关疑难解决方法(0)

如何从 Homebrew 重新安装 python@2?

我在使用 brew 时遇到了 openssl 和 python@2 问题,这里已经解释了(未解决)。重新安装 Python 和 openssl 的文档化解决方法不起作用,所以我决定卸载并重新安装 Python。

问题是,当您尝试使用 brew 安装 Python 2 时,您会收到以下消息:

brew install python@2
Error: No available formula with the name "python@2"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

python@2 was deleted from homebrew/core in commit 028f11f9e:
  python@2: delete (https://github.com/Homebrew/homebrew-core/issues/49796)
  EOL 1 January 2020.
  We gave it 1 month more …
Run Code Online (Sandbox Code Playgroud)

python macos homebrew python-2.x

58
推荐指数
7
解决办法
5万
查看次数

导入错误:无法导入名称 md5

真的不知道这里发生了什么,我需要在弹性 beantalk 上部署我的烧瓶应用程序,但不知何故改变了路径并且无法再运行 python application.py

[dotnet --info]
.NET Core SDK (reflecting any global.json):
 Version:   2.1.701
 Commit:    8cf7278aa1

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.701/

Host (useful for support):
  Version: 2.1.12
  Commit:  ccea2e606d

[brew -v]
Homebrew 2.2.0
Homebrew/homebrew-core (git revision 43ad0; last commit 2019-11-30)
Run Code Online (Sandbox Code Playgroud)

我也已经完成了这些步骤:

LDFLAGS:  -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
Run Code Online (Sandbox Code Playgroud)

还是出现这个错误:

File "/Users/ipchelsea/Library/Python/2.7/lib/python/site-packages/urllib3/util/ssl_.py", line 8, in <module>
    from hashlib import md5, sha1, sha256
ImportError: cannot import name md5
Run Code Online (Sandbox Code Playgroud)

当我做 [brew link …

python homebrew openssl amazon-web-services hashlib

29
推荐指数
3
解决办法
4万
查看次数

使用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万
查看次数