I *think* I've manipuled the TOC in a spec file to remove unwanted imports
-- would that work? Here's an example (from long ago) of excluding Tk:

# -*- mode: python -*-

a = Analysis(['code_chat.py'],
             pathex=['C:\\Users\\bjones\\Documents\\documentation'],
             hiddenimports=[],
             hookspath=['pyinstaller_hooks'],
             excludes=['_tkinter'])   # ********************* THIS LINE
**********************
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts, # + [('v', '', 'OPTION')], # for extra run-time debug
          exclude_binaries=1,
          name=os.path.join('build\\pyi.win32\\code_chat', 'code_chat.exe'),
          debug=False,
          strip=None,
          upx=False,
          console=True )
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=None,
               upx=False,
               name=os.path.join('dist', 'code_chat'))

Bryan

On Tue, Sep 23, 2014 at 4:18 PM, Gelonida N <[email protected]> wrote:

> Hi Hartmut,
>
>
> I tried to follow your suggestion and setup a virtualenv containing just
> the modules, that are allowed to be auto-discovered.
>
> First error message, that I get is:
> Error: PyInstaller for Python 2.6+ on Windows needs pywin32.
> Please install from http://sourceforge.net/projects/pywin32/
>
> How can I install pywin32 in a virtualenv?
>
> PLease see below a few success less attempts:
>
>> (mypy) d:\>pip install pywin32
>> Downloading/unpacking pywin32
>>   Could not find any downloads that satisfy the requirement pywin32
>>   Some externally hosted files were ignored (use --allow-external pywin32
>> to allow).
>> Cleaning up...
>> No distributions at all found for pywin32
>> Storing debug log for failure in C:\Users\gelonida\pip\pip.log
>>
>
>  (mypy) d:\>pip install --allow-external pywin32 pywin32
>> Downloading/unpacking pywin32
>>   Could not find any downloads that satisfy the requirement pywin32
>>   Some insecure and unverifiable files were ignored (use
>> --allow-unverified pywin32 to allow).
>> Cleaning up...
>> No distributions at all found for pywin32
>> Storing debug log for failure in C:\Users\gelonida\pip\pip.log
>>
>
>
>  (mypy) d:\>pip install --allow-external pywin32 --allow-unverified
>> pywin32 pywin32
>> Downloading/unpacking pywin32
>>   Could not find any downloads that satisfy the requirement pywin32
>> Cleaning up...
>> No distributions at all found for pywin32
>> Storing debug log for failure in C:\Users\gelonida\pip\pip.log
>>
>
>
>
>
> On 09/20/2014 06:30 PM, Hartmut Goebel wrote:
>
>> Am 20.09.2014 06:09, schrieb Gelonida G:
>>
>>> Thus my question of how to tell pyinstaller to not 'autodiscover'
>>> certain conditional imports and its dependencies
>>>
>>
>>
>> One way is to use a virtual env containing onle the required modules.
>>
>> Or you can manipulate result of the Analysis() call in the .spec-file,
>> see <http://pythonhosted.org/PyInstaller/#id38>
>>
>> --
>> Schönen Gruß
>> Hartmut Goebel
>> Dipl.-Informatiker (univ), CISSP, CSSLP
>> Information Security Management, Security Governance, Secure Software
>> Development
>>
>> Goebel Consult, Landshut
>> http://www.goebel-consult.de
>>
>> Blog:
>> http://www.goebel-consult.de/blog/einladung-von-der-
>> friedrich-ebert-stiftung
>>
>> Kolumne:
>> http://www.cissp-gefluester.de/2011-08-horrorszenario-
>> bring-your-own-device
>>
>> Goebel Consult ist Mitglied bei http://www.7-it.de/
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pyinstaller.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Bryan A. Jones, Ph.D.
Associate Professor
Department of Electrical and Computer Engineering
231 Simrall / PO Box 9571
Mississippi State University
Mississippi state, MS 39762
http://www.ece.msstate.edu/~bjones
bjones AT ece DOT msstate DOT edu
voice 662-325-3149
fax 662-325-2298

Our Master, Jesus Christ, is on his way. He'll show up right on
time, his arrival guaranteed by the Blessed and Undisputed Ruler,
High King, High God.
- 1 Tim. 6:14b-15 (The Message)

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

Reply via email to