Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

依赖版本不要写死 #1

Closed
luozhouyang opened this issue Jul 16, 2020 · 2 comments
Closed

依赖版本不要写死 #1

luozhouyang opened this issue Jul 16, 2020 · 2 comments

Comments

@luozhouyang
Copy link

requirements里面声明的依赖不要写死。目前在一个地方使用了本库,但是因为本库的依赖写死,报警:依赖版本不兼容。

解决方法就是把requirements里面的依赖版本去掉。

@jtyoui
Copy link
Member

jtyoui commented Jul 17, 2020

requirements里面声明的依赖不要写死。目前在一个地方使用了本库,但是因为本库的依赖写死,报警:依赖版本不兼容。

解决方法就是把requirements里面的依赖版本去掉。

不写依赖版本是不行的,因为我需要它的组件。如果不写他的组件版本,万一他的组件修改了该功能或者去掉的该功能,那我的组件也随之失效。如果你遇到安装依赖冲突,请试做跳过安装冲突的依赖,安装办法是 pip install xx --no-dependencies 。忽略安装的依赖的版本限制。不建议这样使用,最好用 virtualenv 环境来单独创建一个项目。

@luozhouyang
Copy link
Author

这些知名的库基本上是保证向前兼容的,而且你用到的API都是非常常见的API,基本上不会出现这个问题。我是使用conda创建的虚拟环境,但是有些其他库也依赖的库报警告。

@jtyoui jtyoui closed this as completed Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants