我有一个运行良好的反应项目。node
(v14.17.0) 和npm
(7.19.1) 随 一起安装nvm
。
使用 npm 安装软件包很好,例如对于 ssh2,但安装它时,它不会安装可选软件包cpu-features
https://github.com/mscdex/cpu-features
运行时npm install cpu-features
出现错误npm ERR! /bin/sh: 1: cmake: Permission denied
整个错误消息:
npm ERR! code 1
npm ERR! path /mnt/c/Users/ilkka/Projects/draganddrop/node_modules/cpu-features
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/mnt/c/Users/ilkka/Projects/draganddrop/node_modules/cpu-features/build'
npm ERR! ACTION Configuring dependencies /mnt/c/Users/ilkka/Projects/draganddrop/node_modules/cpu-features/deps/cpu_features/build/Makefile
npm ERR! make: Leaving directory '/mnt/c/Users/ilkka/Projects/draganddrop/node_modules/cpu-features/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp …
Run Code Online (Sandbox Code Playgroud) 我正在使用node -v v14.17.0
and"ssh2-sftp-client": "^7.0.0"
方法fastPut
https://github.com/theophilusx/ssh2-sftp-client#sec-5-2-9
检查远程文件正常,因此连接正常。
我的环境是wsl2 Ubuntu-20.04
我面临的问题是错误
RuntimeError: abort(Error: fastPut: No response from server Local: /home/draganddrop/testi.txt Remote: Downloads/testi.txt). Build with -s ASSERTIONS=1 for more info.
at process.J (/home/draganddrop/node_modules/ssh2/lib/protocol/crypto/poly1305.js:20:53)
at process.emit (events.js:376:20)
at processPromiseRejections (internal/process/promises.js:245:33)
at processTicksAndRejections (internal/process/task_queues.js:96:32)
Run Code Online (Sandbox Code Playgroud)
我也尝试过从sftp> put /home/draganddrop/testi.txt Downloads/testi.txt
控制台,它有效。
我正在使用的代码:
let Client = require('ssh2-sftp-client');
let sftp = new Client();
let remotePath = 'Downloads/testi.txt';
let localPath = '/home/draganddrop/testi.txt'
const config = {
host: 'XX.XX.XXX.XXX',
port: '22',
username: 'XXXXX',
password: …
Run Code Online (Sandbox Code Playgroud) 我有一个 df:
df = pd.DataFrame({'id': [1, 1, 2, 2, 2, 3, 4, 4, 4], \
"name": ["call", "response", "call", "call", "response", "call", "call", "response", "response"]})
Run Code Online (Sandbox Code Playgroud)
id name
0 1 call
1 1 response
2 2 call
3 2 call
4 2 response
5 3 call
6 4 call
7 4 response
8 4 response
Run Code Online (Sandbox Code Playgroud)
我正在尝试提取一个呼叫-响应对,其中呼叫后的第一个响应是正确的模式。调用和响应对位于它们自己的子集中,id
如下所示:
id name
0 1 call
1 1 response
3 2 call
4 2 response
6 4 call
7 4 response
Run Code Online (Sandbox Code Playgroud)
理想情况下,我会将 保留indexes …
我有一个 Json 内容:
{
"Name": "startTime",
"Value": [
{
"Valid": true,
"Time": 43852.491953472221
}
]
}
Run Code Online (Sandbox Code Playgroud)
其中“时间”以小数表示 43852.491953472221 据我所知,表示自 1900 年 1 月 1 日以来的天数。
有没有快速的方法可以将Python中的时间转换为如下格式:
import time
print("Start time: ", time.ctime(time.time()))
Run Code Online (Sandbox Code Playgroud)
输出:
Start time: Wed Jan 22 14:10:50 2020
Run Code Online (Sandbox Code Playgroud) node.js ×2
python ×2
dataframe ×1
decimal ×1
npm ×1
npm-install ×1
pandas ×1
python-3.x ×1
ssh2 ×1
wsl-2 ×1