当安装旧版本的包时,我是否可以只安装与之兼容的依赖包版本?

huangapple go评论118阅读模式
英文:

When installing an old version of a package, can I install only compatible versions of dependent packages?

问题

  1. 我在一个虚拟环境中使用Python 3.7.4
  2. 我运行了 `pip install teradataml==17.0.0.3`,它安装了一堆依赖包,包括 `sqlalchemy`
  3. 那时,它安装了 `SQLAlchemy==2.0.2`
  4. 我运行了下面的代码,并收到了这个错误:
  5. `ArgumentError: Additional keyword arguments are not accepted by this function/method. The presence of **kw is for pep-484 typing purposes`
  6. ```python:
  7. from teradataml import create_context
  8. class ConnectToTeradata:
  9. def __init__(self):
  10. host = 'AWESOME_HOST'
  11. username = 'johnnyMnemonic'
  12. password = 'keanu4life'
  13. self.connection = create_context(host=host, user=username, password=password)
  14. def __del__(self):
  15. print("Closing connection")
  16. self.connection.dispose()
  17. ConnectToTeradata()

如果我在安装 teradataml 之前安装 SQLAlchemy==1.4.26,我就不再收到错误,并且成功连接。
这表明 SQLAlchemy==2.0.2teradataml==17.0.0.3 不兼容。

我期望安装一个较旧版本的 teradataml 也会安装与之兼容的较旧版本的依赖包。
当我安装 teradataml==17.0.0.3 时,我可以强制只安装与之兼容的依赖包吗?

  1. <details>
  2. <summary>英文:</summary>
  3. I&#39;m using Python 3.7.4 in a venv environment.
  4. I ran `pip install teradataml==17.0.0.3` which installs a bunch of dependent packages, including `sqlalchemy`.
  5. At the time, it installed `SQLAlchemy==2.0.2`.
  6. I ran the below code, and received this error:
  7. `ArgumentError: Additional keyword arguments are not accepted by this function/method. The presence of **kw is for pep-484 typing purposes`
  8. ```python:
  9. from teradataml import create_context
  10. class ConnectToTeradata:
  11. def __init__(self):
  12. host = &#39;AWESOME_HOST&#39;
  13. username = &#39;johnnyMnemonic&#39;
  14. password = &#39;keanu4life&#39;
  15. self.connection = create_context(host = host, user = username, password = password)
  16. def __del__(self):
  17. print(&quot;Closing connection&quot;)
  18. self.connection.dispose()
  19. ConnectToTeradata()

If I install SQLAlchemy==1.4.26 before teradataml, I no longer get the error and successfuly connect.<br/>
This suggests SQLAlchemy==2.0.2 is not compatible with teradataml==17.0.0.3.

I expected installing an older version of teradataml would also install older, compatible versions of dependent packages.<br>
When I install teradataml==17.0.0.3, can I force only install compatible versions of dependent packages?

答案1

得分: 1

我们已经注意到在SQLAlchemy 2.0.x版本中引入的兼容性问题。新的2.0.x版本直接影响了teradatasqlalchemy包中的Teradata SQL方言。作为临时措施,请将SQLAlchemy降级到1.4.46版本。

Teradata工程部门正在努力使teradatasqlalchemy包与更新版本兼容,并计划在2023年3月发布一个新的包。

英文:

We are aware of the compatibility issues that were introduced in SQLAlchemy package 2.0.x versions. The new 2.0.x package directly affects the Teradata SQL dialect in the teradatasqlalchemy package. As a temporary measure, please downgrade SQLAlchemy to 1.4.46.

Teradata Engineering is working on making the teradatasqlalchemy package compatible with the newer versions and a new package is slated to be released in March 2023.

huangapple
  • 本文由 发表于 2023年2月16日 14:14:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/75468479.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定