Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgee ee_install error: one or more Python packages failed to install [error code 1] #63

Closed
3 tasks
wudiweishao opened this issue Jun 16, 2020 · 10 comments
Closed
3 tasks

Comments

@wudiweishao
Copy link

wudiweishao commented Jun 16, 2020

  • rgee version:
  • R version:
  • Operating System:

At submit an issue, please attached the following information of your rgee session:

  • You have the Python API installed (from terminal):
earthengine -h
  • You can find the credentials file on your system:
library(rgee)
ee_path <- path.expand("~/.config/earthengine/credentials")
file.exists(ee_path)
  • You can run a simple EE command from R:
library(rgee)

# Initialize the Earth Engine module.
ee_Initialize()

# Print metadata for a DEM dataset.
print(ee$Image('USGS/SRTMGL1_003')$getInfo())

Attach your Python (reticulate) configuration:

library(reticulate)
py_config()

Description

I want to install the rgee package and but in the installation process, the error accured. I have tried to install the earthengine-api(version==0.1.223) using anoconda3 prompt but after that , the same error as follows.

What I Did

library(rgee)

ee_install()

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: C:\Users\13227\AppData\Local\r-miniconda\envs\r-reticulate

  added / updated specs:
    - numpy
    - python=3.6


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2020.4.5.2         |   py36h9f0ad1d_0         153 KB  conda-forge
    mkl-2020.0                 |              166        98.9 MB
    wheel-0.34.2               |             py_1          24 KB  conda-forge
    wincertstore-0.2           |        py36_1003          13 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        99.1 MB

The following NEW packages will be INSTALLED:

  certifi            conda-forge/win-64::certifi-2020.4.5.2-py36h9f0ad1d_0
  intel-openmp       pkgs/main/win-64::intel-openmp-2020.0-166
  libblas            conda-forge/win-64::libblas-3.8.0-15_mkl
  libcblas           conda-forge/win-64::libcblas-3.8.0-15_mkl
  liblapack          conda-forge/win-64::liblapack-3.8.0-15_mkl
  mkl                pkgs/main/win-64::mkl-2020.0-166
  numpy              conda-forge/win-64::numpy-1.18.5-py36h4d86e3b_0
  pip                conda-forge/noarch::pip-20.1.1-py_1
  python             conda-forge/win-64::python-3.6.10-he025d50_1009_cpython
  python_abi         conda-forge/win-64::python_abi-3.6-1_cp36m
  setuptools         conda-forge/win-64::setuptools-47.3.0-py36h9f0ad1d_0
  vc                 conda-forge/win-64::vc-14.1-h869be7e_1
  vs2015_runtime     conda-forge/win-64::vs2015_runtime-14.16.27012-h30e32a0_2
  wheel              conda-forge/noarch::wheel-0.34.2-py_1
  wincertstore       conda-forge/win-64::wincertstore-0.2-py36_1003



Downloading and Extracting Packages
wincertstore-0.2     | 13 KB     | ########## | 100% 
mkl-2020.0           | 98.9 MB   | ########## | 100% 
certifi-2020.4.5.2   | 153 KB    | ########## | 100% 
wheel-0.34.2         | 24 KB     | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
#
# To activate this environment, use
#
#     $ conda activate C:\Users\13227\AppData\Local\r-miniconda\envs\r-reticulate
#
# To deactivate an active environment, use
#
#     $ conda deactivate

------------------------------------ Python configuration used to create rgee --
python:         C:/Users/13227/AppData/Local/r-miniconda/envs/r-reticulate/python.exe
libpython:      C:/Users/13227/AppData/Local/r-miniconda/envs/r-reticulate/python36.dll
pythonhome:     C:/Users/13227/AppData/Local/r-miniconda/envs/r-reticulate
version:        3.6.10 (default, Mar  5 2020, 10:17:47) [MSC v.1900 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:/Users/13227/AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages/numpy
numpy_version:  1.18.5
-------------------------------------------------------------------------------- 
1. Removing the previous Python Environment (rgee), if it exists ...

2. Creating a Python Environment (rgee)
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: C:\Users\13227\ANACON~1\envs\rgee

  added / updated specs:
    - python


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    openssl-1.1.1g             |       he774522_0         5.7 MB  conda-forge
    ------------------------------------------------------------
                                           Total:         5.7 MB

The following NEW packages will be INSTALLED:

  ca-certificates    conda-forge/win-64::ca-certificates-2020.4.5.2-hecda079_0
  certifi            conda-forge/win-64::certifi-2020.4.5.2-py38h32f6830_0
  openssl            conda-forge/win-64::openssl-1.1.1g-he774522_0
  pip                conda-forge/noarch::pip-20.1.1-py_1
  python             conda-forge/win-64::python-3.8.3-cpython_h5fd99cc_0
  python_abi         conda-forge/win-64::python_abi-3.8-1_cp38
  setuptools         conda-forge/win-64::setuptools-47.3.0-py38h32f6830_0
  sqlite             conda-forge/win-64::sqlite-3.30.1-hfa6e2cd_0
  vc                 conda-forge/win-64::vc-14.1-h869be7e_1
  vs2015_runtime     conda-forge/win-64::vs2015_runtime-14.16.27012-h30e32a0_2
  wheel              conda-forge/noarch::wheel-0.34.2-py_1
  wincertstore       conda-forge/win-64::wincertstore-0.2-py38_1003



Downloading and Extracting Packages
openssl-1.1.1g       | 5.7 MB    | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
#
# To activate this environment, use
#
#     $ conda activate rgee
#
# To deactivate an active environment, use
#
#     $ conda deactivate


ee_install want to store the environmental variables: EARTHENGINE_PYTHON 
and EARTHENGINE_PYTHON_ENV in your .Renviron file to use the Python path:
C:\Users\13227\anaconda3\envs\rgee\python.exe in future sessions.
Would you like to continues? [Y/n]:Y

3. The Environment Variable 'EARTHENGINE_PYTHON=C:\Users\13227\anaconda3\envs\rgee\python.exe' 
has been stored in your .Renviron file. Remember that you
can remove EARTHENGINE_PYTHON  and EARTHENGINE_ENV using
 rgee::ee_clean_pyenv().

4. Installing the earthengine-api. Running: 
reticulate::py_install(packages = 'earthengine-api', envname = 'C:/Users/13227/anaconda3/envs/rgee')

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: C:\Users\13227\anaconda3\envs\rgee

  added / updated specs:
    - python


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    openssl-1.1.1g             |       he774522_0         4.8 MB
    ------------------------------------------------------------
                                           Total:         4.8 MB

The following packages will be SUPERSEDED by a higher-priority channel:

  ca-certificates    conda-forge::ca-certificates-2020.4.5~ --> pkgs/main::ca-certificates-2020.1.1-0
  certifi            conda-forge::certifi-2020.4.5.2-py38h~ --> pkgs/main::certifi-2020.4.5.1-py38_0
  openssl                                       conda-forge --> pkgs/main
  python             conda-forge::python-3.8.3-cpython_h5f~ --> pkgs/main::python-3.8.1-h5fd99cc_1



Downloading and Extracting Packages
openssl-1.1.1g       | 4.8 MB    | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - earthengine-api==0.1.225

Current channels:

  - 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

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.


错误: one or more Python packages failed to install [error code 1]
>
@wudiweishao
Copy link
Author

I have update my R and RStudio version (
R version 4.0.1, RStudio version 1.3.959)

@csaybar
Copy link
Collaborator

csaybar commented Jun 16, 2020

@wudiweishao Thanks for reporting this!

This error occurs because the conda repositories you are using have not yet updated to the latest version of earthengine-api. https://anaconda.org/conda-forge/earthengine-api

I thought something like this might happen, so I added a new function in rgee ee_install_upgrade.
You can fix this error by running:

library(rgee)
ee_install_upgrade(version = "0.1.224")

If the problem persists, show me the output error and the following global envs.

Sys.getenv("EARTHENGINE_PYTHON")
Sys.getenv("EARTHENGINE_ENV")

@wudiweishao
Copy link
Author

thanks for you timely response!
as your instruction, I have upgrade and restart the RStudio. Now, it worked for the ee_install, but new problem accured when using ee_Initialize(). T he information is in below:
library(rgee)

ee_Initialize()
-- rgee 0.6.1 --------------------------------------- earthengine-api 0.1.224 --
√ email: not_defined
√ Initializing Google Earth Engine:Error in py_call_impl(callable, dots$args, dots$keywords) : URLError: <urlopen error [WinError 10060] 鐢变簬杩炴帴鏂瑰湪涓€娈垫椂闂村悗娌℃湁姝g‘绛斿鎴栬繛鎺ョ殑涓绘満娌℃湁鍙嶅簲锛岃繛鎺ュ皾璇曞け璐ャ€?
ee_Initialize()
-- rgee 0.6.1 --------------------------------------- earthengine-api 0.1.224 --
√ email: not_defined
√ Initializing Google Earth Engine:Error in py_call_impl(callable, dots$args, dots$keywords) : URLError: <urlopen error [WinError 10060] 鐢变簬杩炴帴鏂瑰湪涓€娈垫椂闂村悗娌℃湁姝g‘绛斿鎴栬繛鎺ョ殑涓绘満娌℃湁鍙嶅簲锛岃繛鎺ュ皾璇曞け璐ャ€?
Sys.getenv("EARTHENGINE_PYTHON")
[1] "C:\Users\13227\anaconda3\envs\rgee\python.exe"
Sys.getenv("EARTHENGINE_ENV")
[1] "rgee"

@csaybar
Copy link
Collaborator

csaybar commented Jun 16, 2020

This doesn't seem to be a problem with rgee but a network problem (WinError 10060). Maybe this could help
gee-community/geemap#92 (comment)
gee-community/geemap#83 (comment)

@wudiweishao
Copy link
Author

thank you very much!
frankly speaking, I am still wonder why I can access the code editor, dataset or other application of gee in website with my gee account but I can not have the gee authentication. that's weird.

@csaybar
Copy link
Collaborator

csaybar commented Jun 16, 2020

Can you run in Python or R this code successfully?. Maybe using a VPN solves the problem.

library(rgee)
ee$Authenticate()
import ee
ee.Authenticate()

@wudiweishao
Copy link
Author

wudiweishao commented Jun 17, 2020

same error as before when I run the codd of" library(rgee)
ee$Authenticate()" in RStudio.
I have look through many resources for my problem and I find that if I change the proxy then I can initialize gee.
code:

import geemap
import ee
import os
os.environ['HTTP_PROXY'] = 'http://127.0.0.1:1080'
os.environ['HTTPS_PROXY'] = 'http://127.0.0.1:1080'
ee.Authenticate()
ee.Initialize()
Map = geemap.Map(center=(40, -100), zoom=4)
Map
# Add Earth Engine dataset
image = ee.Image('USGS/SRTMGL1_003')
image = ee.Image('USGS/SRTMGL1_003')

# Set visualization parameters.
vis_params = {
  'min': 0,
  'max': 4000,
  'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']}

# Print the elevation of Mount Everest.
xy = ee.Geometry.Point([86.9250, 27.9881])
elev = image.sample(xy, 30).first().get('elevation').getInfo()
print('Mount Everest elevation (m):', elev)

# Add Earth Engine layers to Map
Map.addLayer(image, vis_params, 'STRM DEM', True, 0.5)
Map.addLayer(xy, {'color': 'red'}, 'Mount Everest')

# Set center of the map
Map.centerObject(ee_object=xy, zoom=13)
Map.setCenter(lon=-100, lat=40, zoom=4)

output:
C:\Users\13227\anaconda3\envs\gee\python.exe "D:/geemap/geemap learning"
To authorize access needed by Earth Engine, open the following URL in a web browser and follow the instructions. If the web browser does not start automatically, please manually browse the URL below.

    https://accounts.google.com/o/oauth2/auth?client_id=517222506229-vsmmajv00ul0bs7p89v5m89qs8eb9359.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fearthengine+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&code_challenge=uHg0meENUidvR0VtPYoiWfJWIaAtTrK5CZ1UtZGZRps&code_challenge_method=S256

The authorization workflow will generate a code, which you should paste in the box below. 
Enter verification code: 4/0wFfn0T265dqyb8eJdFDTRa2NrV4R3irdcLTv__80Pwsg00C_PbcD14

Successfully saved authorization token.
Mount Everest elevation (m): 8729

Process finished with exit code 0

the proxy information in my computer is like this:
F@9Z BPXI16(SI}@EIJL)68

@wudiweishao
Copy link
Author

however, I use the pycharm, but I can not see the interactive map(the result). so what should I do to show or save my result?
PS, any idear about the solution for the problem in R?
thank you very much

@csaybar
Copy link
Collaborator

csaybar commented Jun 17, 2020

Unfortunately, I don't know why Map display does not work, but If you want to configure your HTTP_PROXY in R you need to run as follow:

library(rgee)
Sys.setenv(http_proxy='http://127.0.0.1:1080')
ee_Initialize()

@LiuLiangCDUT
Copy link

Maybe you can try another browser, such as firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants