【问题标题】:conda install cartopy conflictconda 安装 cartopy 冲突
【发布时间】:2019-07-12 07:45:41
【问题描述】:

我必须安装 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

谢谢!!

【问题讨论】:

  • 使用 conda 一次安装 1 个程序会导致依赖冲突。尝试使用一些包创建新环境:conda create -n cartopy_env python=3.5 cartopy conda 将为您解决可能的冲突。但安装时间会更长。
  • 谢谢!我用了这个方法,看来cartopy可以安装好了。但是这次我不能使用python了...可以安装但是我无法进入python shell。
  • 它显示此消息:“python: /lib64/libc.so.6: 找不到版本‘GLIBC_2.7’(/home/cwullu/anaconda3/envs/test2/bin/ 需要。 ./lib/libpython3.5m.so.1.0) "

标签: python conda cartopy


【解决方案1】:

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

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

【讨论】:

  • 谢谢!但是我已经测试过使用pip,还是有一些问题……
【解决方案2】:

为了最好地使用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 上为我工作。

【讨论】:

  • 谢谢!但是当我运行“conda config --set channel_priority strict”时,它引发了一个错误:“TypeCoercionError: The value 'strict' cannot be boolified.”。我该如何解决这个问题?谢谢!
  • 您的 conda 版本是多少? conda list -n base conda
  • 我的anaconda版本是4.4.0,conda是4.3.21
  • 你真的应该升级 conda 并执行我的示例 conda create 命令,你尝试将 python=3.6 安装到 python=2.7 环境中。
猜你喜欢
  • 2017-10-29
  • 2015-12-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-12-25
  • 2023-03-24
  • 2020-11-20
  • 1970-01-01
相关资源
最近更新 更多