简体   繁体   中英

IPython 'Error in generated code:', file=sys.stderr

I have an error trying to import IPython, the error seems to point to the decorator.py and outputs this error:

from decorator import decorator
  File "C:\Users\ASUS\miniconda3\envs\test\lib\site-packages\decorator.py", line 162
    print('Error in generated code:', file=sys.stderr)

i am running python 2.7 with IPython 5.8 and decorator 5.1 from a conda environment with this dependencies:

# Name                    Version                   Build  Channel
backcall                  0.2.0              pyhd3eb1b0_0
backports                 1.1                pyhd3eb1b0_0
backports.shutil_get_terminal_size 1.0.0              pyhd3eb1b0_3
blas                      1.0                         mkl
ca-certificates           2021.10.26           haa95532_2
certifi                   2020.6.20          pyhd3eb1b0_3
colorama                  0.4.4              pyhd3eb1b0_0
decorator                 5.1.0              pyhd3eb1b0_0
enum34                    1.1.6                    py27_1
icc_rt                    2019.0.0             h0cc432a_1
intel-openmp              2021.4.0          haa95532_3556
ipython                   5.8.0                    py27_0
ipython_genutils          0.2.0              pyhd3eb1b0_1
markdown                  3.1.1                    py27_0
mkl                       2020.2                      256
mkl-service               2.3.0            py27h0b88c2a_0
mkl_fft                   1.0.15           py27h44c1dab_0
numpy                     1.16.6           py27hcd21bde_0
numpy-base                1.16.6           py27hb1d0314_0
parso                     0.8.0                      py_0
pathlib2                  2.3.5                    py27_0
pickleshare               0.7.5                    py27_0
pip                       20.3.4                   pypi_0    pypi
prompt_toolkit            1.0.15           py27h3a8ec6a_0
pygments                  2.5.2                      py_0
python                    2.7.18               hfb89ab9_0
rpsp                      0.1                      pypi_0    pypi
scandir                   1.10.0             pyh5d7bf9c_3
scikit-learn              0.20.4                   pypi_0    pypi
scipy                     1.2.3                    pypi_0    pypi
setuptools                44.1.1                   pypi_0    pypi
simplegeneric             0.8.1                    py27_2
six                       1.16.0             pyhd3eb1b0_0
sklearn                   0.0                      pypi_0    pypi
sqlite                    3.30.1               h0c8e037_0
traitlets                 4.3.3                    py27_0
vc                        9                    h2eaa2aa_6
vs2008_runtime            9.00.30729.1         haa95532_6
vs2015_runtime            14.27.29016          h5e58377_2
wcwidth                   0.2.5              pyhd3eb1b0_0
wheel                     0.37.1             pyhd3eb1b0_0
win_unicode_console       0.5              py27hc037021_0
wincertstore              0.2              py27hf04cefb_0

The decorator staring with V5.xx, Requires: Python >=3.5

you can downgrade decorator to 4.xx

conda install decorator=4.4.1

Please update decorator to the version 5.1.1 : seems like there was a bug in 5.1.0 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM