每当我在 Python 中安装 pip 库时,我都会收到一系列警告。例如 :
Run Code Online (Sandbox Code Playgroud)WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages) WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages) WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages) WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages) WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages) WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
我怎样才能避免收到这些警告?
psycopg2有人安装成功后导入时出现这个错误吗?
ImportError: dlopen(/Users/chrishicks/Desktop/test/venv/lib/python3.9/site-packages/psycopg2/_psycopg.cpython-39-darwin.so, 0x0002):
tried: '/Users/chrishicks/Desktop/test/venv/lib/python3.9/site-packages/psycopg2/_psycopg.cpython-39-darwin.so'
(mach-o file, but is an incompatible architecture
(have 'x86_64', need 'arm64e')),
'/usr/local/lib/_psycopg.cpython-39-darwin.so' (no such file),
'/usr/lib/_psycopg.cpython-39-darwin.so' (no such file)
Run Code Online (Sandbox Code Playgroud)
我已经尝试安装psycopg2并在 Rosetta 中psycopg2-binary运行时尝试了这两种方法。iTerm
(M1 MBA 2020,MacOS 12.3.1)因此,在 Vs Code 内部,当我Python 3.8.9从我的解释器中选择解释器时usr/local/bin Tkinter,它会按照我想要的方式运行。
这是运行代码供参考。
当我尝试使用全局Python 3.8.9解释器(usr/bin/python3)时出现问题。当代码运行时,应用程序最终看起来像这样。
此外,当我运行代码时,终端会读取以下内容:
DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
Run Code Online (Sandbox Code Playgroud)
我怎样才能修复这个错误?或者更新我的全局 Tkinter 版本而不偏离Python 3.8.9. 此外,如果需要更多信息,我很乐意提供,抱歉我对这些东西不熟悉
应用程序中使用的软件包:tkinter、Pillow、tkmacosx
最后一件事,当我删除所有提及的软件包 Tkmacosx 时,该应用程序显示如下:
我正在尝试在 okex 交易所版本 5 上使用 ccxt 创建永久限价订单。该 API 成功在现货交易所下订单(限价订单和市价订单),但在永续交易所上失败。这就是我正在尝试的-
exchange_swap = ccxt.okex5({
'apiKey': credentials['okex']['apikey'],
'secret': credentials['okex']['secretkey'],
'password': credentials['okex']['password'],
'options': {
'defaultType': 'swap',
}
})
params = {
"test":True
}
order = exchange_swap.createLimitBuyOrder('XRP-USDT-SWAP',100,0.7)
Run Code Online (Sandbox Code Playgroud)
错误信息-
ccxt.base.errors.BadRequest: okex5 {"code":"1","data":[{"clOrdId":"","ordId":"","sCode":"51000","sMsg":"Parameter posSide error ","tag":""}],"msg":""}
Run Code Online (Sandbox Code Playgroud)
在搜索此错误后,我在他们的文档中发现了这一点-
Error message Http status code Error code
Parameter {0} error. 400 51000
Run Code Online (Sandbox Code Playgroud)
文档链接 - Okex v5
PS - 我可以通过 okex 上的交易仪表板放置此内容,但不能通过 API 放置。我有足够的余额来创建此订单。
整个错误消息是这样的——
Traceback (most recent call last):
File "C:\Users\ishaa\Desktop\trading\Crypto Vibhor\Testing Files\ccxt_test.py", line 70, in
<module>
order = exchange_swap.createLimitBuyOrder('XRP-USDT-SWAP',100,0.7) …Run Code Online (Sandbox Code Playgroud) 有人遇到这样的错误吗?我该如何修复它们?
2021-11-07 08:29:38,643 - telegram.ext.updater - ERROR - Error while getting Updates: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2021-11-07 08:29:38,644 - telegram.ext.dispatcher - ERROR - No error handlers are registered, logging exception.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/telegram/ext/updater.py", line 646, in _network_loop_retry
if not action_cb():
File "/usr/local/lib/python3.8/dist-packages/telegram/ext/updater.py", line 597, in polling_action_cb
updates = self.bot.get_updates(
File "/usr/local/lib/python3.8/dist-packages/telegram/ext/extbot.py", line 222, in get_updates
updates = super().get_updates(
File "/usr/local/lib/python3.8/dist-packages/telegram/bot.py", line 130, in decorator
result …Run Code Online (Sandbox Code Playgroud) 对于这个给定的列表:
a = [1, 0, 0, 1, 1, 1, 3, 0,
1, 1, 4, 2, 1, 1, 2, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 5]
Run Code Online (Sandbox Code Playgroud)
我想将列表拆分为零和非零值的子列表,以获得所需的输出
a = [[1], [0,0], [1,1,1,3], [0],
[1,1,3,2,1,1,2,1,1,1,1,],
[0], [1], [0], [1,1,1], [0,0,0], [1,5]]
Run Code Online (Sandbox Code Playgroud)
我知道如何将列表拆分为一定长度的子列表,但我认为我不能在这里使用该方法......