# python_example **Repository Path**: cabbage_huahua/python_example ## Basic Information - **Project Name**: python_example - **Description**: python数据处理 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-09 - **Last Updated**: 2021-11-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # python_example #### 介绍 python数据处理: python地理数据处理完整处理代码;细节处理代码可参考[有道笔记](https://note.youdao.com/s/NzQDuHZO/) #### 依赖包 GDAL,rasterio, numpy等 #### 安装教程 # 安装问题 ### 1. 安装时候无访问权限,或者无法卸载 pip install --user scikit-image --ignore-installed ### 2. conda更新 - geemap只使用与**conda 4.6**及其以上版本,所以之下的版本需要更新 如果在更新时出现以下问题: ``` (D:\Anaconda3) C:\Users\a>conda install mamba -c conda-forge Fetching package metadata ............... Solving package specifications: InvalidSpecError: Invalid spec: =2.7 ``` 则需要进行以下操作: 1. 删除conda-forge,在Anaconda Prompt中运行: ``` conda config --remove channels conda-forge ``` 2. 运行代码: ``` conda install conda=4.6.11 ``` - 在运行conda install后可能会出现The following packages will be UPDATED:,输入y进行更新; - [conda更新参考链接1](https://superuser.com/questions/1425072/update-conda-version-to-4-6-12) - [conda更新问题解决参考链接2](https://github.com/conda/conda/issues/10618) ### 3. gee连接python - [吴秋生github](https://github.com/giswqs/geemap) - [吴秋生YouTube](https://www.youtube.com/channel/UC6V9oXSB3T1XSBsbqtYvKMg) - 在激活gee时```conda activate gee ```,conda 4.6及其以上的版本才可使用```conda activate```命令, 一下版本直接使用```activate gee```; - ### 4. python 更新 在python的个别包进行安装更新时,使用```pip ungrade``` 或者```pip upgrade --all```往往不能达到目的,使用```pip list```可以查看所有包以及版本号。可以下载包的whl文件,然后使用pip进行安装。 ### 5.conda安装包存在的问题 在使用```conda install pyhdf```中出现以下报错内容: ``` Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. PackagesNotFoundError: The following packages are not available from current channels: - pyhdf Current channels: - 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. ``` 在anaconda官网中,pyhdf的owner为**conda-forge ** ![输入图片说明](https://images.gitee.com/uploads/images/2021/1109/153544_a697a709_1748128.png "屏幕截图.png") 通过提供的channel中找到相应的版本;再根据下方代码实现对特定channel中的version进行安装 修改代码为```conda install -c conda-forge pyhdf=0.10.3 ``` > **如果一直在solveing environment** 可选择其他的owner,如```conda install -c zeus1942 pyhdf``` ### 6.conda更新到固定版本 ``` conda install -c conda-forge gdal=3.2.1 ``` 如果版本不存在,可以在[官网](https://anaconda.org/)中查找最新的对应版本 ``` conda install -c anaconda netcdf4 ``` 在查询是需要注意安装的souce类型 ``` conda install -c conda-forge earthpy=0.9.2 ``` ``` conda-forge / earthpy 0.9.2 Utility functions for the working with spatial data ``` ### 7.安装GDAL最好使用msi文件 [安装方法参考](https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows) [文件下载路径](https://www.gisinternals.com/release.php)