r-spatial / rgee

Google Earth Engine for R
https://r-spatial.github.io/rgee/
Other
677 stars 146 forks source link

Error: Miniconda is already installed at "C:/Users/dell/AppData/Local/r-miniconda" #180

Closed JialiJIN closed 2 years ago

JialiJIN commented 3 years ago

I installed rgee by the following steps:

remotes::install_github("r-spatial/rgee") ----- DONE

library(reticulate) ------ DONE

But when I ran the code: rgee::ee_install()

it shows the message below:

rgee::ee_install() Collecting package metadata (current_repodata.json): ...working... failed

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

Traceback (most recent call last):
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\exceptions.py", line 1079, in __call__
    return func(*args, **kwargs)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\cli\main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\cli\conda_argparse.py", line 83, in do_call
    return getattr(module, func_name)(args, parser)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\cli\main_create.py", line 41, in execute
    install(args, parser, 'create')
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\cli\install.py", line 261, in install
    unlink_link_transaction = solver.solve_for_transaction(
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\solve.py", line 114, in solve_for_transaction
    unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\solve.py", line 157, in solve_for_diff
    final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\solve.py", line 262, in solve_final_state
    ssc = self._collect_all_metadata(ssc)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\common\io.py", line 88, in decorated
    return f(*args, **kwds)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\solve.py", line 425, in _collect_all_metadata
    index, r = self._prepare(prepared_specs)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\solve.py", line 1020, in _prepare
    reduced_index = get_reduced_index(self.prefix, self.channels,
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\index.py", line 288, in get_reduced_index
    new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\subdir_data.py", line 140, in query_all
    result = tuple(concat(executor.map(subdir_query, channel_urls)))
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\concurrent\futures\_base.py", line 608, in result_iterator
    yield fs.pop().result()
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\concurrent\futures\_base.py", line 445, in result
    return self.__get_result()
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\concurrent\futures\_base.py", line 390, in __get_result
    raise self._exception
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\concurrent\futures\thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\subdir_data.py", line 132, in <lambda>
    subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\subdir_data.py", line 145, in query
    self.load()
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\subdir_data.py", line 210, in load
    _internal_state = self._load()
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\subdir_data.py", line 375, in _load
    raw_repodata_str = fetch_repodata_remote_request(
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\conda\core\subdir_data.py", line 701, in fetch_repodata_remote_request
    resp = session.get(join_url(url, filename), headers=headers, proxies=session.proxies,
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\requests\sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\requests\sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\requests\sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\requests\adapters.py", line 439, in send
    resp = conn.urlopen(
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen
    self._prepare_proxy(conn)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy
    conn.connect()
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\urllib3\connection.py", line 359, in connect
    conn = self._connect_tls_proxy(hostname, conn)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\urllib3\connection.py", line 500, in _connect_tls_proxy
    return ssl_wrap_socket(
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\urllib3\util\ssl_.py", line 453, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\site-packages\urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock)
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\dell\AppData\Local\R-MINI~1\lib\ssl.py", line 997, in _create
    raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname

$ C:\Users\dell\AppData\Local\R-MINI~1\Scripts\conda-script.py create --yes --prefix C:/Users/dell/AppData/Local/r-miniconda/envs/r-reticulate python=3.6 numpy -c conda-forge

environment variables: CIO_TEST= CONDA_EXE=C:\Users\dell\AppData\Local\R-MINI~1\condabin..\Scripts\conda.exe CONDA_EXES="C:\Users\dell\AppData\Local\R-MINI~1\condabin..\Scripts\conda.exe" CONDA_ROOT=C:\Users\dell\AppData\Local\R-MINI~1 CURL_CA_BUNDLE= HOMEPATH=\Users\dell PATH=C:\Users\dell\AppData\Local\R-MINI~1;C:\Users\dell\AppData\Local\R-MIN I~1\Library\mingw-w64\bin;C:\Users\dell\AppData\Local\R-MINI~1\Library \usr\bin;C:\Users\dell\AppData\Local\R-MINI~1\Library\bin;C:\Users\del l\AppData\Local\R-MINI~1\Scripts;C:\Users\dell\AppData\Local\R-MINI~1\ bin;C:\rtools40\usr\bin;C:\Program Files\R\R-4.1.1\bin\x64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\W indows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\ v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\dell\AppData\Local\Microso ft\WindowsApps;C:\Users\dell\anaconda3;C:\Users\dell\anaconda3\Scripts PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\Windows PowerShell\v1.0\Modules PYTHONIOENCODING=utf-8 REQUESTS_CA_BUNDLE= RMARKDOWN_MATHJAX_PATH=C:/Program Files/RStudio/resources/mathjax-27 RS_RPOSTBACK_PATH=C:/Program Files/RStudio/bin/rpostback SSL_CERT_FILE=

 active environment : None
   user config file : C:\Users\dell\.condarc

populated config files : C:\Users\dell.condarc conda version : 4.10.3 conda-build version : not installed python version : 3.9.5.final.0 virtual packages : win=0=0 archspec=1=x86_64 base environment : C:\Users\dell\AppData\Local\R-MINI~1 (writable) conda av data dir : C:\Users\dell\AppData\Local\R-MINI~1\etc\conda conda av metadata url : None channel URLs : https://conda.anaconda.org/conda-forge/win-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/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\dell\AppData\Local\R-MINI~1\pkgs C:\Users\dell.conda\pkgs C:\Users\dell\AppData\Local\conda\conda\pkgs envs directories : C:\Users\dell\AppData\Local\R-MINI~1\envs C:\Users\dell.conda\envs C:\Users\dell\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.10.3 requests/2.25.1 CPython/3.9.5 Windows/10 Windows/10.0.19043 administrator : False netrc file : None offline mode : False

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

Upload did not complete. reticulate did not find any Python ENV on your system.

Would you like to download and install Miniconda? Miniconda is an open source environment management system for Python. See https://docs.conda.io/en/latest/miniconda.html for more details. Windows users must install miniconda/anaconda to use rgee!

If you think it is an error since you know you have a Python environment in your system. Run as follow to solve:

I am wondering if you have any solutions?

Thanks

csaybar commented 3 years ago

Hi it seems it is a problem with proxies https://stackoverflow.com/questions/67297278/valueerror-check-hostname-requires-server-hostname.

Can you create Python ENV with earthengine-api in your system?

JialiJIN commented 3 years ago

Hi Cesar Aybar,

I just solved the problem. I reset my python evns. And I found the Rstudio has its own default python. So every time when I load rgee, I have the problem to set the python envs for rgee. However, when I load rgee in R, it works fine (since R doesn't have the default python I guess).

For me, it is quite weird that I have to define the specific python for rgee every time before I load the package. I used the following codes, and it works:

library(reticulate)reticulate::use_condaenv("C:/Users/dell/AppData/Local/r-miniconda", required = TRUE)py_config()library(rgee)ee_Initialize()

Thanks for your kind reply. :)

Best regards, Jiali Jin

On Fri, Aug 27, 2021 at 7:37 PM Cesar Aybar @.***> wrote:

Hi it seems it is a problem with proxies https://stackoverflow.com/questions/67297278/valueerror-check-hostname-requires-server-hostname .

Can you create Python ENV with earthengine-api in your system?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-spatial/rgee/issues/180#issuecomment-907137909, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2H2MUADUURP6OMKLQ5PWLT652IBANCNFSM5C2ZNB6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Jiali Emily Jin Doctor / Research Associate

Research Insititute of Forestry, Chinese Academy of Forestry Xiangshan Road, Haidian District, Beijing, China, 100091

Skype: Jiali Emily Jin Twitter: @Jiali_Emily_JIN

csaybar commented 2 years ago

Hi @JialiJIN the problem has been solved!. Please run as follow to fix!

remotes::install_github("r-spatial/rgee")
library(rgee)
ee_install()