如何创建anaconda配置文件(解析.yml文件时出错)?

时间:2019-07-17 19:15:40

标签: anaconda yaml

我通过键入为Anaconda创建了环境规范

conda env export > C:/Users/swansom/test144.yml

我尝试通过键入来安装此环境

conda env create -f C:\Users\swansom\test144.yml

当我尝试从我的anaconda版本生成的.yml文件中安装环境时,它会打印以下堆栈跟踪:


    Traceback (most recent call last):
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\conda\exceptions.py", line 1043, in __call__
        return func(*args, **kwargs)
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\conda_env\cli\main.py", line 73, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\conda_env\cli\main_create.py", line 77, in execute
        directory=os.getcwd())
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\conda_env\specs\__init__.py", line 40, in detect
        if spec.can_handle():
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\conda_env\specs\yaml_file.py", line 18, in can_handle
        self._environment = env.from_file(self.filename)
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\conda_env\env.py", line 144, in from_file
        return from_yaml(yamlstr, filename=filename)
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\conda_env\env.py", line 129, in from_yaml
        data = yaml_load_standard(yamlstr)
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\conda\common\serialize.py", line 76, in yaml_load_standard
        return yaml.load(string, Loader=yaml.Loader, version="1.2")
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\ruamel_yaml\main.py", line 638, in load
        loader = Loader(stream, version, preserve_quotes=preserve_quotes)
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\ruamel_yaml\loader.py", line 46, in __init__
        Reader.__init__(self, stream, loader=self)
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 80, in __init__
        self.stream = stream  # type: Any  # as .read is called
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 112, in stream
        self.check_printable(val)
      File "C:\Users\swansom\AppData\Local\Continuum\anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 233, in check_printable
        'unicode', "special characters are not allowed")
    ruamel_yaml.reader.ReaderError: unacceptable character #x0000: special characters are not allowed
      in "<unicode string>", position 3

`$ C:\Users\swansom\AppData\Local\Continuum\anaconda3\Scripts\conda-env-script.py create -f C:\Users\swansom\test144.yml````

这是文件的内容:

name: myenv
channels:
  - conda-forge
  - defaults
dependencies:
  - alabaster=0.7.12=py27_0
  - amqp=2.5.0=py_1
  - asn1crypto=0.24.0=py27_0
  - astroid=1.6.5=py27_0
  - attrs=19.1.0=py27_1
  - babel=2.7.0=py_0
  - backports=1.0=py_2
  - backports.functools_lru_cache=1.5=py_2
  - backports.shutil_get_terminal_size=1.0.0=py27_2
  - backports.shutil_which=3.5.2=py27_0
  - backports_abc=0.5=py27h0ec6b72_0
  - billiard=3.6.0.0=py27h0c8e037_0
  - blas=1.0=mkl
  - bleach=3.1.0=py27_0
  - ca-certificates=2019.5.15=0
  - celery=4.4.0rc1=py_0
  - certifi=2019.6.16=py27_0
  - cffi=1.12.3=py27hcfb25f9_0
  - chardet=3.0.4=py27_1
  - cloudpickle=1.2.1=py_0
  - colorama=0.4.1=py27_0
  - configparser=3.7.4=py27_0
  - cryptography=2.4.2=py27hc64555f_0
  - cycler=0.10.0=py27h59acbbf_0
  - decorator=4.4.0=py27_1
  - defusedxml=0.6.0=py_0
  - docutils=0.14=py27h8652d09_0
  - entrypoints=0.3=py27_0
  - enum34=1.1.6=py27_1
  - et_xmlfile=1.0.1=py27h1de5d23_0
  - freetype=2.9.1=h4d385ea_1
  - functools32=3.2.3.2=py27_1
  - future=0.17.1=py27_0
  - futures=3.2.0=py27_0
  - h5py=2.9.0=py27hb721d18_0
  - hdf5=1.10.4=h530792d_0
  - icc_rt=2019.0.0=h0cc432a_1
  - icu=58.2=h2aa20d9_1
  - idna=2.8=py27_0
  - imagesize=1.1.0=py27_0
  - intel-openmp=2019.4=245
  - ipaddress=1.0.22=py27_0
  - ipykernel=4.10.0=py27_0
  - ipython=5.8.0=py27_0
  - ipython_genutils=0.2.0=py27hbe997df_0
  - isort=4.3.21=py27_0
  - jdcal=1.4.1=py_0
  - jedi=0.13.3=py27_0
  - jinja2=2.10.1=py27_0
  - jpeg=9b=ha175dff_2
  - jsonschema=3.0.1=py27_0
  - jupyter_client=5.2.4=py27_0
  - jupyter_core=4.5.0=py_0
  - jupyterlab=0.33.11=py27_0
  - jupyterlab_launcher=0.11.2=py27h28b3542_0
  - keyring=18.0.0=py27_0
  - kiwisolver=1.1.0=py27hc56fc5f_0
  - kombu=4.6.1=py_0
  - lazy-object-proxy=1.4.1=py27h0c8e037_0
  - libpng=1.6.37=h7a46e7a_0
  - libsodium=1.0.16=h8b3e59e_0
  - libtiff=4.0.10=h1c3b264_2
  - linecache2=1.0.0=py27_0
  - m2w64-gcc-libgfortran=5.3.0=6
  - m2w64-gcc-libs=5.3.0=7
  - m2w64-gcc-libs-core=5.3.0=7
  - m2w64-gmp=6.1.0=2
  - m2w64-libwinpthread-git=5.0.0.4634.697f757=2
  - markupsafe=1.1.1=py27h0c8e037_0
  - matplotlib=2.2.3=py27h263d877_0
  - mccabe=0.6.1=py27_1
  - mistune=0.8.4=py27h0c8e037_0
  - mkl=2019.4=245
  - mkl_fft=1.0.12=py27h44c1dab_0
  - msys2-conda-epoch=20160418=1
  - nbconvert=5.5.0=py_0
  - nbformat=4.4.0=py27hf49b375_0
  - notebook=5.7.8=py27_0
  - numpy=1.16.3=py27h5fc8d92_0
  - numpy-base=1.16.3=py27hb1d0314_0
  - numpydoc=0.9.1=py_0
  - olefile=0.46=py27_0
  - openpyxl=2.6.2=py_0
  - openssl=1.0.2s=h0c8e037_0
  - packaging=19.0=py27_0
  - pandas=0.24.2=py27hc56fc5f_0
  - pandoc=2.2.3.2=0
  - pandocfilters=1.4.2=py27_1
  - parso=0.5.0=py_0
  - pathlib2=2.3.4=py27_0
  - pickleshare=0.7.5=py27_0
  - pillow=6.0.0=py27h5b88493_0
  - pip=19.1.1=py27_0
  - prometheus_client=0.7.1=py_0
  - prompt_toolkit=1.0.15=py27h3a8ec6a_0
  - psutil=5.6.3=py27h0c8e037_0
  - pycodestyle=2.5.0=py27_0
  - pycparser=2.19=py27_0
  - pyflakes=2.1.1=py27_0
  - pygments=2.4.2=py_0
  - pylint=1.9.2=py27_0
  - pyopenssl=19.0.0=py27_0
  - pyparsing=2.4.0=py_0
  - pyqt=5.6.0=py27h6e61f57_6
  - pyreadline=2.1=py27_1
  - pyrsistent=0.14.11=py27h0c8e037_0
  - pysocks=1.7.0=py27_0
  - python=2.7.16=hcb6e200_0
  - python-dateutil=2.8.0=py27_0
  - pytz=2019.1=py_0
  - pywin32=223=py27h0c8e037_1
  - pywinpty=0.5.5=py27_1000
  - pyzmq=18.0.0=py27hc56fc5f_0
  - qt=5.6.2=vc9hc26998b_12
  - qtawesome=0.5.7=py27_1
  - qtconsole=4.5.1=py_0
  - qtpy=1.8.0=py_0
  - requests=2.22.0=py27_0
  - rope=0.14.0=py_0
  - scandir=1.10.0=py27h0c8e037_0
  - scikit-learn=0.20.3=py27hf381715_0
  - scipy=1.2.1=py27h4c3ab11_0
  - send2trash=1.5.0=py27_0
  - setuptools=41.0.1=py27_0
  - simplegeneric=0.8.1=py27_2
  - simplejson=3.16.0=py27h0c8e037_0
  - simplekml=1.3.0=py_1
  - singledispatch=3.4.0.3=py27h3f9d112_0
  - sip=4.18.1=py27hc56fc5f_2
  - six=1.12.0=py27_0
  - snowballstemmer=1.9.0=py_0
  - sphinx=1.8.5=py27_0
  - sphinxcontrib=1.0=py27_1
  - sphinxcontrib-websupport=1.1.2=py_0
  - spyder=3.3.5=py27_0
  - spyder-kernels=0.5.0=py27_0
  - sqlalchemy=1.3.5=py27h0c8e037_0
  - sqlite=3.28.0=h0c8e037_0
  - subprocess32=3.5.4=py27h0c8e037_0
  - terminado=0.8.2=py27_0
  - testpath=0.4.2=py27_0
  - tornado=5.1.1=py27h0c8e037_0
  - tqdm=4.32.1=py_0
  - traceback2=1.4.0=py27_0
  - traitlets=4.3.2=py27h1b1b3a5_0
  - typing=3.7.4=py27_0
  - unittest2=1.1.0=py27_0
  - urllib3=1.24.2=py27_0
  - vc=9=h7299396_1
  - vine=1.3.0=py_0
  - vs2008_runtime=9.00.30729.1=hfaea7d5_1
  - wcwidth=0.1.7=py27hb1a0d82_0
  - webencodings=0.5.1=py27_1
  - wheel=0.33.4=py27_0
  - win_inet_pton=1.1.0=py27_0
  - win_unicode_console=0.5=py27hc037021_0
  - wincertstore=0.2=py27hf04cefb_0
  - winpty=0.4.3=4
  - wrapt=1.11.2=py27h0c8e037_0
  - xz=5.2.4=h3cc03e0_4
  - zeromq=4.3.1=h2880e7c_3
  - zlib=1.2.11=h3cc03e0_3
  - zstd=1.3.7=h1b0e4d7_0
  - pip:
    - tk==0.1.0
prefix: C:\Users\swansom\AppData\Local\Continuum\anaconda3\envs\myenv

请让我知道可能是什么问题

0 个答案:

没有答案