简体   繁体   中英

pip install fails inside conda environment but works in base

(Running Windows 10 Home)

Steps to reproduce problem:

  • Install miniconda
  • Install MS Visual Studio 2017 C++ build tools with Windows 8.1 and 10 SDK
  • 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. 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.

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. So the fix is:

rm -rf $HOME/.cache

in a linux environment at least.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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