I'm running 32-bit Windows XP and trying to have Matlab communicate with Cgate, a command line program. I'd like to make this happen using wexpect, which is a port of Python's module pexpect to Windows. I'm having trouble installing or importing wexpect though. I've put wexpect in the folder Lib, along with all other modules. I can import those other modules but just not wexpect. Commands I've tried include:
import wexpect
import wexpect.py
python wexpect.py install
python wexpect.py install --home=~
wexpect install
Does anyone have anymore ideas?
If you installed wexpect somewhere in the module search path (
sys.path), thenimport wexpectis what you would use. You have to make sure you installed it in the right path, though (the usual location isLib\site-packagesinside the Python installation.) If the packagewexpect.pywas in came with asetup.pyfile, you could install it withfrom a DOS prompt. Depending on what else you did you may need to restart the Python interpreter or IDE that you're using for it to pick it up. You should also pay attention to the errors you get when you try
import wexpect, as it may have dependencies you need to install.