【问题标题】:How to install the packages under `virtual environment` on my Mac?如何在我的 Mac 上的“虚拟环境”下安装软件包?
【发布时间】:2017-11-25 00:47:14
【问题描述】:

我关注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

EDIT-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.

【问题讨论】:

  • 使用pip 它将把它安装到你所处的任何环境中,在这种情况下是你的venv。顺便提一句。您究竟需要 openssl 和 zlib 提供什么?这是包装要求吗?
  • 我要安装Python3.5
  • 这篇文章可能对你有所帮助stackoverflow.com/a/46113935/7732200
  • @OlegRybalchenko 查看我的 EDIT-2。
  • 据我所知,mac没有单独的openssl-devel包,它的功能包含在openssl中

标签: python virtualenv


【解决方案1】:

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

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

另外,请记住每个的特定用法

  • pip:Python 的 pkg 管理器
  • Homebrew:Mac 的 pkg 管理器

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-25
    • 2013-11-20
    • 2020-02-27
    • 2019-09-02
    • 2022-10-13
    • 1970-01-01
    • 2021-08-27
    • 1970-01-01
    相关资源
    最近更新 更多