Anaconda3 pip安装报错:TypeError: parse() got an unexpected keyword argument 'transport_encoding'

本文介绍在Win10系统下使用Anaconda3时,通过pip安装软件包出现TypeError错误的情况及解决方案。该错误涉及'transport_encoding'参数,并提供了一个具体的解决步骤:使用conda安装html5lib。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用win10系统下anaconda3,刚配置好后使用pip安装均失败,提示错误“TypeError: parse() got an unexpected keyword argument 'transport_encoding'”


解决办法:

conda install -c anaconda html5lib


File "D:\Anaconda\Lib\site-packages\streamlit\runtime\metrics_util.py", line 408, in wrapped_func result = non_optional_func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: ImageMixin.image() got an unexpected keyword argument &#39;use_container_width&#39; 2025-07-01 22:58:07.576 Uncaught app exception Traceback (most recent call last): File "D:\Anaconda\Lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 85, in exec_func_with_error_handling result = func() ^^^^^^ File "D:\Anaconda\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 576, in code_to_exec exec(code, module.__dict__) File "D:\2035946879\111.py", line 267, in <module> st.image("https://images.unsplash.com/photo-1551836022-d5d88e9218df?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1200&q=80", File "D:\Anaconda\Lib\site-packages\streamlit\runtime\metrics_util.py", line 408, in wrapped_func result = non_optional_func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: ImageMixin.image() got an unexpected keyword argument &#39;use_container_width&#39; 2025-07-01 22:59:19.331 `label` got an empty value. This is discouraged for accessibility reasons and may be disallowed in the future by raising an exception. Please provide a non-empty label and hide it with label_visibility if needed. 2025-07-01 22:59:28.121 `label` got an empty value. This is discouraged for accessibility reasons and may be disallowed in the future by raising an exception. Please provide a non-empty label and hide it with label_visibility if needed. 2025-07-01 23:00:56.209 `label` got an empty value. This is discouraged for accessibility reasons and may be disallowed in the future by raising an exception. Please provide a non-empty label and hide it with label_visibility if needed. 系统找不到指定的路径。 2025-07-01 23:15:01.133 `label` got an empty value. This is discouraged for accessibility reasons and may be disallowed in the future by raising an exception. Please provide a non-empty label and hide it with label_visibility if needed. 2025-07-01 23:17:03.758 Uncaught app exception Traceback (most recent call last): File "D:\Anaconda\Lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 85, in exec_func_with_error_handling result = func() ^^^^^^ File "D:\Anaconda\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 576, in code_to_exec exec(code, module.__dict__) File "D:\2035946879\111.py", line 267, in <module> st.image("https://images.unsplash.com/photo-1551836022-d5d88e9218df?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1200&q=80", File "D:\Anaconda\Lib\site-packages\streamlit\runtime\metrics_util.py", line 408, in wrapped_func result = non_optional_func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: ImageMixin.image() got an unexpected keyword argument &#39;use_container_width&#39; 2025-07-01 23:26:38.702 `label` got an empty value. This is discouraged for accessibility reasons and may be disallowed in the future by raising an exception. Please provide a non-empty label and hide it with label_visibility if needed. 2025-07-01 23:26:48.702 `label` got an empty value. This is discouraged for accessibility reasons and may be disallowed in the future by raising an exception. Please provide a non-empty label and hide it with label_visibility if needed.
07-02
### TypeError: clone_overlap() got an unexpected keyword argument &#39;colorby&#39; 的解决方案 当遇到 `TypeError` 提示函数接收到意外的关键字参数时,通常是因为调用的函数不支持该关键字参数。以下是可能的原因以及对应的解决办法: #### 1. 函数定义未包含指定的关键字参数 如果 `clone_overlap()` 函数并未在其定义中接受名为 `&#39;colorby&#39;` 的关键字参数,则会引发此错误。可以通过查看函数源码确认其签名。 ```python def clone_overlap(...): # 检查此处是否有 &#39;colorby&#39; pass ``` 若确实不存在 `&#39;colorby&#39;` 参数,需移除对该参数的传递或将其实现加入到自定义版本的函数中[^1]。 --- #### 2. 使用了不同版本的库或模块 某些情况下,特定功能仅存在于较新版本的库中。如果当前使用的库版本较低,可能会导致此类问题。建议升级相关依赖项并重新测试代码。 以 Python 包管理工具为例,可执行以下命令更新库至最新版: ```bash pip install --upgrade <library_name> ``` 或者针对 Conda 环境中的包: ```bash conda update <package_name> ``` 注意,在 Anaconda 中切换 Python 版本也可能影响兼容性。例如,尝试将环境配置为 Python 2.7 或更高版本来验证是否存在差异[^2]。 --- #### 3. 调用方式不符合预期 有时开发者误解 API 文档而导致传入非法选项。务必仔细阅读官方文档了解合法输入形式。假设目标方法来自第三方插件,则应参照对应章节说明调整实现逻辑。 例如,假如原计划通过颜色分类数据集样本点分布情况可视化图表,但实际接口并不提供直接控制渲染样式的途径;此时需要寻找替代机制完成相同任务。 --- #### 示例修正后的代码片段 下面展示了一种潜在修改策略——删除争议性的键值对后再提交请求给服务端处理。 ```python kwargs = {&#39;other_param&#39;: True} # 初始化有效参数集合 if supports_color_by(): # 动态判断特性可用状态 kwargs[&#39;colorby&#39;] = &#39;value&#39; result = clone_overlap(**kwargs) # 安全地应用扩展属性 ``` 以上操作能够减少因硬编码带来的风险同时增强程序灵活性。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值