conda安装basemap 1.2.1失败包冲突,如何解决?

Fail to install basemap 1.2.1 with conda due to package conflicts, how to resolve?

我在非 root 环境中在 Conda(Win 10 64,Python 3.7.3)上安装了 Basemap,但最终遇到了 there is no epsg in the proj folder 的问题。按照 github 的建议,我发现我有 1.2.0 版并尝试安装 1.2.1 但没有成功。

编辑:显然这是与 proj 的不兼容问题,在尝试此操作时可以看出:

conda create -n test python proj basemap=1.2.1 -c defaults -c conda-forge

首先,我将通道 conda-forge 设置为最高优先级,因此我的一半环境得到了更新,但是 Basemap 没有。

然后我尝试强制安装 1.2.1,这导致了关于哪些软件包相互冲突的详细报告:

Package llvm-meta conflicts for:
arrow-cpp -> numpy[version='>=1.16,<2.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
parquet-cpp -> arrow-cpp=0.5 -> numpy[version='>=1.16,<2.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
fastparquet -> numpy[version='>=1.11'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
statsmodels -> numpy=1.11 -> libblas[version='>=3.8.0,<4.0a0'] -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
pandas -> numpy[version='>=1.11.*'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
wordcloud -> numpy -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
mkl-service -> numpy[version='>=1.11.3,<2.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
bokeh -> numpy[version='>=1.7.1'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
blas -> openblas -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
nltk -> numpy -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
liblapack -> libblas==3.8.0=14_openblas -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
matplotlib-base -> numpy[version='>=1.14.6,<2.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
scipy -> blas==1.0=mkl -> libblas==3.8.0=10_mkl -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
libblas -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
scikit-learn -> libcblas[version='>=3.8.0,<4.0a0'] -> libblas==3.8.0=14_openblas -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
basemap=1.2.1 -> numpy[version='>=1.14.6,<2.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
seaborn -> numpy -> libblas[version='>=3.8.0,<4.0a0'] -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
pyarrow -> numpy=1.11 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
libcblas -> libblas==3.8.0=14_openblas -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
matplotlib -> numpy -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
patsy -> numpy[version='>=1.4.0'] -> libblas[version='>=3.8.0,<4.0a0'] -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
numba -> numpy[version='>=1.11,<1.12.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']
numpy -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> llvm-meta[version='5.0.0|5.0.0.*']

Package clangdev conflicts for:
libblas -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
basemap=1.2.1 -> numpy[version='>=1.14.6,<2.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
scikit-learn -> libcblas[version='>=3.8.0,<4.0a0'] -> libblas==3.8.0=14_openblas -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
matplotlib-base -> numpy[version='>=1.14.6,<2.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
seaborn -> numpy -> libblas[version='>=3.8.0,<4.0a0'] -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
blas -> openblas -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
libcblas -> libblas==3.8.0=14_openblas -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
bokeh -> numpy[version='>=1.7.1'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
wordcloud -> numpy -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
matplotlib -> numpy -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
fastparquet -> numpy[version='>=1.11'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
numpy -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
numba -> numpy[version='>=1.11,<1.12.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
nltk -> numpy -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
scipy -> blas==1.0=mkl -> libblas==3.8.0=10_mkl -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
mkl-service -> numpy[version='>=1.11.3,<2.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
pyarrow -> numpy=1.11 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
parquet-cpp -> arrow-cpp=0.5 -> numpy[version='>=1.16,<2.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
pandas -> numpy[version='>=1.11.*'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
liblapack -> libblas==3.8.0=14_openblas -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
arrow-cpp -> numpy[version='>=1.16,<2.0a0'] -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
statsmodels -> numpy=1.11 -> libblas[version='>=3.8.0,<4.0a0'] -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']
patsy -> numpy[version='>=1.4.0'] -> libblas[version='>=3.8.0,<4.0a0'] -> libopenblas==0.3.7=h29e5d5d_0 -> libflang[version='>=5.0.0'] -> openmp==5.0.0 -> clangdev[version='5.0.0|5.0.0.*']

不知所措,llvm-metaclangdev都没有安装在环境中,为什么会和不存在的包发生冲突?

安装 Basemap 1.2.0 时 none 也安装了这些软件包,因此除非 1.2.1 版中的依赖项发生变化,否则这对我来说毫无意义。

我也不知道该向哪个 github 报告,任何建议都会有所帮助。

这是 conda list 的输出:

# Name                    Version                   Build  Channel
alabaster                 0.7.12                     py_0    conda-forge
arrow-cpp                 0.15.0           py37h5c295ed_0    conda-forge
asn1crypto                1.2.0                    py37_0    conda-forge
astroid                   2.3.2                    py37_0    conda-forge
attrs                     19.3.0                     py_0    conda-forge
babel                     2.7.0                      py_0    conda-forge
backcall                  0.1.0                      py_0    conda-forge
beautifulsoup4            4.8.1                    py37_0    conda-forge
blas                      1.0                         mkl
bleach                    3.1.0                      py_0    conda-forge
bokeh                     1.3.4                    py37_0    conda-forge
boost-cpp                 1.70.0               h6a4c333_2    conda-forge
brotli                    1.0.7             he025d50_1000    conda-forge
bzip2                     1.0.8                hfa6e2cd_1    conda-forge
c-ares                    1.15.0            h2fa13f4_1001    conda-forge
ca-certificates           2019.9.11            hecc5488_0    conda-forge
certifi                   2019.6.16                py37_1    conda-forge
cffi                      1.13.1           py37hb32ad35_0    conda-forge
chardet                   3.0.4                 py37_1003    conda-forge
cloudpickle               1.2.2                      py_0    conda-forge
colorama                  0.4.1                      py_0    conda-forge
console_shortcut          0.1.1                         3
cryptography              2.7              py37hb32ad35_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
cython                    0.29.13          py37h6538335_0    conda-forge
decorator                 4.4.1                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
docopt                    0.6.2                    pypi_0    pypi
docutils                  0.15.2                   py37_0    conda-forge
double-conversion         3.1.5                h6538335_1    conda-forge
easyprocess               0.2.7                    pypi_0    pypi
entrypoints               0.3                   py37_1000    conda-forge
et_xmlfile                1.0.1                   py_1001    conda-forge
fastcache                 1.1.0            py37hfa6e2cd_0    conda-forge
fastparquet               0.3.2            py37hc8d92b1_0    conda-forge
freetype                  2.10.0               h563cfd7_1    conda-forge
future                    0.18.1                   py37_0    conda-forge
fuzzywuzzy                0.17.0                     py_0    conda-forge
gflags                    2.2.2             he025d50_1002    conda-forge
glog                      0.4.0                he025d50_1    conda-forge
googletrans               2.4.0                    pypi_0    pypi
grpc-cpp                  1.23.0               h4d7d3fa_0    conda-forge
hdfs                      2.5.8                    pypi_0    pypi
ibm_db                    3.0.1            py37hfa6e2cd_1    conda-forge
icc_rt                    2019.0.0             h0cc432a_1
icu                       64.2                 he025d50_1    conda-forge
idna                      2.8                   py37_1000    conda-forge
imagesize                 1.1.0                      py_0    conda-forge
importlib_metadata        0.23                     py37_0    conda-forge
intel-openmp              2019.4                      245
ipykernel                 5.1.3            py37h5ca1d4c_0    conda-forge
ipython                   7.9.0            py37h5ca1d4c_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
isort                     4.3.21                   py37_0    conda-forge
jdcal                     1.4.1                      py_0    conda-forge
jedi                      0.15.1                   py37_0    conda-forge
jinja2                    2.10.3                     py_0    conda-forge
joblib                    0.14.0                     py_0    conda-forge
jpeg                      9c                hfa6e2cd_1001    conda-forge
jsonschema                3.1.1                    py37_0    conda-forge
jupyter_client            5.3.3                    py37_1    conda-forge
jupyter_core              4.5.0                      py_0    conda-forge
keyring                   19.2.0                   py37_0    conda-forge
kiwisolver                1.1.0            py37he980bc4_0    conda-forge
langid                    1.1.6                    pypi_0    pypi
lazy-object-proxy         1.4.3            py37hfa6e2cd_0    conda-forge
libblas                   3.8.0                    14_mkl    conda-forge
libcblas                  3.8.0                    14_mkl    conda-forge
libclang                  9.0.0                h74a9793_1    conda-forge
liblapack                 3.8.0                    14_mkl    conda-forge
libpng                    1.6.37               h7602738_0    conda-forge
libprotobuf               3.8.0                h1a1b453_0    conda-forge
libsodium                 1.0.17               h2fa13f4_0    conda-forge
libtiff                   4.0.10            h6512ee2_1003    conda-forge
llvmlite                  0.30.0                   py37_0    conda-forge
lz4-c                     1.8.3             he025d50_1001    conda-forge
markupsafe                1.1.1            py37hfa6e2cd_0    conda-forge
matplotlib                3.1.1                    py37_1    conda-forge
matplotlib-base           3.1.1            py37h2852a4a_1    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
mistune                   0.8.4           py37hfa6e2cd_1000    conda-forge
mkl                       2019.4                      245
mkl-service               2.3.0            py37hfa6e2cd_0    conda-forge
more-itertools            7.2.0                      py_0    conda-forge
mpmath                    1.1.0                      py_0    conda-forge
nbconvert                 5.6.1                    py37_0    conda-forge
nbformat                  4.4.0                      py_1    conda-forge
networkx                  2.4                        py_0    conda-forge
nltk                      3.4.4                      py_0    conda-forge
numba                     0.46.0           py37hf9181ef_0
numpy                     1.17.3           py37hc71023c_0    conda-forge
numpydoc                  0.9.1                      py_0    conda-forge
olefile                   0.46                       py_0    conda-forge
openpyxl                  3.0.0                      py_0    conda-forge
openssl                   1.1.1c               hfa6e2cd_0    conda-forge
packaging                 19.2                       py_0    conda-forge
pandas                    0.25.2           py37he350917_0    conda-forge
pandoc                    2.7.3                         0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parquet                   1.2                      pypi_0    pypi
parquet-cpp               1.5.1                         2    conda-forge
parso                     0.5.1                      py_0    conda-forge
patsy                     0.5.1                      py_0    conda-forge
pickleshare               0.7.5                 py37_1000    conda-forge
pillow                    6.2.1            py37h643dfcc_0    conda-forge
pip                       19.3.1                   py37_0    conda-forge
ply                       3.11                     pypi_0    pypi
powershell_shortcut       0.0.1                         2
proj                      6.2.0                ha7a8c7b_1    conda-forge
prompt_toolkit            2.0.10                     py_0    conda-forge
psutil                    5.6.3            py37hfa6e2cd_0    conda-forge
pure-sasl                 0.6.1                      py_0    conda-forge
pyarrow                   0.15.0           py37h803c963_1    conda-forge
pycodestyle               2.5.0                      py_0    conda-forge
pycparser                 2.19                     py37_1    conda-forge
pyflakes                  2.1.1                      py_0    conda-forge
pygments                  2.4.2                      py_0    conda-forge
pyhive                    0.6.1                    py37_0
pylint                    2.4.3                    py37_0    conda-forge
pyopenssl                 19.0.0                   py37_0    conda-forge
pyparsing                 2.4.2                      py_0    conda-forge
pyqt                      5.12.3           py37h6538335_0    conda-forge
pyqt5-sip                 4.19.18                  pypi_0    pypi
pyqtwebengine             5.12.1                   pypi_0    pypi
pyrsistent                0.15.5           py37hfa6e2cd_0    conda-forge
pysocks                   1.7.1                    py37_0    conda-forge
python                    3.7.3                h510b542_1    conda-forge
python-dateutil           2.8.0                      py_0    conda-forge
python-levenshtein        0.12.0          py37hfa6e2cd_1001    conda-forge
python-snappy             0.5.4            py37hd25c944_0    conda-forge
pytz                      2019.3                     py_0    conda-forge
pyunpack                  0.1.2                    pypi_0    pypi
pywin32                   224             py37hfa6e2cd_1000    conda-forge
pywin32-ctypes            0.2.0                 py37_1000    conda-forge
pyyaml                    5.1.2            py37hfa6e2cd_0    conda-forge
pyzmq                     18.1.0           py37h16f9016_0    conda-forge
qt                        5.12.5               h7ef1ec2_0    conda-forge
qtawesome                 0.6.0                      py_0    conda-forge
qtconsole                 4.5.5                      py_0    conda-forge
qtpy                      1.9.0                      py_0    conda-forge
re2                       2019.09.01       vc14h6538335_0  [vc14]  conda-forge
regex                     2019.08.19       py37hfa6e2cd_0    conda-forge
requests                  2.22.0                   py37_1    conda-forge
rope                      0.14.0                     py_0    conda-forge
scikit-learn              0.21.3           py37h7208079_0    conda-forge
scipy                     1.3.1            py37h29ff71c_0
seaborn                   0.9.0                      py_1    conda-forge
setuptools                41.6.0                   py37_0    conda-forge
six                       1.12.0                py37_1000    conda-forge
snappy                    1.1.7             h6538335_1002    conda-forge
snowballstemmer           2.0.0                      py_0    conda-forge
soupsieve                 1.9.4                    py37_0    conda-forge
sphinx                    2.2.1                      py_0    conda-forge
sphinxcontrib-applehelp   1.0.1                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.1                      py_0    conda-forge
sphinxcontrib-htmlhelp    1.0.2                      py_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.2                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.3                      py_0    conda-forge
spyder                    3.3.6                    py37_1    conda-forge
spyder-kernels            0.5.2                    py37_0    conda-forge
sqlalchemy                1.3.10           py37hfa6e2cd_0    conda-forge
sqlite                    3.30.1               hfa6e2cd_0    conda-forge
statsmodels               0.10.1           py37hfa6e2cd_1    conda-forge
sympy                     1.4                      py37_0    conda-forge
tbb                       2019.9               he980bc4_0    conda-forge
testpath                  0.4.2                   py_1001    conda-forge
thrift                    0.11.0          py37h6538335_1001    conda-forge
thrift-cpp                0.12.0            hd042d19_1004    conda-forge
thrift_sasl               0.3.0           py37hfa6e2cd_1001    conda-forge
thriftpy                  0.3.9                    pypi_0    pypi
tk                        8.6.9             hfa6e2cd_1003    conda-forge
tornado                   6.0.3            py37hfa6e2cd_0    conda-forge
tqdm                      4.36.1                     py_0    conda-forge
traitlets                 4.3.3                    py37_0    conda-forge
unidecode                 1.1.1                      py_0    conda-forge
uriparser                 0.9.3                he025d50_1    conda-forge
urllib3                   1.25.6                   py37_0    conda-forge
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_0
wcwidth                   0.1.7                      py_1    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.33.6                   py37_0    conda-forge
win_inet_pton             1.1.0                    py37_0    conda-forge
wincertstore              0.2                   py37_1002    conda-forge
wordcloud                 1.5.0           py37hfa6e2cd_1000    conda-forge
wrapt                     1.11.2           py37hfa6e2cd_0    conda-forge
xlrd                      1.2.0                      py_0    conda-forge
xlsxwriter                1.2.2                      py_0    conda-forge
xmljson                   0.2.0                    pypi_0    pypi
xmltodict                 0.12.0                     py_0    conda-forge
xz                        5.2.4             h2fa13f4_1001    conda-forge
yaml                      0.1.7             hfa6e2cd_1001    conda-forge
zeromq                    4.3.2                h6538335_2    conda-forge
zipp                      0.6.0                      py_0    conda-forge
zlib                      1.2.11            h2fa13f4_1006    conda-forge
zstd                      1.4.0                hd8a0e53_0    conda-forge

您可能想尝试破坏您的环境并重新开始。另外,看起来你几乎已经克隆了基础环境,你确定你需要所有这些包吗?

要删除环境:

conda env remove -n <env name>

要从头开始创建它,您可以指定多个频道进行搜索。 conda-forge 频道有最新版本,但并不总是稳定的。建议尽可能使用默认频道。尝试使用以下方法创建环境:

conda create -n bmap python ipython matplotlib pandas basemap=1.2.1 -c defaults -c conda-forge
编辑

看起来有人在编译时没有检查依赖项proj。如果你 运行

conda search proj=6.2.0 --info -c conda-forge

它显示了 - proj4 ==999999999999 的约束。

在不同的 github 上进行了长时间的搜索和试验后,我发现这里有两个不同的问题:

首先是 Spyder/Anaconda/Miniconda 的问题,特别是自动创建的 Windows - 创建新 Conda 环境的快捷方式。由于某种原因使用该快捷方式启动 Spyder 不会设置 PROJ_LIB 环境变量,而从活动环境中的控制台启动 Spyder 会消除错误。

其次我发现我安装的版本是这些:

basemap                   1.2.0            py37h4e5d7af_0
proj                      6.2.0                ha7a8c7b_1    conda-forge
pyproj                    2.4.0            py37h77f86b8_0    conda-forge

显然这是一个拙劣的安装,因为环境中的任何地方都没有 espg 文件。

我创建了一个一切正常的新测试环境,并查看了那里安装的版本:

basemap                   1.2.1            py37h79c95a4_1    conda-forge
proj4                     5.2.0                ha925a31_1
pyproj                    1.9.6            py37h6782396_0

删除旧版本并专门安装这些版本后,现在一切正常。