fexpect icon indicating copy to clipboard operation
fexpect copied to clipboard

fexpect needs pexpect to be installed on remote system

Open MitchK opened this issue 10 years ago • 6 comments

I was referred from StackOverflow to here. http://stackoverflow.com/questions/22669686/importerror-no-module-named-pexpect/22670194

fexpect needs pexpect to be installed on remote system, is this a wanted behavior? I'm using Ubuntu 12.04 as a remote machine.

The current workaround is to create a script, that sets up pip and pexpect one the remote machine first, before fexpect can be used.

MitchK avatar Mar 29 '14 01:03 MitchK

Could you post

ls /tmp

here? That would tell us if the pexpect module got send along with the script, as it should have.

JasperVanDenBosch avatar Apr 03 '14 17:04 JasperVanDenBosch

Hello! This seems to be similar to the issue outlined in this pull request:

https://github.com/ilogue/fexpect/pull/19

I have encountered the same error. From my understanding, pexpect should not need to be installed on the remote system, since it gets sent along with your script. However, this does not seem to be happening as anticipated. Here is the output of my fexpect run:

put: /usr/local/lib/python2.7/site-packages/pexpect/init.py -> /tmp/init.py put: -> /tmp/fexpect_SqgwxQbEervD9c5XKwSLjf run: python /tmp/fexpect_SqgwxQbEervD9c5XKwSLjf out: Traceback (most recent call last): out: File "/tmp/fexpect_SqgwxQbEervD9c5XKwSLjf", line 4, in out: import pexpect out: ImportError: No module named pexpect

I hope this helps, and I will be looking forward to the resolution!

mrname avatar Apr 04 '14 19:04 mrname

Yes, this helps! It is sending over pexpect/init.py instead of pexpect.py

This is probably because of how different versions of pexpect are packaged. Can you find out which version of pexpect you have? E.g. with pip freeze?

JasperVanDenBosch avatar Apr 04 '14 19:04 JasperVanDenBosch

Thanks for the quick response!

pexpect==3.1 fexpect==0.2.post17

mrname avatar Apr 04 '14 19:04 mrname

Same situation here, I'm using a python virtualenv created with pyenv. Is there any workaround for this?

pip freeze:

Fabric==1.8.3 fexpect==0.2.post17 pexpect==3.2

Fabric output:

[host] put: /home/user/.pyenv/versions/myenviroment/lib/python2.7/site-packages/pexpect/init.py -> /tmp/init.py [host] put: -> /tmp/fexpect_sbmXyaPapRpNrTvfarf5bL [host] run: python /tmp/fexpect_sbmXyaPapRpNrTvfarf5bL [host] out: Traceback (most recent call last): [host] out: File "/tmp/fexpect_sbmXyaPapRpNrTvfarf5bL", line 4, in [host] out: import pexpect [host] out: ImportError: No module named pexpect

epikurus avatar Jun 11 '14 10:06 epikurus

As ilogue commented, copying manually the pexpect folder to /tmp on remote host can be used as a workaround.

epikurus avatar Jun 11 '14 12:06 epikurus