康达安装cartopy冲突

时间:2019-07-12 07:45:41

标签: python conda cartopy

我必须安装cartopy,这是我已经完成的工作:

[cwullu@dellsv ~]$ conda create -n test  
[cwullu@dellsv ~]$ source activate test  
(test) [cwullu@dellsv ~]$ conda install python=3.6 

在安装了其他软件包之后,我开始安装cartopy:

(test) [cwullu@dellsv ~]$ conda install -c conda-forge cartopy  
Fetching package metadata .............  
Solving package specifications: .  

UnsatisfiableError: The following specifications were found to be in conflict:  
  - cartopy -> python 2.7* -> libgcc-ng >=4.9  
  - cartopy -> python 2.7* -> libstdcxx-ng >=4.9  
  - python 3.6*  
Use "conda info <package>" to see the dependencies for each package.  

这是否意味着cartopy与python3.6冲突?
那我该怎么解决呢?
我试图安装python 2.7,然后安装cartopy,它可以工作。但是当我导入cartopy时,它仍然会引起一些错误。

这是我在这个环境中的全部包裹:

(test) [cwullu@dellsv ~]$ conda list
# packages in environment at /home/cwullu/anaconda3/envs/test:
#
blas                      1.0                         mkl
ca-certificates           2019.6.16            hecc5488_0    conda-forge
cartopy                   0.14.2              np111py35_1    conda-forge
certifi                   2016.2.28                py35_0
cycler                    0.10.0                     py_1    conda-forge
fontconfig                2.12.1                        1    conda-forge
freetype                  2.6.3                         1    conda-forge
geos                      3.4.2                         4    http://conda.binstar.org/unidata
icu                       58.2                          0    conda-forge
jpeg                      9b                            2    conda-forge
libffi                    3.2.1                         3    conda-forge
libgfortran               3.0.0                         1    conda-forge
libiconv                  1.14                          4    conda-forge
libpng                    1.6.34                        0    conda-forge
libtiff                   4.0.8                         0    conda-forge
libxml2                   2.9.5                         1    conda-forge
matplotlib                1.5.3               np111py35_2    conda-forge
mkl                       2017.0.3                      0
mock                      2.0.0                    py35_0    conda-forge
ncurses                   5.9                          10    conda-forge
nose                      1.3.7                    py35_2    conda-forge
numpy                     1.11.3                   py35_0
olefile                   0.46                       py_0    conda-forge
openssl                   1.0.2o                        0    conda-forge
owslib                    0.18.0                     py_0    conda-forge
pbr                       5.3.0                      py_0    conda-forge
pillow                    4.0.0                    py35_1    conda-forge
pip                       9.0.1                    py35_1
proj4                     4.9.1                         1    http://conda.binstar.org/unidata
pyepsg                    0.4.0                      py_0    conda-forge
pyparsing                 2.4.0                      py_0    conda-forge
pyproj                    1.9.4                    py35_0    conda-forge
pyqt                      4.11.4                   py35_3    conda-forge
pyshp                     2.1.0                      py_0    conda-forge
python                    3.5.4                         0
python-dateutil           2.8.0                      py_0    conda-forge
pytz                      2019.1                     py_0    conda-forge
qt                        4.8.7                         3
readline                  6.2                           0    conda-forge
requests                  2.13.0                   py35_0    conda-forge
scipy                     0.19.0              np111py35_0
setuptools                36.4.0                   py35_1
shapely                   1.5.17              np111py35_0    conda-forge
sip                       4.18                     py35_1    conda-forge
six                       1.11.0                   py35_1    conda-forge
sqlite                    3.13.0                        1    conda-forge
tk                        8.5.18                        0
wheel                     0.29.0                   py35_0
xz                        5.2.3                         0    conda-forge
zlib                      1.2.11                        0    conda-forge

谢谢!

2 个答案:

答案 0 :(得分:0)

尝试将pip的Cartopy安装到您的conda环境中。也许没有Python 3 conda软件包,但是根据PyPI,它支持多个版本的Python 3。不是3.6,而是3.5。

https://pypi.org/project/Cartopy/

答案 1 :(得分:0)

为最佳使用conda-forge,应确保conda-forge在频道列表中排在首位,并且已设置channel_priority: strict

$ cat ~/.condarc 
channel_priority: strict
channels:
  - conda-forge
  - defaults

可以在命令行中进行如下设置:

$ conda config --prepend channels conda-forge
$ conda config --set channel_priority strict

我刚刚进行了测试,conda create -n test python=3.6 cartopy在linux64上为我工作。