2015-07-22 12 views
1

Мой setup.py выдает следующее сообщение об ошибке при попытке сделать мой py2exe настройки скриптаpy2exe запросы, Clint, LXML

The following modules appear to be missing 
['OpenSSL.SSL', '_scproxy', 'backports.ssl_match_hostname', 'builtins', 'certifi', 'clint.textui.puts', 'http', 'http.client', 'http.cookies', 'ndg.httpsclient.ssl_peer_verification', 'ndg.httpsclient.subj_alt_ 
name', 'packages.ssl_match_hostname.CertificateError', 'packages.ssl_match_hostname.match_hostname', 'packages.urllib3.Retry', 'packages.urllib3.util.Timeout', 'packages.urllib3.util.parse_url', 'pyasn1.codec.d 

Что мне не хватает моего setup.py поэтому он будет работать?

from setuptools import setup 
from sys import version 

try: 
    import py2exe 
except ImportError: 
    print "Warning: py2exe is not installed." 
    print "(Though it may not be available on your platform.)" 

requires = ['requests', 'clint', 'lxml'] 
if version < '2.6.0': 
    requires.append("simplejson") 

setup(
    name='CFSRESD', 
    version='0.1', 
    author='Shane Rees', 
    url='http://github.com/Shaggs/cfsresd', 
    options=dict(py2exe=dict(includes=['scraper'])), 

    requires= requires, 
    license='GPL3', 
    console=['daemon.py'] 
    ) 

и вот верхний мой daemon.py сценарий

from scraper import Scraper 
import sys 
import requests 
from clint.textui import puts, colored 

Я думал, что мой setup.py был правильным, но, похоже, нет.

Любые идеи?

ответ

1

Вместо py2exe использования pyinstaller

Pyinstaller.exe -F script.py 

-F означает один файл

Поскольку вы используете запросы, возможно, придется сделать

pyinstaller.exe -F --hidden-import=requests script.py 

Дайте, что выстрел

+0

Работа лечить ура – shaggs

Смежные вопросы