secretflow: Incompatibility Between TensorFlow and Jupyter Notebook
Issue Type
Bug
Source
binary
Secretflow Version
1.6.1b0
OS Platform and Distribution
Linux Ubuntu 20.04
Python version
3.10.14
Bazel version
No response
GCC/Compiler version
No response
What happend and What you expected to happen.
当我使用新版的secretflow时,安装了jupyter notebook来运行,似乎遇到了一些问题。
cannot import name 'TypeAliasType' from 'typing_extensions' (/usr/local/lib/python3.10/site-packages/typing_extensions.py)
- 尝试查看该问题的解决,https://stackoverflow.com/questions/69876370/why-arent-transformers-imported-in-python#comment126233975_69876417
- 根据建议对该包进行了升级。但是,升级后又和tensorflow冲突。
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow 2.12.1 requires typing-extensions<4.6.0,>=3.6.6, but you have typing-extensions 4.12.0 which is incompatible.
麻烦官方童鞋看一下兼容性,不胜感激🥹
Reproduction code to reproduce the issue.
single line import secretflow in Jupyter notebook ipynb
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (6 by maintainers)
@kylin5207
重新尝试了一下,可以复现这个问题;具体而言,当
pip install仅指定 secretflow 和 notebook 时,pip 将会解析到以下依赖tensorflow==2.12.1typing-extensions==4.5.0此时安装会成功,但由于 typing-extensions 版本过旧,在 Notebook 上首次运行任何代码时,ipykernel 会失败
潜在的解决方式是同时指定 secretflow 和 typing-extensions 的版本到最新版:
会解析到
tensorflow==2.12.0,仍然在兼容范围内;结果如下:可以使用这个命令在全新的 Python 3.10 虚拟环境中尝试
secretflow 完整版的依赖相对复杂,没有办法完全确保所有用法的兼容性(特别是当上游依赖本身没有保证兼容性时);另一个建议是,如果有可能的话,直接使用已经打包好的镜像,或者基于这个镜像制作其他镜像,见文档:https://www.secretflow.org.cn/zh-CN/docs/secretflow/v1.6.1b0/getting_started/installation#option-2-from-docker
如果有额外的问题,请开启新的 issue
@kylin5207
requirements-linux-arm64.txt