简体   繁体   English

pip 在 conda 环境中安装失败,但在基本环境中工作

[英]pip install fails inside conda environment but works in base

(Running Windows 10 Home) (运行Windows 10首页)

Steps to reproduce problem:重现问题的步骤:

  • Install miniconda安装 miniconda
  • Install MS Visual Studio 2017 C++ build tools with Windows 8.1 and 10 SDK使用 Windows 8.1 和 10 SDK 安装 MS Visual Studio 2017 C++ 构建工具
  • conda create -n myenv python=3.5
  • activate myenv
  • pip install spectrum

Fails with error因错误而失败

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual 
C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
  • deactivate
  • pip install spectrum

Build succeeds.构建成功。 What's going on?这是怎么回事?

Unfortunately, I was at this for 6 hours today.不幸的是,我今天在这里呆了 6 个小时。 All the following failed:以下所有失败:

Firewall reset on Windows 10
conda update
miniconda reinstall
distribution upgrade (Debian)
pip downgrade/upgrade
pip installed from pypi using get-pip.py

none of which made the problem go away, however, other conda environments were working for me as were new ones.这些都没有使问题 go 消失,但是,其他 conda 环境和新环境一样对我有用。

Turns out that if you wipe out a conda environment and then install a new one with a name you used before the cache can be mangled.事实证明,如果您清除了一个 conda 环境,然后使用您在缓存被破坏之前使用的名称安装一个新环境。 So the fix is:所以解决方法是:

rm -rf $HOME/.cache

in a linux environment at least.至少在 linux 环境中。

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

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