在Anaconda环境中安装Arcpy

时间:2019-03-19 07:25:12

标签: python-3.x python-2.7 pycharm anaconda arcpy

我想使用conda复制arcgis的python环境,然后将arcpy插入其中。此环境应与arcgis的python隔离,因此无论对其进行任何更改,都不应影响arcgis。

提示:软件版本        anaconda3(64位)        arcgis 10.2.1        Anaconda 3.6中的python        Arcgis 2.7中的python       操作系统(OS)Windows 10

第一步是创建一个环境以启用arcpy at。我已经在anaconda中输入了anaconda提示符来完成此操作。但是它无法解决环境问题。

(base) C:\windows\system32>conda create -n arcpy python=2.7
Solving environment: failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
  File "C:\Users\Administrator\Anaconda3\lib\encodings\idna.py", line 165, in encode
    raise UnicodeError("label empty or too long")
UnicodeError: label empty or too long

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\exceptions.py", line 819, in __call__
    return func(*args, **kwargs)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\cli\main.py", line 78, in _main
    exit_code = do_call(args, p)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 77, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\cli\main_create.py", line 11, in execute
    install(args, parser, 'create')
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\cli\install.py", line 235, in install
    force_reinstall=context.force,
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\core\solve.py", line 505, in solve_for_transaction
    force_remove, force_reinstall)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\core\solve.py", line 438, in solve_for_diff
    final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\core\solve.py", line 179, in solve_final_state
    index, r = self._prepare(prepared_specs)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\core\solve.py", line 560, in _prepare
    self.subdirs, prepared_specs)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\core\index.py", line 215, in get_reduced_index
    new_records = query_all(spec)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\core\index.py", line 184, in query_all
    return tuple(concat(future.result() for future in as_completed(futures)))
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 94, in query
    self.load()
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 148, in load
    _internal_state = self._load()
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 216, in _load
    mod_etag_headers.get('_mod'))
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 416, in fetch_repodata_remote_request
    timeout=timeout)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\requests\sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\requests\adapters.py", line 440, in send
    timeout=timeout
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\urllib3\connection.py", line 284, in connect
    conn = self._new_conn()
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\urllib3\connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\urllib3\util\connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "C:\Users\Administrator\Anaconda3\lib\socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)

`$ C:\Users\Administrator\Anaconda3\Scripts\conda create -n arcpy python=2.7`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=C:\Users\Administrator\Anaconda3\Scripts\conda.exe
             CONDA_PREFIX=C:\Users\Administrator\Anaconda3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=C:\Users\Administrator\Anaconda3\python.exe
               CONDA_ROOT=C:\Users\Administrator\Anaconda3
              CONDA_SHLVL=1
                 HOMEPATH=\Users\Administrato

   REQUESTS_CA_BUNDLE=<not set>
        SSL_CERT_FILE=<not set>

 active environment : base
active env location : C:\Users\Administrator\Anaconda3
        shell level : 1
   user config file : C:\Users\Administrator\.condarc
 populated config files : C:\Users\Administrator\.condarc
      conda version : 4.5.4
conda-build version : 3.10.5
     python version : 3.6.5.final.0
   base environment : C:\Users\Administrator\Anaconda3  (writable)
       channel URLs : #URLs
      package cache : C:\Users\Administrator\Anaconda3\pkgs
                      C:\Users\Administrator\AppData\Local\conda\conda\pkgs
   envs directories : C:\Users\Administrator\Anaconda3\envs
                      C:\Users\Administrator\AppData\Local\conda\conda\envs
                      C:\Users\Administrator\.conda\envs
           platform : win-64
         user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.5 Windows/10 
Windows/10.0.14393
      administrator : True
         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?
[y/N]:

0 个答案:

没有答案