Search code examples
pythonyamlpy2exe

when using py2exe to convert into exes, yaml packages cannot be imported, while yaml works in IDLE


I have installed yaml successfully, which works well python IDLE using import yaml. When using py2exe to convert into exes, raise ImportError: no module named yaml. My setup.py as below:

from distutils.core import setup
import py2exe
setup(
    console=[{'script': 'mutilGeo.py'}],
    options={
        'py2exe': 
        {
            'includes': ['pymongo', 'yaml']
        }
    }
)

Is the yaml'path cannot be found by py2exe ? How ?


Solution

  • It seemd to the YAML is not installed successfully. As to work well in python idle, I think it may be installed by using exe program or existed in other package. When using python setup.py install to install the YAML package, it is solved.