Liunx 安装basemap


2. 解压 
   tar -zxvf basemap-1.2.1rel.tar.gz
3.  安装依赖包
    
    pip  install numpy  -i  https://mirrors.aliyun.com/pypi/simple

  pip install matplotlib -i https://mirrors.aliyun.com/pypi/simple

pip install pyproj -i https://mirrors.aliyun.com/pypi/simple
    pip  install pyshp  -i  https://mirrors.aliyun.com/pypi/simple
4. 编译安装 geos 库
   cd basemap-1.2.1rel/geos-3.3.3/
   export GEOS_DIR=/usr/local
    ./configure --prefix=$GEOS_DIR
 
    vim include/geos/platform.h
   改:/* #undef HAVE_ISNAN */
   为:#define HAVE_ISNAN 1
    
    make
    make install
5. 安装 basemap
    cd  ..
    python setup.py install
      
6. 测试
    cd examples/
    python simpletest.py
FROM harbor-test.ecoweather.cn/ytq-datacenter_data-handle/python:3.7
WORKDIR /home
COPY . /home

RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple \
    && unzip geos-3.8.1.zip \
    && cd geos-3.8.1/ \
    && export GEOS_DIR=/usr/local \
    && chmod 777 ./configure \
    && ./configure --prefix=$GEOS_DIR \
    && make;make install \
    && cd /home \
    && rm -rf geos-3.8.1 \
    && apt update  -y \
    && apt-get install build-essential python3-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev -y\
    && pip install basemap-1.2.1rel.tar.gz \
    && rm  basemap-1.2.1rel.tar.gz

 requirements.txt

pyshp
pyproj
numpy
matplotlib

 

 

 

参考   https://lumingdong.cn/install-basemap-under-linux.html#comment-201

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM