最近我在诗歌方面遇到了一百万零一个问题。
我昨天已经完全安装并工作了,但是重新启动我的机器后,我又遇到了问题;(
即使在重新启动后,是否有办法在我的终端中始终识别诗歌?
系统规格:
终端:
me@PF2DCSXD:/mnt/c/Users/me/Documents/GitHub/workers-python/workers/data_simulator/src$ poetry run python3 cli.py
poetry: command not found
me@PF2DCSXD:/mnt/c/Users/me/Documents/GitHub/workers-python/workers/data_simulator/src$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
Retrieving Poetry metadata
This installer is deprecated. Poetry versions installed using this script will not be able to use 'self update' command to upgrade to 1.2.0a1 or later.
Latest version already installed.
me@PF2DCSXD:/mnt/c/Users/me/Documents/GitHub/workers-python/workers/data_simulator/src$ poetry run python3 cli.py
poetry: command not found
me@PF2DCSXD:/mnt/c/Users/me/Documents/GitHub/workers-python/workers/data_simulator/src$
Run Code Online (Sandbox Code Playgroud)
如果我可以在帖子中添加其他内容以帮助进一步澄清,请告诉我。
我想从poetry.lock
文件安装包;使用poetry install
。
然而,大多数包都会抛出完全相同的错误,这表明存在共同的基本问题。
\n是什么原因造成的?标准修复是什么?
\n规格:
\n终端:
\nrm poetry.lock
poetry update
poetry install
me@PF2DCSXD:/mnt/c/Users/user/Documents/GitHub/workers-python/workers/composite_key$ poetry update\nUpdating dependencies\nResolving dependencies... (217.2s)\n\nWriting lock file\n\nPackage operations: 55 installs, 8 updates, 0 removals\n\n \xe2\x80\xa2 Updating pyparsing (3.0.4 -> 2.4.7)\n \xe2\x80\xa2 Updating pyyaml (5.4.1 -> 6.0)\n \xe2\x80\xa2 Installing arrow (1.2.1)\n \xe2\x80\xa2 Installing chardet (4.0.0)\n \xe2\x80\xa2 …
Run Code Online (Sandbox Code Playgroud) 如何升级到最新版本?
\n规格:
\n当前版本:
\nme@PF2DCSXD:/mnt/c/Users/user/Documents/GitHub/workers-python/workers/composite_key/compositekey/tests$ python3 --version\nPython 3.8.10\n
Run Code Online (Sandbox Code Playgroud)\n尝试更新 | poetry self update
:
me@PF2DCSXD:/mnt/c/Users/user/Documents/GitHub/workers-python/workers/composite_key/compositekey/tests$ poetry self update\n\n RuntimeError\n\n Poetry was not installed with the recommended installer. Cannot update automatically.\n\n at ~/.local/lib/python3.8/site-packages/poetry/console/commands/self/update.py:389 in _check_recommended_installation\n 385\xe2\x94\x82 current = Path(__file__)\n 386\xe2\x94\x82 try:\n 387\xe2\x94\x82 current.relative_to(self.home)\n 388\xe2\x94\x82 except ValueError:\n \xe2\x86\x92 389\xe2\x94\x82 raise RuntimeError(\n 390\xe2\x94\x82 "Poetry was not installed with the recommended installer. "\n 391\xe2\x94\x82 "Cannot update automatically."\n …
Run Code Online (Sandbox Code Playgroud) 我想无序地打乱列;完全伪随机,一行代码。
前:
A B
0 1 2
1 1 2
Run Code Online (Sandbox Code Playgroud)
后:
B A
0 2 1
1 2 1
Run Code Online (Sandbox Code Playgroud)
到目前为止我的尝试:
df = df.reindex(columns=columns)
df.sample(frac=1, axis=1)
df.apply(np.random.shuffle, axis=1)
Run Code Online (Sandbox Code Playgroud) 更新:
是否可以添加或更改在 Azure DevOps 上执行管道的命令?
在Visual Studio Code上本地运行我的程序,我确实得到了输出。
但是,在Azure DevOps上运行我的GitHub原始分支不会产生任何输出。
我遵循了 Stack Overflow 的答案,该答案引用了GitHub 问题的解决方案。
我已经实现了以下内容,但 Azure 的原始日志在我的 Python 上返回空白logging
。
test_logging.py
:
import logging
filename = "my.log"
global logger
logger = logging.getLogger()
logger.setLevel(logging.INFO)
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
open(filename, "w").close() # empty logs
fileHandler = logging.FileHandler(filename)
fileHandler.setFormatter(formatter)
fileHandler.setLevel(logging.INFO)
logger.addHandler(fileHandler)
logger.error('TEST')
# fetch logs
with open(filename, "r") as fileHandler:
logs = [log.rstrip() for log in …
Run Code Online (Sandbox Code Playgroud) 我在与 file 相同的工作目录中执行以下命令worker.py
:
poetry run worker.py\n
Run Code Online (Sandbox Code Playgroud)\n终端:
\npoetry run worker.py\n
Run Code Online (Sandbox Code Playgroud)\n显然,我们看到该文件就在那里(右下角)。
\n问题
\n如果我还需要在帖子中添加其他内容,请告诉我
\npython ×5
bash ×2
azure ×1
azure-devops ×1
dataframe ×1
logging ×1
numpy ×1
pandas ×1
python-3.x ×1
windows ×1