【收集】Python报错解决办法

2019-06-23  本文已影响0人  惑也

1、删除虚拟环境时

RemoveError: 'requests' is a dependency of conda and cannot be removed from conda's operating environment.
conda update conda

2、调用某些包时

TypeError: __init__() got an unexpected keyword argument 'encoding'

3、安装包时

 error: command 'gcc' failed with exit status 1
CFLAGS=-stdlib=libc++ pip install package_name
  1. 安装包PyYAML时
Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
pip install docker-py --ignore-installed PyYAML
  1. 安装jupyter-plotly-dash后Jupyter报404错误
conda install -c conda-forge jupyter-server-proxy
jupyter serverextension enable jupyter_server_proxy  # jupyter-server-proxy服务器扩展在安装时没有自动启用,这是一个依赖项jupyterlab-dash
  1. 在使用pandas_datareader时报错
from pandas.compat import StringIO, bytes_to_str
ImportError: cannot import name 'StringIO' from 'pandas.compat'
  1. 使用plotly在不同的轴上绘制多个不同的Plotly饼图
ValueError: Invalid property specified for object of type plotly.graph_objs.Pie: 'xaxis'

8.使用Django过程中

TypeError: 'module' object is not iterable
  1. flask的服务起不来
usage: manage.py [-?] {db,create_back_user,shell,runserver} ...
  1. flask做数据迁移
ERROR [root] Error: Target database is not up to date.
python manage.py db stamp head  必须要先执行这一步
python manage.py db migrate
python manage.py db upgrade
上一篇下一篇

猜你喜欢

热点阅读