Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
通过运行Pytest测试时,ssh我得到“ no module named pandas”,尽管模块安装在虚拟环境和本地。
Pytest
ssh
no module named pandas
有人可以指出我应该在哪里安装它吗?
我访问我的服务器:
ssh user@server.com
输入密码
运行以下命令:“ py.test -s -v jupyter_test.py”。它运行测试,作为测试结果,我得到上述错误。
py.test -s -v jupyter_test.py
当我在服务器上进行测试时,没有ssh,它工作得很好。但我需要通过 ssh 来完成。
原因是在远程机器上安装了旧版本的 Python,当我将脚本转换为 Python 3 时它工作得很好。
我用来转换脚本的命令是:
jupyter nbconvert --to script --execute --stdout file.ipynb | python3