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

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

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

问题

我在一个虚拟环境中使用Python 3.7.4。
我运行了 `pip install teradataml==17.0.0.3`,它安装了一堆依赖包,包括 `sqlalchemy`。
那时,它安装了 `SQLAlchemy==2.0.2`。

我运行了下面的代码,并收到了这个错误:
`ArgumentError: Additional keyword arguments are not accepted by this function/method.  The presence of **kw is for pep-484 typing purposes`

```python:
from teradataml import create_context 

class ConnectToTeradata:
    def __init__(self):
        
        host = 'AWESOME_HOST'
        username = 'johnnyMnemonic'
        password = 'keanu4life'

        self.connection = create_context(host=host, user=username, password=password)

    def __del__(self):
        print("Closing connection")
        self.connection.dispose()

ConnectToTeradata()

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

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


<details>
<summary>英文:</summary>

I&#39;m using Python 3.7.4 in a venv environment.
I ran `pip install teradataml==17.0.0.3` which installs a bunch of dependent packages, including `sqlalchemy`.
At the time, it installed `SQLAlchemy==2.0.2`.

I ran the below code, and received this error:
`ArgumentError: Additional keyword arguments are not accepted by this function/method.  The presence of **kw is for pep-484 typing purposes`

```python:
from teradataml import create_context 

class ConnectToTeradata:
    def __init__(self):
        
        host = &#39;AWESOME_HOST&#39;
        username = &#39;johnnyMnemonic&#39;
        password = &#39;keanu4life&#39;

        self.connection = create_context(host = host, user = username, password = password)

    def __del__(self):
        print(&quot;Closing connection&quot;)
        self.connection.dispose()

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:

确定