简体   繁体   English

错误:pycryptodome 的构建轮失败

[英]ERROR: Failed building wheel for pycryptodome

I was trying to install pycryptodome , python-jose-cryptodome using pip within anaocnda3 environment.我试图在anaocnda3环境中使用pip安装pycryptodomepython-jose-cryptodome

I got this error:我收到此错误:

  ERROR: Failed building wheel for pycryptodome

I have tried many versions many solutions(latest versions, specified version, with python 3.8 or 3.7, using requirements text without cache and even alone installation) but nothing worked for me :(. Any solution?我已经尝试了许多版本的许多解决方案(最新版本,指定版本,使用 python 3.8 或 3.7,使用没有缓存的需求文本,甚至单独安装),但对我来说没有任何效果:(。任何解决方案?

While using pip in an anaconda environment is allowed and fine, issues may arise when using pip and conda together, this was clearly mentioned in the conda docs .虽然允许在 anaconda 环境中使用pip并且很好,但同时使用pipconda时可能会出现问题,这在 conda docs 中有明确提到。

One of the best practices when installing packages in an anaconda environment is to use conda for search and install before using pip.在 anaconda 环境中安装软件包的最佳实践之一是在使用 pip 之前使用conda进行搜索和安装。

So instead of directly using pip , try to :因此,不要直接使用pip ,而是尝试:

  1. Search for pycryptodome in anaconda packages repo在 anaconda 包 repo 中搜索pycryptodome

    conda search pycryptodome

    pycryptodome is available in anaconda repo . pycryptodome 在 anaconda repo 中可用。

  2. The next step is to install pycryptodome :下一步是安装 pycryptodome :

    conda install -c anaconda pycryptodome

    or if you want to use conda-foge channel :或者如果您想使用 conda-foge 频道:

    conda install -c conda-forge pycryptodome

    this should get pycryptodome installed into your env这应该将 pycryptodome 安装到您的环境中

  3. To use a requirements.txt file with conda :使用带有 conda 的 requirements.txt 文件:

    conda install --yes --file requirements.txt

Summary : Best Practices Checklist When Using Pip in a Conda Environment摘要:在 Conda 环境中使用 Pip 时的最佳实践清单

Use pip only after conda仅在 conda 之后使用 pip

  • install as many requirements as possible with conda, then use pip使用 conda 安装尽可能多的需求,然后使用 pip

  • pip should be run with –upgrade-strategy only-if-needed (the default) pip 应该使用 –upgrade-strategy only-if-needed 运行(默认)

  • Do not use pip with the –user argument, avoid all “users” installs不要将 pip 与 –user 参数一起使用,避免所有“用户”安装

Use conda environments for isolation使用 conda 环境进行隔离

  • create a conda environment to isolate any changes pip makes创建一个 conda 环境来隔离 pip 所做的任何更改
  • environments take up little space thanks to hard links由于硬链接,环境占用的空间很小
  • care should be taken to avoid running pip in the “root” environment应注意避免在“root”环境中运行 pip

Recreate the environment if changes are needed如果需要更改,请重新创建环境

  • once pip has been used conda will be unaware of the changes一旦使用了 pip,conda 将不会意识到这些变化
  • to install additional conda packages it is best to recreate the environment要安装其他 conda 软件包,最好重新创建环境

Store conda and pip requirements in text files将 conda 和 pip 要求存储在文本文件中

  • package requirements can be passed to conda via the –file argument包要求可以通过 –file 参数传递给 conda
  • pip accepts a list of Python packages with -r or –requirements pip 接受带有 -r 或 -requirements 的 Python 包列表
  • conda env will export or create environments based on a file with conda and pip requirements . conda env 将根据具有 conda 和 pip 要求的文件导出或创建环境。

you can read more about this topic here on anaconda website , and on conda docs您可以在 anaconda 网站conda docs阅读有关此主题的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM