0

when running Pytest test through ssh I get "no module named pandas" although module is installed both on vritual environment and locally.

Can somebody point out where else should I install it?

I access my server:

ssh user@server.com

enter password

run the following command: "py.test -s -v jupyter_test.py". It runs tests, and as test result I get above mentioned error.

When I do test on server, without ssh, it works perfectly. But I need to do it through ssh.

president
  • 503
  • 1
  • 3
  • 18
  • Are you sshing to the same user as you do locally? Are you using a virtual environment while doing this locally? Did you check that the "path" is the same? (that's where python is looking for pandas) – Ofer Sadan May 22 '18 at 11:25
  • @OferSadan thanks for your answer! no I ssh with different user, but when I ssh I enter command "pip install pandas" and it says that it's already up-to-date. As for 2 question: I don't do it locally on machine, but on server (web platform) and I also installed module there. As for 3 question: don't know how to check, maybe you can help:) – president May 22 '18 at 11:29
  • there are multiple things to check, i'm not sure I know them all. Check `PYTHONPATH` on linux from both options and make sure they're the same. Do the same check inside python from `sys.path` and compare. Try `sudo` for installing pandas (that might put the installation in a different location), and that's all I know, hope that helps – Ofer Sadan May 22 '18 at 11:32

1 Answers1

0

the reason was that on remote machine there was installed old version of Python, when I converted script to Python 3 it worked just fine.

command I used to convert script is:

jupyter nbconvert --to script --execute --stdout file.ipynb | python3
president
  • 503
  • 1
  • 3
  • 18