Reproducing conda environment when packages are no longer available from channels

末鹿安然 提交于 2019-12-05 13:57:21

I had almost exactly the same issue just today. Based on other SO post, I moved the two packages with issues to the pip section of my .yml file. i.e.:

  -pip:
    - vc==14.1=h0510ff6_3
    - vs2015_runtime==15.5.2=3

This seemed to fix the issue for me, though I'm not sure if this is necessarily the best way.

EDIT: On closer inspection, I realise that this didn't solve the issue. Instead, I moved the two packages back to dependencies and just removed the version requirements (it picked up an older version of vc instead). i.e.:

dependencies:
  - vc
  - vs2015_runtime

The resulting versions were:

vc                        14                   h0510ff6_3
vs2015_runtime            14.0.25123                    3

I have the similar setups on both computers, so why this has happened, I'm not entirely sure.

To anyone interested, the reason for this issue is addressed and closed by continuum in: https://github.com/conda/conda/issues/7714 And further discussed in: https://github.com/ContinuumIO/anaconda-issues/issues/10004.

But in short, these two packages have been "revoked" and the new package solver (for anaconda python 3.7) logic does not handle this scenario well.

A possible solution copied from https://github.com/conda/conda/issues/7714:

Steps to fix your environment if you're currently broken:

  1. Note the location of your current base conda environment. For the example here, let's say it's at C:\Users\ScoobyDoo\Anaconda3. You'll also need to know the python version you had before you encountered these errors. Let's say for this example it's python 3.5.
  2. Download miniconda from https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe. (You can use Miniconda3 or Miniconda2; it doesn't matter.)
  3. Run the miniconda installer, choose install for "Just Me", and then specify a Destination Folder that's different than your current base environment. For this example, we'll put it at C:\temp-conda.
  4. In any command prompt, run the command C:\temp-conda\Scripts\conda.exe install -p C:\Users\ScoobyDoo\Anaconda3 python=3.5 conda
  5. Your normal conda should now be healed, and you can now remove the C:\temp-conda directory if you like.
  6. When you ran the new miniconda installer, your "Anaconda Prompt" shortcut may have been changed. If it no longer works correctly, right click on the "Anaconda Prompt" icon, choose "Properties", and make the Target field point to C:\Users\ScoobyDoo\Anaconda3 instead of C:\temp-conda. Note that you might have to make two changes to the Target field instead of just one. Since the field box is pretty small, it's usually easier to select the field, hit Ctrl-A then Ctrl-C (to select all text then copy), paste the text into an empty notepad file, make your edits, and then copy and paste the edited text back into the Target field.
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!