gpt4 book ai didi

python-3.x - 无法在 Windows 7 上安装 ibm_db

转载 作者:行者123 更新时间:2023-12-01 15:37:51 25 4
gpt4 key购买 nike

我在安装 ibm_db 时遇到问题。我收到“当该文件已存在时无法创建文件:'tests' -> 'test_2'”

我使用的是 Windows 7 x64,Python 3.6。目的是使用 SQLAlchemy 连接到 db2 数据库。我已经安装了 ibm-db-sa 数据库。

任何关于如何解决这个问题的想法都会很棒。

(.env) C:\Users\123456789\Documents\the_funny_app>pip install ibm_db
Collecting ibm_db
Downloading ibm_db-2.0.8.tar.gz (689kB)
100% |████████████████████████████████| 696kB 17.1MB/s
Building wheels for collected packages: ibm-db
Running setup.py bdist_wheel for ibm-db ... error
Complete output from command c:\users\123456789\documents\the_funny_app\.env\scripts\py
thon.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\139206~1\\AppDa
ta\\Local\\Temp\\pip-build-xss0on0u\\ibm-db\\setup.py';f=getattr(tokenize, 'open
', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(co
de, __file__, 'exec'))" bdist_wheel -d C:\Users\139206~1\AppData\Local\Temp\tmpc
gu3awilpip-wheel- --python-tag cp36:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\139206~1\AppData\Local\Temp\pip-build-xss0on0u\ibm-db\setup.p
y", line 17, in <module>
os.rename('tests','test_2')
FileExistsError: [WinError 183] Cannot create a file when that file already ex
ists: 'tests' -> 'test_2'

----------------------------------------
Failed building wheel for ibm-db
Running setup.py clean for ibm-db
Complete output from command c:\users\123456789\documents\the_funny_app\.env\scripts\py
thon.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\139206~1\\AppDa
ta\\Local\\Temp\\pip-build-xss0on0u\\ibm-db\\setup.py';f=getattr(tokenize, 'open
', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(co
de, __file__, 'exec'))" clean --all:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\139206~1\AppData\Local\Temp\pip-build-xss0on0u\ibm-db\setup.p
y", line 17, in <module>
os.rename('tests','test_2')
FileExistsError: [WinError 183] Cannot create a file when that file already ex
ists: 'tests' -> 'test_2'

----------------------------------------
Failed cleaning build dir for ibm-db
Failed to build ibm-db
Installing collected packages: ibm-db
Running setup.py install for ibm-db ... error
Complete output from command c:\users\123456789\documents\the_funny_app\.env\scripts\
python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\139206~1\\App
Data\\Local\\Temp\\pip-build-xss0on0u\\ibm-db\\setup.py';f=getattr(tokenize, 'op
en', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(
code, __file__, 'exec'))" install --record C:\Users\139206~1\AppData\Local\Temp\
pip-g1oa_y2_-record\install-record.txt --single-version-externally-managed --com
pile --install-headers c:\users\123456789\documents\the_funny_app\.env\include\site\pytho
n3.6\ibm-db:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\139206~1\AppData\Local\Temp\pip-build-xss0on0u\ibm-db\setup
.py", line 17, in <module>
os.rename('tests','test_2')
FileExistsError: [WinError 183] Cannot create a file when that file already
exists: 'tests' -> 'test_2'

----------------------------------------
Command "c:\users\123456789\documents\the_funny_app\.env\scripts\python.exe -u -c "import
setuptools, tokenize;__file__='C:\\Users\\139206~1\\AppData\\Local\\Temp\\pip-b
uild-xss0on0u\\ibm-db\\setup.py';f=getattr(tokenize, 'open', open)(__file__);cod
e=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))
" install --record C:\Users\139206~1\AppData\Local\Temp\pip-g1oa_y2_-record\inst
all-record.txt --single-version-externally-managed --compile --install-headers c
:\users\123456789\documents\the_funny_app\.env\include\site\python3.6\ibm-db" failed with
error code 1 in C:\Users\139206~1\AppData\Local\Temp\pip-build-xss0on0u\ibm-db\

最佳答案

将评论转化为答案。

这是 Win7 上 ibm_db v2.0.8 的一个已知问题,由于已修复,您可以安装修复版本或以前的版本。此外,任何高于 v2.0.8 的 ibm_db 版本都将包含此修复。

2020 年 6 月 20 日:ibm_db v3.0.2 发布。

参见 github report

安装固定版本:

pip install "ibm-db==2.0.8a" (任何高于 2.0.8 的版本)

要安装以前的版本:

pip install "ibm-db<2.0.8"

关于python-3.x - 无法在 Windows 7 上安装 ibm_db,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48153101/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com