Creating .exe file in Python

subhabrata.banerji at gmail.com subhabrata.banerji at gmail.com
Mon Jun 15 12:11:51 EDT 2015


On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, subhabrat... at gmail.com wrote:
> Dear Group,
> 
> I am trying to learn how to create .exe file for Python. I tried to work around 
> http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample program went nice.
> But if I try to make exe for larger programs with methods and classes I am getting error. 
> 
> If any one of the esteemed members may kindly suggest how to work out. 
> I am using Python2.7+ on Windows 7 Professional. 
> 
> Regards,
> Subhabrata Banerjee.

Dear Madam,

Thanks. Most of it is working except the last portion as I am giving 
python setup.py py2exe

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Admin>cd\

C:\>cd Python27

C:\Python27>python NLQ3.py
Print Your Query:Java
The Tagged Value Is: [('Java', 'NNP')]
['Java']

C:\Python27>python NLQ3.py
Print Your Query:Obama is the president of USA
The Tagged Value Is: [('Obama', 'NNP'), ('is', 'VBZ'), ('the', 'DT'), ('presiden
t', 'NN'), ('of', 'IN'), ('USA', 'NNP')]
['Obama']
['president']
['USA']
['Obama', 'president']
['Obama', 'USA']
['president', 'USA']
['Obama', 'president', 'USA']

C:\Python27>python setup.py install
running install
running build
running install_egg_info
Removing C:\Python27\Lib\site-packages\UNKNOWN-0.0.0-py2.7.egg-info
Writing C:\Python27\Lib\site-packages\UNKNOWN-0.0.0-py2.7.egg-info

C:\Python27>python setup.py py2exe
running py2exe
*** searching for required modules ***
*** parsing results ***
creating python loader for extension 'scipy.optimize.minpack2' (C:\Python27\lib\
site-packages\scipy\optimize\minpack2.pyd -> scipy.optimize.minpack2.pyd)
creating python loader for extension 'numpy.core.umath' (C:\Python27\lib\site-pa
ckages\numpy\core\umath.pyd -> numpy.core.umath.pyd)
creating python loader for extension '_elementtree' (C:\Python27\DLLs\_elementtr
ee.pyd -> _elementtree.pyd)
creating python loader for extension 'matplotlib._path' (C:\Python27\lib\site-pa
ckages\matplotlib\_path.pyd -> matplotlib._path.pyd)
creating python loader for extension 'numpy.fft.fftpack_lite' (C:\Python27\lib\s
ite-packages\numpy\fft\fftpack_lite.pyd -> numpy.fft.fftpack_lite.pyd)
creating python loader for extension 'numpy.lib._compiled_base' (C:\Python27\lib
\site-packages\numpy\lib\_compiled_base.pyd -> numpy.lib._compiled_base.pyd)
creating python loader for extension 'scipy.optimize._minpack' (C:\Python27\lib\
site-packages\scipy\optimize\_minpack.pyd -> scipy.optimize._minpack.pyd)
creating python loader for extension '_ctypes' (C:\Python27\DLLs\_ctypes.pyd ->
_ctypes.pyd)
creating python loader for extension 'scipy.sparse.linalg.isolve._iterative' (C:
\Python27\lib\site-packages\scipy\sparse\linalg\isolve\_iterative.pyd -> scipy.s
parse.linalg.isolve._iterative.pyd)
creating python loader for extension 'sklearn.linear_model.sgd_fast' (C:\Python2
7\lib\site-packages\sklearn\linear_model\sgd_fast.pyd -> sklearn.linear_model.sg
d_fast.pyd)
creating python loader for extension 'scipy.stats._rank' (C:\Python27\lib\site-p
ackages\scipy\stats\_rank.pyd -> scipy.stats._rank.pyd)
creating python loader for extension 'select' (C:\Python27\DLLs\select.pyd -> se
lect.pyd)
creating python loader for extension 'scipy.sparse.csgraph._reordering' (C:\Pyth
on27\lib\site-packages\scipy\sparse\csgraph\_reordering.pyd -> scipy.sparse.csgr
aph._reordering.pyd)
creating python loader for extension 'unicodedata' (C:\Python27\DLLs\unicodedata
.pyd -> unicodedata.pyd)
creating python loader for extension 'scipy.special.specfun' (C:\Python27\lib\si
te-packages\scipy\special\specfun.pyd -> scipy.special.specfun.pyd)
creating python loader for extension 'scipy.spatial.qhull' (C:\Python27\lib\site
-packages\scipy\spatial\qhull.pyd -> scipy.spatial.qhull.pyd)
creating python loader for extension 'scipy.interpolate._ppoly' (C:\Python27\lib
\site-packages\scipy\interpolate\_ppoly.pyd -> scipy.interpolate._ppoly.pyd)
creating python loader for extension 'scipy.sparse.csgraph._tools' (C:\Python27\
lib\site-packages\scipy\sparse\csgraph\_tools.pyd -> scipy.sparse.csgraph._tools
.pyd)
creating python loader for extension 'scipy.interpolate.dfitpack' (C:\Python27\l
ib\site-packages\scipy\interpolate\dfitpack.pyd -> scipy.interpolate.dfitpack.py
d)
creating python loader for extension 'scipy.linalg._fblas' (C:\Python27\lib\site
-packages\scipy\linalg\_fblas.pyd -> scipy.linalg._fblas.pyd)
creating python loader for extension 'scipy.optimize._zeros' (C:\Python27\lib\si
te-packages\scipy\optimize\_zeros.pyd -> scipy.optimize._zeros.pyd)
creating python loader for extension 'scipy.stats.mvn' (C:\Python27\lib\site-pac
kages\scipy\stats\mvn.pyd -> scipy.stats.mvn.pyd)
creating python loader for extension 'sklearn.__check_build._check_build' (C:\Py
thon27\lib\site-packages\sklearn\__check_build\_check_build.pyd -> sklearn.__che
ck_build._check_build.pyd)
creating python loader for extension 'scipy.linalg._flinalg' (C:\Python27\lib\si
te-packages\scipy\linalg\_flinalg.pyd -> scipy.linalg._flinalg.pyd)
creating python loader for extension 'numpy.core.scalarmath' (C:\Python27\lib\si
te-packages\numpy\core\scalarmath.pyd -> numpy.core.scalarmath.pyd)
creating python loader for extension '_tkinter' (C:\Python27\DLLs\_tkinter.pyd -
> _tkinter.pyd)
creating python loader for extension 'scipy.integrate.lsoda' (C:\Python27\lib\si
te-packages\scipy\integrate\lsoda.pyd -> scipy.integrate.lsoda.pyd)
creating python loader for extension 'matplotlib._delaunay' (C:\Python27\lib\sit
e-packages\matplotlib\_delaunay.pyd -> matplotlib._delaunay.pyd)
creating python loader for extension 'scipy.optimize._slsqp' (C:\Python27\lib\si
te-packages\scipy\optimize\_slsqp.pyd -> scipy.optimize._slsqp.pyd)
creating python loader for extension 'scipy.optimize._nnls' (C:\Python27\lib\sit
e-packages\scipy\optimize\_nnls.pyd -> scipy.optimize._nnls.pyd)
creating python loader for extension 'scipy.stats.vonmises_cython' (C:\Python27\
lib\site-packages\scipy\stats\vonmises_cython.pyd -> scipy.stats.vonmises_cython
.pyd)
creating python loader for extension '_hashlib' (C:\Python27\DLLs\_hashlib.pyd -
> _hashlib.pyd)
creating python loader for extension 'bz2' (C:\Python27\DLLs\bz2.pyd -> bz2.pyd)

creating python loader for extension 'sklearn.svm.libsvm_sparse' (C:\Python27\li
b\site-packages\sklearn\svm\libsvm_sparse.pyd -> sklearn.svm.libsvm_sparse.pyd)
creating python loader for extension '_ssl' (C:\Python27\DLLs\_ssl.pyd -> _ssl.p
yd)
creating python loader for extension '_sqlite3' (C:\Python27\DLLs\_sqlite3.pyd -
> _sqlite3.pyd)
creating python loader for extension 'scipy.integrate._odepack' (C:\Python27\lib
\site-packages\scipy\integrate\_odepack.pyd -> scipy.integrate._odepack.pyd)
creating python loader for extension 'matplotlib._tri' (C:\Python27\lib\site-pac
kages\matplotlib\_tri.pyd -> matplotlib._tri.pyd)
creating python loader for extension 'scipy.sparse.csgraph._min_spanning_tree' (
C:\Python27\lib\site-packages\scipy\sparse\csgraph\_min_spanning_tree.pyd -> sci
py.sparse.csgraph._min_spanning_tree.pyd)
creating python loader for extension 'numpy.random.mtrand' (C:\Python27\lib\site
-packages\numpy\random\mtrand.pyd -> numpy.random.mtrand.pyd)
creating python loader for extension 'sklearn.metrics.cluster.expected_mutual_in
fo_fast' (C:\Python27\lib\site-packages\sklearn\metrics\cluster\expected_mutual_
info_fast.pyd -> sklearn.metrics.cluster.expected_mutual_info_fast.pyd)
creating python loader for extension 'scipy.stats.futil' (C:\Python27\lib\site-p
ackages\scipy\stats\futil.pyd -> scipy.stats.futil.pyd)
creating python loader for extension 'scipy.optimize.moduleTNC' (C:\Python27\lib
\site-packages\scipy\optimize\moduleTNC.pyd -> scipy.optimize.moduleTNC.pyd)
creating python loader for extension 'scipy.integrate.vode' (C:\Python27\lib\sit
e-packages\scipy\integrate\vode.pyd -> scipy.integrate.vode.pyd)
creating python loader for extension 'scipy.sparse.linalg.dsolve._superlu' (C:\P
ython27\lib\site-packages\scipy\sparse\linalg\dsolve\_superlu.pyd -> scipy.spars
e.linalg.dsolve._superlu.pyd)
creating python loader for extension 'matplotlib._image' (C:\Python27\lib\site-p
ackages\matplotlib\_image.pyd -> matplotlib._image.pyd)
creating python loader for extension 'scipy.integrate._quadpack' (C:\Python27\li
b\site-packages\scipy\integrate\_quadpack.pyd -> scipy.integrate._quadpack.pyd)
creating python loader for extension 'scipy.linalg._flapack' (C:\Python27\lib\si
te-packages\scipy\linalg\_flapack.pyd -> scipy.linalg._flapack.pyd)
creating python loader for extension 'scipy.interpolate.interpnd' (C:\Python27\l
ib\site-packages\scipy\interpolate\interpnd.pyd -> scipy.interpolate.interpnd.py
d)
creating python loader for extension 'numpy.core._sort' (C:\Python27\lib\site-pa
ckages\numpy\core\_sort.pyd -> numpy.core._sort.pyd)
creating python loader for extension '_yaml' (C:\Python27\lib\site-packages\_yam
l.pyd -> _yaml.pyd)
creating python loader for extension 'scipy.special._ellip_harm_2' (C:\Python27\
lib\site-packages\scipy\special\_ellip_harm_2.pyd -> scipy.special._ellip_harm_2
.pyd)
creating python loader for extension 'scipy.integrate._dop' (C:\Python27\lib\sit
e-packages\scipy\integrate\_dop.pyd -> scipy.integrate._dop.pyd)
creating python loader for extension 'sklearn.svm.liblinear' (C:\Python27\lib\si
te-packages\sklearn\svm\liblinear.pyd -> sklearn.svm.liblinear.pyd)
creating python loader for extension 'scipy.sparse.csgraph._traversal' (C:\Pytho
n27\lib\site-packages\scipy\sparse\csgraph\_traversal.pyd -> scipy.sparse.csgrap
h._traversal.pyd)
creating python loader for extension 'matplotlib._png' (C:\Python27\lib\site-pac
kages\matplotlib\_png.pyd -> matplotlib._png.pyd)
creating python loader for extension 'matplotlib.backends._backend_agg' (C:\Pyth
on27\lib\site-packages\matplotlib\backends\_backend_agg.pyd -> matplotlib.backen
ds._backend_agg.pyd)
creating python loader for extension 'pyexpat' (C:\Python27\DLLs\pyexpat.pyd ->
pyexpat.pyd)
creating python loader for extension 'matplotlib.ttconv' (C:\Python27\lib\site-p
ackages\matplotlib\ttconv.pyd -> matplotlib.ttconv.pyd)
creating python loader for extension 'scipy.sparse.linalg.eigen.arpack._arpack'
(C:\Python27\lib\site-packages\scipy\sparse\linalg\eigen\arpack\_arpack.pyd -> s
cipy.sparse.linalg.eigen.arpack._arpack.pyd)
creating python loader for extension 'scipy.sparse._sparsetools' (C:\Python27\li
b\site-packages\scipy\sparse\_sparsetools.pyd -> scipy.sparse._sparsetools.pyd)
creating python loader for extension 'sklearn.linear_model.cd_fast' (C:\Python27
\lib\site-packages\sklearn\linear_model\cd_fast.pyd -> sklearn.linear_model.cd_f
ast.pyd)
creating python loader for extension 'scipy.spatial.ckdtree' (C:\Python27\lib\si
te-packages\scipy\spatial\ckdtree.pyd -> scipy.spatial.ckdtree.pyd)
creating python loader for extension 'scipy.sparse.csgraph._shortest_path' (C:\P
ython27\lib\site-packages\scipy\sparse\csgraph\_shortest_path.pyd -> scipy.spars
e.csgraph._shortest_path.pyd)
creating python loader for extension 'scipy.linalg._clapack' (C:\Python27\lib\si
te-packages\scipy\linalg\_clapack.pyd -> scipy.linalg._clapack.pyd)
creating python loader for extension 'scipy.spatial._distance_wrap' (C:\Python27
\lib\site-packages\scipy\spatial\_distance_wrap.pyd -> scipy.spatial._distance_w
rap.pyd)
creating python loader for extension 'scipy.interpolate._fitpack' (C:\Python27\l
ib\site-packages\scipy\interpolate\_fitpack.pyd -> scipy.interpolate._fitpack.py
d)
creating python loader for extension 'matplotlib._cntr' (C:\Python27\lib\site-pa
ckages\matplotlib\_cntr.pyd -> matplotlib._cntr.pyd)
creating python loader for extension 'sklearn.metrics.pairwise_fast' (C:\Python2
7\lib\site-packages\sklearn\metrics\pairwise_fast.pyd -> sklearn.metrics.pairwis
e_fast.pyd)
creating python loader for extension 'numpy.core.multiarray' (C:\Python27\lib\si
te-packages\numpy\core\multiarray.pyd -> numpy.core.multiarray.pyd)
creating python loader for extension 'scipy.sparse._csparsetools' (C:\Python27\l
ib\site-packages\scipy\sparse\_csparsetools.pyd -> scipy.sparse._csparsetools.py
d)
creating python loader for extension 'matplotlib.ft2font' (C:\Python27\lib\site-
packages\matplotlib\ft2font.pyd -> matplotlib.ft2font.pyd)
creating python loader for extension '_multiprocessing' (C:\Python27\DLLs\_multi
processing.pyd -> _multiprocessing.pyd)
creating python loader for extension 'scipy.special._ufuncs' (C:\Python27\lib\si
te-packages\scipy\special\_ufuncs.pyd -> scipy.special._ufuncs.pyd)
creating python loader for extension 'scipy.optimize._lbfgsb' (C:\Python27\lib\s
ite-packages\scipy\optimize\_lbfgsb.pyd -> scipy.optimize._lbfgsb.pyd)
creating python loader for extension 'numpy.linalg.lapack_lite' (C:\Python27\lib
\site-packages\numpy\linalg\lapack_lite.pyd -> numpy.linalg.lapack_lite.pyd)
creating python loader for extension 'scipy.linalg._cblas' (C:\Python27\lib\site
-packages\scipy\linalg\_cblas.pyd -> scipy.linalg._cblas.pyd)
creating python loader for extension '_socket' (C:\Python27\DLLs\_socket.pyd ->
_socket.pyd)
creating python loader for extension 'sklearn.utils.sparsefuncs_fast' (C:\Python
27\lib\site-packages\sklearn\utils\sparsefuncs_fast.pyd -> sklearn.utils.sparsef
uncs_fast.pyd)
creating python loader for extension 'scipy.stats.statlib' (C:\Python27\lib\site
-packages\scipy\stats\statlib.pyd -> scipy.stats.statlib.pyd)
creating python loader for extension 'sklearn.utils.seq_dataset' (C:\Python27\li
b\site-packages\sklearn\utils\seq_dataset.pyd -> sklearn.utils.seq_dataset.pyd)
creating python loader for extension 'sklearn.utils.arrayfuncs' (C:\Python27\lib
\site-packages\sklearn\utils\arrayfuncs.pyd -> sklearn.utils.arrayfuncs.pyd)
creating python loader for extension 'sklearn.utils._logistic_sigmoid' (C:\Pytho
n27\lib\site-packages\sklearn\utils\_logistic_sigmoid.pyd -> sklearn.utils._logi
stic_sigmoid.pyd)
creating python loader for extension 'sklearn.svm.libsvm' (C:\Python27\lib\site-
packages\sklearn\svm\libsvm.pyd -> sklearn.svm.libsvm.pyd)
creating python loader for extension 'numpy.core._dotblas' (C:\Python27\lib\site
-packages\numpy\core\_dotblas.pyd -> numpy.core._dotblas.pyd)
creating python loader for extension 'sklearn.utils.murmurhash' (C:\Python27\lib
\site-packages\sklearn\utils\murmurhash.pyd -> sklearn.utils.murmurhash.pyd)
creating python loader for extension 'sklearn.utils._random' (C:\Python27\lib\si
te-packages\sklearn\utils\_random.pyd -> sklearn.utils._random.pyd)
creating python loader for extension 'scipy.optimize._cobyla' (C:\Python27\lib\s
ite-packages\scipy\optimize\_cobyla.pyd -> scipy.optimize._cobyla.pyd)
*** finding dlls needed ***
error: [Errno 2] No such file or directory: 'MSVCP90.dll'

C:\Python27>

And I have changed NLTK thing to,pos_tag(wordpunct_tokenize(inp))

Regards,
Subhabrata Banerjee. 

 




More information about the Python-list mailing list