导入惊喜在 python3 中抛出 ContextualVersionConflict 错误

问题描述 投票:0回答:1

嗨,我安装了惊喜包,但它在

import
处出现错误(第 3 节中的错误消息)


  1. conda cmd
    ,我安装了
    surprise
    ,后来又重新安装了
    scipy
    ,因为它在错误消息中。如下:

安装

surprise

(base) C:\Users\yzhang>conda install -c conda-forge scikit-surprise
Solving environment: done

## Package Plan ##

  environment location: d:\ProgramData\Anaconda3

  added / updated specs:
    - scikit-surprise


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    joblib-0.11                |           py36_0         194 KB  conda-forge
    openssl-1.0.2o             |           vc14_0         5.4 MB  conda-forge
    zlib-1.2.11                |           vc14_0         119 KB  conda-forge
    yaml-0.1.7                 |           vc14_0         103 KB  conda-forge
    sqlite-3.22.0              |           vc14_0         907 KB  conda-forge
    lzo-2.10                   |           vc14_0         154 KB  conda-forge
    libpng-1.6.34              |           vc14_0         547 KB  conda-forge
    krb5-1.14.6                |           vc14_0         767 KB  conda-forge
    libssh2-1.8.0              |           vc14_2         184 KB  conda-forge
    icu-58.2                   |           vc14_0        21.8 MB  conda-forge
    bzip2-1.0.6                |           vc14_1         144 KB  conda-forge
    conda-4.5.4                |           py36_0         650 KB  conda-forge
    curl-7.55.1                |           vc14_0         339 KB  conda-forge
    libxml2-2.9.8              |           vc14_0         3.2 MB  conda-forge
    hdf5-1.10.1                |           vc14_2        17.9 MB  conda-forge
    scikit-surprise-1.0.6      |           py36_0         589 KB  conda-forge
    qt-5.6.2                   |           vc14_1        55.6 MB  conda-forge
    libiconv-1.15              |           vc14_0         682 KB  conda-forge
    jpeg-9b                    |           vc14_2         314 KB  conda-forge
    zeromq-4.2.5               |           vc14_1         9.6 MB  conda-forge
    freetype-2.8.1             |           vc14_0         469 KB  conda-forge
    libxslt-1.1.32             |           vc14_0         456 KB  conda-forge
    certifi-2018.4.16          |           py36_0         143 KB  conda-forge
    libsodium-1.0.16           |           vc14_0         582 KB  conda-forge
    libtiff-4.0.9              |           vc14_0         616 KB  conda-forge
    tk-8.6.7                   |           vc14_0         3.5 MB  conda-forge
    ca-certificates-2018.4.16  |                0         176 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       124.9 MB

The following NEW packages will be INSTALLED:

    joblib:          0.11-py36_0           conda-forge
    krb5:            1.14.6-vc14_0         conda-forge [vc14]
    scikit-surprise: 1.0.6-py36_0          conda-forge

The following packages will be UPDATED:

    bzip2:           1.0.6-vc14hdec8e7a_1              --> 1.0.6-vc14_1     conda-forge [vc14]
    ca-certificates: 2018.03.07-0                      --> 2018.4.16-0      conda-forge
    certifi:         2018.4.16-py36_0                  --> 2018.4.16-py36_0 conda-forge
    conda:           4.5.4-py36_0                      --> 4.5.4-py36_0     conda-forge
    freetype:        2.8-vc14h17c9bdf_0                --> 2.8.1-vc14_0     conda-forge [vc14]
    hdf5:            1.10.1-vc14hb361328_0             --> 1.10.1-vc14_2    conda-forge [vc14]
    icu:             58.2-vc14hc45fdbb_0               --> 58.2-vc14_0      conda-forge [vc14]
    jpeg:            9b-vc14h4d7706e_1                 --> 9b-vc14_2        conda-forge [vc14]
    libpng:          1.6.32-vc14h5163883_3             --> 1.6.34-vc14_0    conda-forge [vc14]
    libsodium:       1.0.16-h9d3ae62_0                 --> 1.0.16-vc14_0    conda-forge [vc14]
    libssh2:         1.8.0-vc14hcf584a9_2              --> 1.8.0-vc14_2     conda-forge [vc14]
    libtiff:         4.0.8-vc14h04e2a1e_10             --> 4.0.9-vc14_0     conda-forge [vc14]
    libxml2:         2.9.4-vc14h8fd0f11_5              --> 2.9.8-vc14_0     conda-forge [vc14]
    libxslt:         1.1.29-vc14hf85b8d4_5             --> 1.1.32-vc14_0    conda-forge [vc14]
    openssl:         1.0.2o-h8ea7d77_0                 --> 1.0.2o-vc14_0    conda-forge [vc14]
    sqlite:          3.20.1-vc14h7ce8c62_1             --> 3.22.0-vc14_0    conda-forge [vc14]
    zeromq:          4.2.5-hc6251cf_0                  --> 4.2.5-vc14_1     conda-forge [vc14]

The following packages will be DOWNGRADED:

    curl:            7.55.1-vc14hdaba4a4_3             --> 7.55.1-vc14_0    conda-forge [vc14]
    libiconv:        1.15-vc14h29686d3_5               --> 1.15-vc14_0      conda-forge [vc14]
    lzo:             2.10-vc14h0a64fa6_1               --> 2.10-vc14_0      conda-forge [vc14]
    qt:              5.6.2-vc14h6f8c307_12             --> 5.6.2-vc14_1     conda-forge [vc14]
    tk:              8.6.7-vc14hb68737d_1              --> 8.6.7-vc14_0     conda-forge [vc14]
    yaml:            0.1.7-vc14hb31d195_1              --> 0.1.7-vc14_0     conda-forge [vc14]
    zlib:            1.2.11-vc14h1cdd9ab_1             --> 1.2.11-vc14_0    conda-forge [vc14]

Proceed ([y]/n)? y


Downloading and Extracting Packages
joblib-0.11          |  194 KB | ############################################################################## | 100%
openssl-1.0.2o       |  5.4 MB | ############################################################################## | 100%
zlib-1.2.11          |  119 KB | ############################################################################## | 100%
yaml-0.1.7           |  103 KB | ############################################################################## | 100%
sqlite-3.22.0        |  907 KB | ############################################################################## | 100%
lzo-2.10             |  154 KB | ############################################################################## | 100%
libpng-1.6.34        |  547 KB | ############################################################################## | 100%
krb5-1.14.6          |  767 KB | ############################################################################## | 100%
libssh2-1.8.0        |  184 KB | ############################################################################## | 100%
icu-58.2             | 21.8 MB | ############################################################################## | 100%
bzip2-1.0.6          |  144 KB | ############################################################################## | 100%
conda-4.5.4          |  650 KB | ############################################################################## | 100%
curl-7.55.1          |  339 KB | ############################################################################## | 100%
libxml2-2.9.8        |  3.2 MB | ############################################################################## | 100%
hdf5-1.10.1          | 17.9 MB | ############################################################################## | 100%
scikit-surprise-1.0. |  589 KB | ############################################################################## | 100%
qt-5.6.2             | 55.6 MB | ############################################################################## | 100%
libiconv-1.15        |  682 KB | ############################################################################## | 100%
jpeg-9b              |  314 KB | ############################################################################## | 100%
zeromq-4.2.5         |  9.6 MB | ############################################################################## | 100%
freetype-2.8.1       |  469 KB | ############################################################################## | 100%
libxslt-1.1.32       |  456 KB | ############################################################################## | 100%
certifi-2018.4.16    |  143 KB | ############################################################################## | 100%
libsodium-1.0.16     |  582 KB | ############################################################################## | 100%
libtiff-4.0.9        |  616 KB | ############################################################################## | 100%
tk-8.6.7             |  3.5 MB | ############################################################################## | 100%
ca-certificates-2018 |  176 KB | ############################################################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

安装

scipy

(base) C:\Users\yzhang>conda install scipy
Solving environment: done

## Package Plan ##

  environment location: d:\ProgramData\Anaconda3

  added / updated specs:
    - scipy


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2018.4.16          |           py36_0         143 KB
    scipy-1.1.0                |   py36h672f292_0        13.5 MB
    conda-4.5.4                |           py36_0         1.0 MB
    mkl-2018.0.3               |                1       178.1 MB
    ------------------------------------------------------------
                                           Total:       192.8 MB

The following packages will be UPDATED:

    certifi:         2018.4.16-py36_0      conda-forge --> 2018.4.16-py36_0
    conda:           4.5.4-py36_0          conda-forge --> 4.5.4-py36_0
    mkl:             2018.0.0-h36b65af_4               --> 2018.0.3-1
    openssl:         1.0.2o-vc14_0         conda-forge [vc14] --> 1.0.2o-h8ea7d77_0
    scipy:           0.19.1-py36h7565378_3             --> 1.1.0-py36h672f292_0

The following packages will be DOWNGRADED:

    ca-certificates: 2018.4.16-0           conda-forge --> 2018.03.07-0

Proceed ([y]/n)? y


Downloading and Extracting Packages
certifi-2018.4.16    |  143 KB | ############################################################################## | 100%
scipy-1.1.0          | 13.5 MB | ############################################################################## | 100%
conda-4.5.4          |  1.0 MB | ############################################################################## | 100%
mkl-2018.0.3         | 178.1 MB | ############################################################################# | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

检查已安装的软件包:

(base) C:\Users\yzhang>conda list
# packages in environment at d:\ProgramData\Anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0            py36he6757f0_0
alabaster                 0.7.10           py36hcd07829_0
anaconda                  custom           py36h363777c_0
anaconda-client           1.6.14                   py36_0
anaconda-navigator        1.8.7                    py36_0
anaconda-project          0.8.0            py36h8b3bf89_0
asn1crypto                0.22.0           py36h8e79faa_1
astroid                   1.5.3            py36h9d85297_0
astropy                   2.0.2            py36h06391c4_4
babel                     2.5.0            py36h35444c1_0
backports                 1.0              py36h81696a8_1
backports.shutil_get_terminal_size 1.0.0            py36h79ab834_2
beautifulsoup4            4.6.0            py36hd4cc5e8_1
bitarray                  0.8.1            py36h6af124b_0
bkcharts                  0.2              py36h7e685f7_0
blaze                     0.11.3           py36h8a29ca5_0
bleach                    2.0.0            py36h0a7e3d6_0
bokeh                     0.12.10          py36h0be3b39_0
boto                      2.48.0           py36h1a776d2_1
bottleneck                1.2.1            py36hd119dfa_0
bzip2                     1.0.6                    vc14_1  [vc14]  conda-forge
ca-certificates           2018.03.07                    0
cachecontrol              0.12.3           py36hfe50d7b_0
certifi                   2018.4.16                py36_0
cffi                      1.10.0           py36hae3d1b5_1
chardet                   3.0.4            py36h420ce6e_1
click                     6.7              py36hec8c647_0
cloudpickle               0.4.0            py36h639d8dc_0
clyent                    1.2.2            py36hb10d595_1
colorama                  0.3.9            py36h029ae33_0
comtypes                  1.1.2            py36heb9b3d1_0
conda                     4.5.4                    py36_0
conda-build               3.0.27           py36h309a530_0
conda-env                 2.6.0                h36134e3_1
conda-verify              2.0.0            py36h065de53_0
console_shortcut          0.1.1                h6bb2dd7_3
contextlib2               0.5.5            py36he5d52c0_0
cryptography              2.0.3            py36h123decb_1
curl                      7.55.1                   vc14_0  [vc14]  conda-forge
cycler                    0.10.0           py36h009560c_0
cython                    0.26.1           py36h18049ac_0
cytoolz                   0.8.2            py36h547e66e_0
dask                      0.15.3           py36h396fcb9_0
dask-core                 0.15.3           py36hd651449_0
datashape                 0.5.4            py36h5770b85_0
decorator                 4.1.2            py36he63a57b_0
dill                      0.2.7.1          py36hf552773_0
distlib                   0.2.5            py36h51371be_0
distributed               1.19.1           py36h8504682_0
docutils                  0.14             py36h6012d8f_0
entrypoints               0.2.3            py36hfd66bb0_2
et_xmlfile                1.0.1            py36h3d2d736_0
fastcache                 1.0.2            py36hffdae1b_0
filelock                  2.0.12           py36hd7ddd41_0
findspark                 1.2.0                     <pip>
flask                     0.12.2           py36h98b5e8f_0
flask-cors                3.0.3            py36h8a3855d_0
freetype                  2.8.1                    vc14_0  [vc14]  conda-forge
get_terminal_size         1.0.0                h38e98db_0
gevent                    1.2.2            py36h342a76c_0
glob2                     0.5              py36h11cc1bd_1
greenlet                  0.4.12           py36ha00ad21_0
h5py                      2.7.0            py36hfbe0a52_1
hdf5                      1.10.1                   vc14_2  [vc14]  conda-forge
heapdict                  1.0.0            py36h21fa5f4_0
html5lib                  0.999999999      py36ha09b1f3_0
icc_rt                    2017.0.4             h97af966_0
icu                       58.2                     vc14_0  [vc14]  conda-forge
idna                      2.6              py36h148d497_1
imageio                   2.2.0            py36had6c2d2_0
imagesize                 0.7.1            py36he29f638_0
intel-openmp              2018.0.0             hcd89f80_7
ipykernel                 4.6.1            py36hbb77b34_0
ipython                   6.1.0            py36h236ecc8_1
ipython_genutils          0.2.0            py36h3c5d0ee_0
ipywidgets                7.0.0            py36h2e74ada_0
isort                     4.2.15           py36h6198cc5_0
itsdangerous              0.24             py36hb6c5a24_1
jdcal                     1.3              py36h64a5255_0
jedi                      0.10.2           py36hed927a0_0
jinja2                    2.9.6            py36h10aa3a0_1
joblib                    0.11                     py36_0    conda-forge
jpeg                      9b                       vc14_2  [vc14]  conda-forge
jsonschema                2.6.0            py36h7636477_0
jupyter                   1.0.0            py36h422fd7e_2
jupyter_client            5.2.3                    py36_0
jupyter_console           5.2.0            py36h6d89b47_1
jupyter_core              4.4.0            py36h56e9d50_0
jupyterlab                0.32.1                   py36_0
jupyterlab_launcher       0.10.5                   py36_0
krb5                      1.14.6                   vc14_0  [vc14]  conda-forge
lazy-object-proxy         1.3.1            py36hd1c21d2_0
libiconv                  1.15                     vc14_0  [vc14]  conda-forge
libpng                    1.6.34                   vc14_0  [vc14]  conda-forge
libsodium                 1.0.16                   vc14_0  [vc14]  conda-forge
libssh2                   1.8.0                    vc14_2  [vc14]  conda-forge
libtiff                   4.0.9                    vc14_0  [vc14]  conda-forge
libxml2                   2.9.8                    vc14_0  [vc14]  conda-forge
libxslt                   1.1.32                   vc14_0  [vc14]  conda-forge
llvmlite                  0.20.0                   py36_0
locket                    0.2.0            py36hfed976d_1
lockfile                  0.12.2           py36h0468280_0
lxml                      4.1.0            py36h0dcd83c_0
lzo                       2.10                     vc14_0  [vc14]  conda-forge
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markupsafe                1.0              py36h0e26971_1
matplotlib                2.1.0            py36h11b4b9c_0
mccabe                    0.6.1            py36hb41005a_1
menuinst                  1.4.10           py36h42196fb_0
mistune                   0.7.4            py36h4874169_0
mkl                       2018.0.3                      1
mkl-service               1.1.2            py36h57e144c_4
mpmath                    0.19             py36he326802_2
msgpack-python            0.4.8            py36h58b1e9d_0
msys2-conda-epoch         20160418                      1
multipledispatch          0.4.9            py36he44c36e_0
navigator-updater         0.1.0            py36h8a7b86b_0
nbconvert                 5.3.1            py36h8dc0fde_0
nbformat                  4.4.0            py36h3a5bc1b_0
networkx                  2.0              py36hff991e3_0
nltk                      3.2.4            py36hd0e0a39_0
nose                      1.3.7            py36h1c3779e_2
notebook                  5.5.0                    py36_0
numba                     0.35.0             np113py36_10
numexpr                   2.6.2            py36h7ca04dc_1
numpy                     1.13.3           py36ha320f96_0
numpydoc                  0.7.0            py36ha25429e_0
odo                       0.5.1            py36h7560279_0
olefile                   0.44             py36h0a7bdd2_0
openpyxl                  2.4.8            py36hf3b77f6_1
openssl                   1.0.2o               h8ea7d77_0
packaging                 16.8             py36ha0986f6_1
pandas                    0.20.3           py36hce827b7_2
pandoc                    1.19.2.1             hb2460c7_1
pandocfilters             1.4.2            py36h3ef6317_1
partd                     0.3.8            py36hc8e763b_0
path.py                   10.3.1           py36h3dd8b46_0
pathlib2                  2.3.0            py36h7bfb78b_0
patsy                     0.4.1            py36h42cefec_0
pep8                      1.7.0            py36h0f3d67a_0
pickleshare               0.7.4            py36h9de030f_0
pillow                    4.2.1            py36hdb25ab2_0
pip                       9.0.1            py36hadba87b_3
pip                       10.0.1                    <pip>
pkginfo                   1.4.1            py36hb0f9cfa_1
ply                       3.10             py36h1211beb_0
progress                  1.3              py36hbeca8d3_0
prompt_toolkit            1.0.15           py36h60b8f86_0
psutil                    5.4.0            py36h4e662fb_0
py                        1.4.34           py36ha4aca3a_1
pycodestyle               2.3.1            py36h7cc55cd_0
pycosat                   0.6.3            py36h413d8a4_0
pycparser                 2.18             py36hd053e01_1
pycrypto                  2.6.1            py36he68e6e2_1
pycurl                    7.43.0           py36h086bf4c_3
pyflakes                  1.6.0            py36h0b975d6_0
pygments                  2.2.0            py36hb010967_0
pylint                    1.7.4            py36ha4e6ded_0
pyodbc                    4.0.17           py36h0006bc2_0
pyopenssl                 17.2.0           py36h15ca2fc_0
pyparsing                 2.2.0            py36h785a196_1
pyqt                      5.6.0            py36hb5ed885_5
PyQt5                     5.9.2                     <pip>
pyreadline                2.1              py36h094d952_1
pysocks                   1.6.7            py36h698d350_1
pytables                  3.4.2            py36h71138e3_2
pytest                    3.2.1            py36h753b05e_1
python                    3.6.3                h9e2ca53_1
python-dateutil           2.6.1            py36h509ddcb_1
pytz                      2017.2           py36h05d413f_1
pywavelets                0.5.2            py36hc649158_0
pywin32                   221              py36h9c10281_0
pywinpty                  0.5.4                    py36_0
pyyaml                    3.12             py36h1d1928f_1
pyzmq                     17.0.0           py36hfa6e2cd_1
qt                        5.6.2                    vc14_1  [vc14]  conda-forge
qtawesome                 0.4.4            py36h5aa48f6_0
qtconsole                 4.3.1            py36h99a29a9_0
qtpy                      1.4.2                    py36_0
requests                  2.18.4           py36h4371aae_1
rope                      0.10.5           py36hcaf5641_0
ruamel_yaml               0.11.14          py36h9b16331_2
scikit-image              0.13.0           py36h6dffa3f_1
scikit-learn              0.19.1           py36h53aea1b_0
scikit-surprise           1.0.6                    py36_0    conda-forge
scipy                     1.1.0            py36h672f292_0
seaborn                   0.8.0            py36h62cb67c_0
selenium                  3.7.0                     <pip>
send2trash                1.5.0                    py36_0
setuptools                36.5.0           py36h65f9e6e_0
simplegeneric             0.8.1            py36heab741f_0
singledispatch            3.4.0.3          py36h17d0c80_0
sip                       4.19.8                    <pip>
sip                       4.18.1           py36h9c25514_2
six                       1.11.0           py36h4db2310_1
snowballstemmer           1.2.1            py36h763602f_0
sortedcollections         0.5.3            py36hbefa0ab_0
sortedcontainers          1.5.7            py36ha90ac20_0
sphinx                    1.6.3            py36h9bb690b_0
sphinxcontrib             1.0              py36hbbac3d2_1
sphinxcontrib-websupport  1.0.1            py36hb5e5916_1
spyder                    3.2.8                    py36_0
sqlalchemy                1.1.13           py36h5948d12_0
sqlite                    3.22.0                   vc14_0  [vc14]  conda-forge
statsmodels               0.8.0            py36h6189b4c_0
sympy                     1.1.1            py36h96708e0_0
tblib                     1.3.2            py36h30f5020_0
terminado                 0.8.1                    py36_1
testpath                  0.3.1            py36h2698cfe_0
tk                        8.6.7                    vc14_0  [vc14]  conda-forge
toolz                     0.8.2            py36he152a52_0
tornado                   4.5.2            py36h57f6048_0
traitlets                 4.3.2            py36h096827d_0
typing                    3.6.2            py36hb035bda_0
unicodecsv                0.14.1           py36h6450c06_0
urllib3                   1.22             py36h276f60a_0
vc                        14                   h2379b0c_2
vs2015_runtime            14.0.25123           hd4c4e62_2
wcwidth                   0.1.7            py36h3d5aa90_0
webencodings              0.5.1            py36h67c50ae_1
werkzeug                  0.12.2           py36h866a736_0
wheel                     0.29.0           py36h6ce6cde_1
widgetsnbextension        3.0.2            py36h364476f_1
win_inet_pton             1.0.1            py36he67d7fd_1
win_unicode_console       0.5              py36hcdbd4b5_0
wincertstore              0.2              py36h7fe50ca_0
winpty                    0.4.3                         4
wrapt                     1.10.11          py36he5f5981_0
xlrd                      1.1.0            py36h1cb58dc_1
xlsxwriter                1.0.2            py36hf723b7d_0
xlwings                   0.11.4           py36hd3cf94d_0
xlwt                      1.3.0            py36h1a4751e_0
yaml                      0.1.7                    vc14_0  [vc14]  conda-forge
zeromq                    4.2.5                    vc14_1  [vc14]  conda-forge
zict                      0.1.3            py36h2d8e73e_0
zlib                      1.2.11                   vc14_0  [vc14]  conda-forge

  1. scipy
    版本现在是1.1.0:

    导入 scipy scipy.版本 输出[23]:'1.1.0'


  1. 但仍然出现错误:

    进口惊喜 回溯(最近一次调用最后一次):

    文件“”,第 1 行,位于 进口惊喜

    文件“d:\ProgramData\Anaconda3\lib\site-packages\surprise__init__.py”,第 35 行,位于 version = get_distribution('scikit-surprise').version

    文件“d:\ProgramData\Anaconda3\lib\site-packages\pkg_resources__init__.py”,第 562 行,在 get_distribution 中 距离 = get_provider(距离)

    文件“d:\ProgramData\Anaconda3\lib\site-packages\pkg_resources__init__.py”,第 436 行,在 get_provider 中 返回工作集.find(moduleOrReq) 或 require(str(moduleOrReq))[0]

    文件“d:\ProgramData\Anaconda3\lib\site-packages\pkg_resources__init__.py”,第 981 行,在 require 中 需要= self.resolve(parse_requirements(需求))

    文件“d:\ProgramData\Anaconda3\lib\site-packages\pkg_resources__init__.py”,第 872 行,在解析中 引发版本冲突(dist,req).with_context(dependent_req)

    上下文版本冲突:(scipy 0.19.1 (d:\programdata naconda3\lib\site-packages),Requirement.parse('scipy>=1.0.0'),{'scikit-surprise'})

python scipy version
1个回答
0
投票

您尝试过在 colab 上升级 ipython 吗?

!pip install {your_package}
!pip install --upgrade ipython

重新启动运行时/会话以使更改得到反映。

© www.soinside.com 2019 - 2024. All rights reserved.