reubenur-rahman / vmware-pyvmomi-examples

The example codes are written using the VMware official python library pyvmomi
Apache License 2.0
89 stars 60 forks source link

ImportError: No module named 'pyVim' #7

Open github-12341234 opened 7 years ago

github-12341234 commented 7 years ago

At least on my Mac, using Python 3.5, pyVim cannot be found but pyvim can be found. The difference is only the capitalization:

$ python3.5 
Python 3.5.2 |Anaconda 4.1.1 (x86_64)| (default, Jul  2 2016, 17:52:12) 
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ataxia
>>> import argparse
>>> import sys
>>> import time
>>> 
>>> from pyVmomi import vim, vmidl
>>> from pyVim import connect
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'pyVim'
>>> from pyVim.connect import Disconnect
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'pyVim'
>>> from pyvim import connect
>>> 

Is it me? Am I missing something obvious?

Bonn93 commented 7 years ago

+1 - Same issue, but running python from the site-packages ( at least on CentOS7 ) works fine...

I guess in the python you need to specify the sys paths?

import sys
sys.path.insert(0, '/usr/lib/python2.7/site-packages')
import pyVmomi

I guess you need to specify and handle your paths?

xiaowei0516 commented 6 years ago

@github-12341234 , @Bonn93 is right, you shold close this issue.