从.yml文件创建conda环境-错误报告

时间:2019-05-12 10:45:34

标签: anaconda

我正在尝试从.yml文件创建conda环境。我在Windows上使用的是Miniconda3,Python 3.7.3。我收到以下错误报告。有什么想法会导致这种问题吗? PS。如果这个问题不合适,我深表歉意。


    Traceback (most recent call last):
      File "C:\Users\mariyana\Miniconda3\lib\site-packages\conda\exceptions.py", line 1003, in __call__
        return func(*args, **kwargs)
      File "C:\Users\mariyana\Miniconda3\lib\site-packages\conda_env\cli\main.py", line 73, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "C:\Users\mariyana\Miniconda3\lib\site-packages\conda_env\cli\main_update.py", line 69, in execute
        directory=os.getcwd())
      File "C:\Users\mariyana\Miniconda3\lib\site-packages\conda_env\specs\__init__.py", line 40, in detect
        if spec.can_handle():
      File "C:\Users\mariyana\Miniconda3\lib\site-packages\conda_env\specs\yaml_file.py", line 18, in can_handle
        self._environment = env.from_file(self.filename)
      File "C:\Users\mariyana\Miniconda3\lib\site-packages\conda_env\env.py", line 143, in from_file
        return from_yaml(yamlstr, filename=filename)
      File "C:\Users\mariyana\Miniconda3\lib\site-packages\conda_env\env.py", line 129, in from_yaml
        data = validate_keys(data, kwargs)
      File "C:\Users\mariyana\Miniconda3\lib\site-packages\conda_env\env.py", line 34, in validate_keys
        for key in data.keys():
    AttributeError: 'NoneType' object has no attribute 'keys'

`$ C:\Users\mariyana\Miniconda3\Scripts\conda-env-script.py update --file spikesorting.yml`

  environment variables:
                 CIO_TEST=<not set>
  CONDA_AUTO_UPDATE_CONDA=false
        CONDA_DEFAULT_ENV=spikesorting
                CONDA_EXE=C:\Users\mariyana\Miniconda3\condabin\..\Scripts\conda.exe
               CONDA_EXES="C:\Users\mariyana\Miniconda3\condabin\..\Scripts\conda.exe"
             CONDA_PREFIX=C:\Users\mariyana\Miniconda3\envs\spikesorting
           CONDA_PREFIX_1=C:\Users\mariyana\Miniconda3
    CONDA_PROMPT_MODIFIER=(spikesorting)
         CONDA_PYTHON_EXE=C:\Users\mariyana\Miniconda3\python.exe
               CONDA_ROOT=C:\Users\mariyana\Miniconda3
              CONDA_SHLVL=2
                 HOMEPATH=\Users\mariyana
                     PATH=C:\Users\mariyana\Miniconda3;C:\Users\mariyana\Miniconda3\Library\ming
                          w-w64\bin;C:\Users\mariyana\Miniconda3\Library\usr\bin;C:\Users\mariya
                          na\Miniconda3\Library\bin;C:\Users\mariyana\Miniconda3\Scripts;C:\User
                          s\mariyana\Miniconda3\bin;C:\Users\mariyana\Miniconda3\envs\spikesorti
                          ng;C:\Users\mariyana\Miniconda3\envs\spikesorting\Library\mingw-w64\bi
                          n;C:\Users\mariyana\Miniconda3\envs\spikesorting\Library\usr\bin;C:\Us
                          ers\mariyana\Miniconda3\envs\spikesorting\Library\bin;C:\Users\mariyan
                          a\Miniconda3\envs\spikesorting\Scripts;C:\Users\mariyana\Miniconda3\en
                          vs\spikesorting\bin;C:\Users\mariyana\Miniconda3\condabin;C:\ProgramDa
                          ta\Oracle\Java\javapath;C:\Program Files\Haskell\bin;C:\Program
                          Files\Haskell Platform\7.10.2-a\lib\extralibs\bin;C:\Program
                          Files\Haskell Platform\7.10.2-a\bin;C:\Program Files
                          (x86)\Lenovo\FusionEngine;C:\Program Files (x86)\Intel\iCLS
                          Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDO
                          WS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0
                          ;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-
                          Static;C:\Program Files\Intel\Intel(R) Management Engine
                          Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine
                          Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine
                          Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine
                          Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common
                          Files\Intel\WirelessCommon;C:\Program Files (x86)\Common
                          Files\lenovo\easyplussdk\bin;C:\emacs-24.5\bin;C:\Program
                          Files\Haskell Platform\7.10.2-a\mingw\bin;C:\Program Files
                          (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program
                          Files\Microsoft SQL Server\130\Tools\Binn;C:\Program
                          Files\Git\cmd;C:\Program Files (x86)\Skype\Phone;C:\Program
                          Files\nodejs;C:\WINDOWS\System32\OpenSSH;C:\Program
                          Files\PuTTY;C:\Program Files (x86)\Heimdal\bin;C:\Program
                          Files\Heimdal\bin;C:\Program Files\Secure
                          Endpoints\NetIDMgr;C:\Program Files\MATLAB\R2018b\bin;C:\Users\mariyan
                          a\AppData\Local\Programs\Python\Python37-32\Scripts;C:\Users\mariyana\
                          AppData\Local\Programs\Python\Python37-32;C:\Users\mariyana\AppData\Lo
                          cal\Programs\Python\Python35\Scripts;C:\Users\mariyana\AppData\Local\P
                          rograms\Python\Python35;C:\Users\mariyana\AppData\Roaming\cabal\bin;C:
                          \Users\mariyana\AppData\Local\Microsoft\WindowsApps;C:\Users\mariyana\
                          AppData\Local\Google\Cloud SDK\google-cloud-
                          sdk\bin;C:\Users\mariyana\AppData\Roaming\npm;.
             PSMODULEPATH=;C:\Users\mariyana\AppData\Local\Google\Cloud SDK\google-cloud-
                          sdk\platform\PowerShell
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : spikesorting
    active env location : C:\Users\mariyana\Miniconda3\envs\spikesorting
            shell level : 2
       user config file : C:\home\.condarc
 populated config files :
          conda version : 4.6.14
    conda-build version : not installed
         python version : 3.7.3.final.0
       base environment : C:\Users\mariyana\Miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\mariyana\Miniconda3\pkgs
                          C:\home\.conda\pkgs
                          C:\Users\mariyana\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\mariyana\Miniconda3\envs
                          C:\home\.conda\envs
                          C:\Users\mariyana\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.6.14 requests/2.21.0 CPython/3.7.3 Windows/10 Windows/10.0.17134
          administrator : False
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?

1 个答案:

答案 0 :(得分:0)

当您的环境Yaml文件损坏或为空时,可能会发生这种情况。我遇到了同样的问题,并注意到在玩conda时,我的environment.yml的内容被删除了。因此,由于None对象,env.py中的for循环失败。