简体   繁体   中英

python - importError: no module named pysphere

I am able to type the following into python.exe to create a session to Vmware Esxi

from pysphere import VIServer
server = VIServer()
server.connect("myserver", "user", "password")

When I save the same code into a .py file and execute from Windows command line I get

ImportError: No module named pysphere.

When I look in Lib\\site-packages there is a pysphere folder. I am running the .py from c:\\python\\ and my python package is in c:\\python27

I am not use to seeing the from command and so don't really understand

when I ran that command it showed version 2.6.3 not 2.7. I adjusted the path in environment variables from 2.6 to 2.7. Then found registry key pointing to 2.6 so updated that to 2.7 (python.file - shell - open - command).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM