如何在我的Mac上的“虚拟环境”下安装软件包?

时间:2017-11-23 09:05:32

标签: python virtualenv

我关注tutorial,制作虚拟环境,现在我在Mac下的venv下:

(venv) HibMacBook:venv hib$ 

现在我要安装openssl-develzlib-devel,我尝试使用自制软件

homebrew install openssl-devel   -y
homebrew install zlib-devel  -y

但失败了,我不能使用wget,因为没有这些工具。

如何在virtual environment下安装软件包?

修改

我尝试使用pip安装在我的venv中,但也失败了。

(venv) l$ pip install openssl-devel
Collecting openssl-devel
  Could not find a version that satisfies the requirement openssl-devel (from versions: )
No matching distribution found for openssl-devel

修改-2

当我使用brew安装openssl-devel时,我会收到以下错误:

(venv) xxxx:venv ldl$ brew install openssl-devel
Updating Homebrew...
Error: No available formula with the name "openssl-devel" 
==> Searching for a previously deleted formula...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

1 个答案:

答案 0 :(得分:0)

首先,看看这些包是否可用:

  • pip pip search <query>
  • 自制brew search <query>

另外,请记住每个

的具体用法
  • pip :Python的pkg管理器
  • Homebrew :适用于Mac的pkg管理员

意思是,pip不应该用于安装OpenSSL;如果你想在OpenSSL之上抽象,请查看pyOpenSSL [https://pyopenssl.org/en/stable/api.html]