Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fexpect needs pexpect to be installed on remote system #23

Open
MitchK opened this issue Mar 29, 2014 · 6 comments
Open

fexpect needs pexpect to be installed on remote system #23

MitchK opened this issue Mar 29, 2014 · 6 comments

Comments

@MitchK
Copy link

MitchK commented Mar 29, 2014

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.

@JasperVanDenBosch
Copy link
Owner

Could you post

ls /tmp

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

@mrname
Copy link

mrname commented Apr 4, 2014

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

#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!

@JasperVanDenBosch
Copy link
Owner

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?

@mrname
Copy link

mrname commented Apr 4, 2014

Thanks for the quick response!

pexpect==3.1
fexpect==0.2.post17

@epikurus
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants