Pyinstaller not getting all modules - ImportError: No module named logilab.constraint
<p>I am trying to compile a python script into a .exe using Pyinstaller.
I am using python 2.7, Pyinstaller 3.2 and windows 7.</p>

<p>The script is using a module called "logilab", and another called "logilab.constraint".</p>

<p>I have installed both modules succesfully using pip.
The script runs fine, but when trying to run the .exe I get the following error:</p>

<pre><code>Traceback (most recent call last):
  File "schedule_maker.py", line 1, in &lt;module&gt;
ImportError: No module named logilab.constraint
Failed to execute script schedule_maker
</code></pre>

<p>here is the Pyinstaller log:</p>

<pre><code>490 INFO: PyInstaller: 3.2
490 INFO: Python: 2.7.11
490 INFO: Platform: Windows-7-6.1.7601-SP1
493 INFO: wrote c:\Scripts\Employee-Scheduler-master\schedule\schedule_maker.spe
c
496 INFO: UPX is not available.
497 INFO: Extending PYTHONPATH with paths
['c:\\Scripts\\Employee-Scheduler-master\\schedule',
 'C:\\Python27\\Lib\\site-packages',
 'c:\\Scripts\\Employee-Scheduler-master\\schedule']
498 INFO: checking Analysis
513 INFO: Building because pathex changed
514 INFO: Initializing module dependency graph...
519 INFO: Initializing module graph hooks...
595 INFO: running Analysis out00-Analysis.toc
608 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
  required by C:\Python27\python.exe
692 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.21022.8_none_60a5df56e60dc5df.manifest
710 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.1_none_8550c6b5d18a9128.manifest
715 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.4148_none_f47e1bd6f6571810.manifest
727 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.4940_none_f47ed0f6f6564d90.manifest
812 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.307
29.4940_none ...
812 INFO: Found manifest C:\WINDOWS\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8
b3b9a1e18e3b_9.0.30729.4940_none_50916076bcb9a742.manifest
825 INFO: Searching for file msvcr90.dll
825 INFO: Found file C:\WINDOWS\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9
.0.30729.4940_none_50916076bcb9a742\msvcr90.dll
825 INFO: Searching for file msvcp90.dll
826 INFO: Found file C:\WINDOWS\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9
.0.30729.4940_none_50916076bcb9a742\msvcp90.dll
826 INFO: Searching for file msvcm90.dll
826 INFO: Found file C:\WINDOWS\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9
.0.30729.4940_none_50916076bcb9a742\msvcm90.dll
904 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.21022.8_none_60a5df56e60dc5df.manifest
907 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.1_none_8550c6b5d18a9128.manifest
908 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.4148_none_f47e1bd6f6571810.manifest
909 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.4940_none_f47ed0f6f6564d90.manifest
911 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -&gt; (9, 0,
30729, 4940)
4608 INFO: Caching module hooks...
4611 INFO: Analyzing c:\Scripts\Employee-Scheduler-master\schedule\schedule_make
r.py
6958 INFO: Loading module hooks...
6958 INFO: Loading module hook "hook-logilab.py"...
6963 INFO: Loading module hook "hook-encodings.py"...
8536 INFO: Looking for ctypes DLLs
8536 INFO: Analyzing run-time hooks ...
8543 INFO: Looking for dynamic libraries
9572 INFO: Looking for eggs
9572 INFO: Using Python library C:\WINDOWS\system32\python27.dll
9572 INFO: Found binding redirects:
[BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'x86', oldVers
ion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 4940), publicKeyToken=u'1fc8b3b9a
1e18e3b')]
9582 INFO: Warnings written to c:\Scripts\Employee-Scheduler-master\schedule\bui
ld\schedule_maker\warnschedule_maker.txt
9622 INFO: checking PYZ
9692 INFO: checking PKG
9695 INFO: Building because c:\Scripts\Employee-Scheduler-master\schedule\build\
schedule_maker\schedule_maker.exe.manifest changed
9697 INFO: Building PKG (CArchive) out00-PKG.pkg
9951 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -&gt; (9, 0, 307
29, 4940)
11652 INFO: Bootloader C:\Python27\lib\site-packages\pyinstaller-3.2-py2.7.egg\P
yInstaller\bootloader\Windows-32bit\run.exe
11654 INFO: checking EXE
11655 INFO: Rebuilding out00-EXE.toc because pkg is more recent
11657 INFO: Building EXE from out00-EXE.toc
11657 INFO: Appending archive to EXE c:\Scripts\Employee-Scheduler-master\schedu
le\dist\schedule_maker.exe
</code></pre>

<p>I am using the following command to build:</p>

<pre><code>pyinstaller --onefile schedule_maker.py
</code></pre>

<p>I tried adding the installation path for logilab.constraint in the command:</p>

<pre><code>pyinstaller --onefile --paths=C:\Python27\Lib\site-packages\ schedule_maker.py
</code></pre>

<p>Any ideas? Am I missing something?</p>

<p>Apparently just installing the modules from their "setup.py" file was not enough, I had to </p>

<pre><code>pip install --upgrade 
</code></pre>

<p>on both of them.
that fixed it.</p>

python python-2.7 module pyinstaller