Creating .exe file in Python

classic Classic list List threaded Threaded
34 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

subhabrata.banerji@gmail.com
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.


Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

Mark Lawrence
On 15/06/2015 12:42, subhabrata.banerji 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.
>

I'm awfully sorry but both my main and backup crystal balls are being
repaired due to overuse.  "I am getting error" is about as much use as a
wet fart in a thunderstorm.  So given that I never much liked guessing
games anyway as I'm not much good at them, how about telling us
precisely what error you're getting.  In that way one or more of our
most esteemed colleagues might be able to help.

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence


Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

Laura Creighton-2
In reply to this post by subhabrata.banerji@gmail.com
In a message of Mon, 15 Jun 2015 04:42:09 -0700, subhabrata.banerji at gmail.com w
rites:

>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.

1. Post the error.

2. I have always had better luck with PyInstaller than with py2exe
   https://github.com/pyinstaller/pyinstaller/wiki

Laura


Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

subhabrata.banerji@gmail.com
In reply to this post by subhabrata.banerji@gmail.com
On Monday, June 15, 2015 at 6:32:33 PM UTC+5:30, Laura Creighton wrote:

> In a message of Mon, 15 Jun 2015 04:42:09 -0700,  w
> rites:
> >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.
>
> 1. Post the error.
>
> 2. I have always had better luck with PyInstaller than with py2exe
>    https://github.com/pyinstaller/pyinstaller/wiki
>
> Laura
Dear Group,

I wrote a script as NLQ3. py

the code is written as,

import nltk
import itertools
def nlq3(n):
    inp=raw_input("Print Your Query:")
    tag=nltk.pos_tag(nltk.wordpunct_tokenize(inp))
    print "The Tagged Value Is:",tag
    noun=[word[0] for word in tag if 'NN' in word[1]]
    #print noun
    #COMBINATION OF ALL ELEMENTS
    for i in xrange(1,len(noun)+1):
        comb= list(itertools.combinations(noun,i))
        for i,v in enumerate(comb):
            #print v
            v1=list(v)
            print v1

I tried to call it as,
C:\Tutorial>python hello.py
...
as

C:\Python27>python NLQ3.py

C:\Python27>

But I am not getting any output.

Next I tried to create setup.py as,

from distutils.core import setup
import py2exe
setup(console=['NLQ3.py'])

and trying to work out as,


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>

Now,
as I am giving
C:\Python27>python setup.py py2exe

it is giving me the following result,
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'

Please suggest how may I fix the issue.

Regards,
Subhabrata.








Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

subhabrata.banerji@gmail.com
In reply to this post by subhabrata.banerji@gmail.com
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.

I am also experimenting around Pyinstaller, cx_Freeze and Inno Studio. But not finding ample examples and manuals.
Regards,
Subhabrata.

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

Thierry Chappuis
Hi,

The question is why to you want to create an exe from your python project?

Setuptools is capable to create small .exe launchers in the Scripts dir of
your
python install. These launchers start a python script and use the python
interpreter registered on your platform. That's pretty light and that's my
prefered solution.

If installing the Python interpreter is an issue for the end user, we can
make
the installer do it for him. Installer programs like Inno Setup let you do
it
quite easily.

Kind regards

Thierry


On lun., juin 15, 2015 at 4:10 PM, < subhabrata.banerji at gmail.com
[subhabrata.banerji at gmail.com] > wrote:
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.

I am also experimenting around Pyinstaller, cx_Freeze and Inno Studio. But
not
finding ample examples and manuals.
Regards,
Subhabrata.
--
https://mail.python.org/mailman/listinfo/python-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150615/900f5c40/attachment.html>

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

subhabrata.banerji@gmail.com
In reply to this post by subhabrata.banerji@gmail.com
On Monday, June 15, 2015 at 8:02:21 PM UTC+5:30, Thierry Chappuis wrote:

> Hi,
>
> The question is why to you want to create an exe from your
> python project?
>
> Setuptools is capable to create small .exe launchers in the
> Scripts dir of your python install. These launchers start a python script
> and use the python interpreter registered on your platform. That's pretty
> light and that's my prefered solution.
>
> If installing the Python interpreter is an issue for the end
> user, we can make the installer do it for him. Installer programs like Inno
> Setup let you do it quite easily.
>
> Kind regards
>
> Thierry
>
>
>
> On lun., juin 15, 2015 at
> 4:10 PM,  <subhabrat... at gmail.com>
> wrote:
>
>
> 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.
>
>
>
>
>
> I am also experimenting around Pyinstaller, cx_Freeze and Inno Studio. But
> not finding ample examples and manuals.
>
>
> Regards,
>
>
> Subhabrata.
>
>
> --
>
>
> https://mail.python.org/mailman/listinfo/python-list

Thank you for your kind reply. I have downloaded it, but no good tutorial. If you may send any. Regards, Subhabrata Banerjee.

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

Laura Creighton-2
In reply to this post by subhabrata.banerji@gmail.com
In a message of Mon, 15 Jun 2015 06:42:48 -0700, subhabrata.banerji at gmail.com w

>I wrote a script as NLQ3. py
>
>the code is written as,
>
>import nltk
>import itertools
>def nlq3(n):
>    inp=raw_input("Print Your Query:")
>    tag=nltk.pos_tag(nltk.wordpunct_tokenize(inp))
>    print "The Tagged Value Is:",tag
>    noun=[word[0] for word in tag if 'NN' in word[1]]
>    #print noun
>    #COMBINATION OF ALL ELEMENTS
>    for i in xrange(1,len(noun)+1):
>        comb= list(itertools.combinations(noun,i))
>        for i,v in enumerate(comb):
>            #print v
>            v1=list(v)
>            print v1
>
>I tried to call it as,
>C:\Tutorial>python hello.py
>...
>as
>
>C:\Python27>python NLQ3.py
>
>C:\Python27>
>
>But I am not getting any output.

You need to fix your script first, and package it later.
That you are not getting any output indicates that you have
a severe problem.  And you do.  There is no main function in
the code that you posted.  So I made 2 small changes.

First, you aren't using n in your nlq3.  So I changed the function
definition to it to.

def nlq3():

Then I added these lines to the very bottom of the file.

if __name__ == "__main__":
    nlq3()

My file is named nlq3.py and now python nlq3.py gives output.  This
is an improvement.  But the code is still wrong.

It gets to here:

 tag=nltk.pos_tag(nltk.wordpunct_tokenize(inp))

and nltk is very unhappy about this.


lac at smartwheels:~/python$ python nlq3.py
Print Your Query:hello
Traceback (most recent call last):
  File "nlq3.py", line 18, in <module>
    nlq3()
  File "nlq3.py", line 5, in nlq3
    tag=nltk.pos_tag(nltk.wordpunct_tokenize(inp))
  File "/usr/local/lib/python2.7/dist-packages/nltk/tag/__init__.py", line 103, in pos_tag
    tagger = load(_POS_TAGGER)
  File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 781, in load
    opened_resource = _open(resource_url)
  File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 895, in _open
    return find(path_, path + ['']).open()
  File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 624, in find
    raise LookupError(resource_not_found)
LookupError:
**********************************************************************
  Resource u'taggers/maxent_treebank_pos_tagger/english.pickle'
  not found.  Please use the NLTK Downloader to obtain the
  resource:  >>> nltk.download()
  Searched in:
    - '/home/lac/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
    - u''
**********************************************************************

I don't know enough about nltk to know how to fix this.  You will have
to read nltk docs for that.  But get the code to work, first and
package it later, ok?

Laura

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

subhabrata.banerji@gmail.com
In reply to this post by subhabrata.banerji@gmail.com
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.

 


Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

Laura Creighton-2
I don't have a windows system, so my knowledge of such things is
minimal.  But looks like this person had the same problem you have,
and got some suggestions on how to fix it.

http://stackoverflow.com/questions/12127869/error-msvcp90-dll-no-such-file-or-directory-even-though-microsoft-visual-c

But your code is working fine now?  There is no point in packaging
something that doesn't run.

Laura


Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

sohcahtoa82@gmail.com
In reply to this post by subhabrata.banerji@gmail.com
On Monday, June 15, 2015 at 5:08:58 AM UTC-7, Mark Lawrence wrote:

> On 15/06/2015 12:42, subhabrata.banerji 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.
> >
>
> I'm awfully sorry but both my main and backup crystal balls are being
> repaired due to overuse.  "I am getting error" is about as much use as a
> wet fart in a thunderstorm.  So given that I never much liked guessing
> games anyway as I'm not much good at them, how about telling us
> precisely what error you're getting.  In that way one or more of our
> most esteemed colleagues might be able to help.
>
> --
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
>
> Mark Lawrence

"as much use as a wet fart in a thunderstorm"

I gotta remember that one.  :-D

But on topic...I really don't understand what makes people think we can *possibly* help them by only saying "I'm getting an error" without saying what the error is.

I mean, even before I ever became a programmer, I knew that if I needed help fixing something, I needed to give as much information as I could.  Exact error messages, detailed description of what I was doing, what I've done to try to fix it, etc.

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

subhabrata.banerji@gmail.com
In reply to this post by subhabrata.banerji@gmail.com
On Monday, June 15, 2015 at 9:59:33 PM UTC+5:30, Laura Creighton wrote:

> I don't have a windows system, so my knowledge of such things is
> minimal.  But looks like this person had the same problem you have,
> and got some suggestions on how to fix it.
>
> http://stackoverflow.com/questions/12127869/error-msvcp90-dll-no-such-file-or-directory-even-though-microsoft-visual-c
>
> But your code is working fine now?  There is no point in packaging
> something that doesn't run.
>
> Laura

Hi,

Thank you for your help. Yes now the file is giving output as I am calling it in command prompt. I had downloaded Microsoft Visual Studio 2008 Redistributable.
I have MS VC 10.0 installed so my corresponding CRT file is 100 and not 90. I am checking this and working out.
Meanwhile got another post http://stackoverflow.com/questions/323424/py2exe-fails-to-generate-an-executable
and pasted libiomp5md.dll from numpy now it is giving NLQ3.exe in dist and generating few errors in a corresponding log file.

Regards,
Subhabrata Banerjee.

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

subhabrata.banerji@gmail.com
In reply to this post by subhabrata.banerji@gmail.com
On Monday, June 15, 2015 at 9:59:33 PM UTC+5:30, Laura Creighton wrote:

> I don't have a windows system, so my knowledge of such things is
> minimal.  But looks like this person had the same problem you have,
> and got some suggestions on how to fix it.
>
> http://stackoverflow.com/questions/12127869/error-msvcp90-dll-no-such-file-or-directory-even-though-microsoft-visual-c
>
> But your code is working fine now?  There is no point in packaging
> something that doesn't run.
>
> Laura

I have mostly solved the problem. But there are two issues making me slightly confusing:
i) In a bigger code I am calling scipy and after building .exe as I am calling
\dist\...exe it is giving ImportError: No module named _ufuncs_cxx
I have checked the resolution http://stackoverflow.com/questions/20169728/exe-created-with-py2exe-doesnt-work-and-returns-logfile-with-errors
but it is not giving much help.
ii) In a class how may I include if __name__ == "__main__": with multiple methods? But I think this is easy question there should be lot of web help.

If anyone may kindly suggest.

Regards,
Subhabrata Banerjee.
 

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

Laura Creighton-2
In a message of Tue, 16 Jun 2015 06:56:12 -0700, subhabrata.banerji at gmail.com w
rites:
>ii) In a class how may I include if __name__ == "__main__": with multiple methods? But I think this is easy question there should be lot of web help.
>
>If anyone may kindly suggest.
>
>Regards,
>Subhabrata Banerjee.

There is something wrong in the way you are thinking about this.
You don't _want_ to stick if __name__ = "__main__":
into every class you write.

See if reading this helps.
http://effbot.org/pyfaq/tutor-what-is-if-name-main-for.htm

Laura


Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

subhabrata.banerji@gmail.com
In reply to this post by subhabrata.banerji@gmail.com
On Tuesday, June 16, 2015 at 8:35:39 PM UTC+5:30, Laura Creighton wrote:

> In a message of Tue, 16 Jun 2015 06:56:12 -0700,  writes:
> >ii) In a class how may I include if __name__ == "__main__": with multiple methods? But I think this is easy question there should be lot of web help.
> >
> >If anyone may kindly suggest.
> >
> >Regards,
> >Subhabrata Banerjee.
>
> There is something wrong in the way you are thinking about this.
> You don't _want_ to stick if __name__ = "__main__":
> into every class you write.
>
> See if reading this helps.
> http://effbot.org/pyfaq/tutor-what-is-if-name-main-for.htm
>
> Laura

Hi,
Thanks. The scipy issue seems solved. But this silly issue is giving so much of time. I am checking. Please see a sample code,

import sys
sys.stderr = sys.stdout
class Colors:
    def Blue(self):
        self.var="This is Blue"
        print self.var
    def Red(self):
        print self.var
       
   
       
if __name__ == "__main__":
    Colors().Blue() #THIS IS FINE
    Colors().Red() #NOT FINE

Regards,
Subhabrata Banerjee.

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

Ian Kelly-2
On Tue, Jun 16, 2015 at 9:17 AM,  <subhabrata.banerji at gmail.com> wrote:

> On Tuesday, June 16, 2015 at 8:35:39 PM UTC+5:30, Laura Creighton wrote:
>> In a message of Tue, 16 Jun 2015 06:56:12 -0700,  writes:
>> >ii) In a class how may I include if __name__ == "__main__": with multiple methods? But I think this is easy question there should be lot of web help.
>> >
>> >If anyone may kindly suggest.
>> >
>> >Regards,
>> >Subhabrata Banerjee.
>>
>> There is something wrong in the way you are thinking about this.
>> You don't _want_ to stick if __name__ = "__main__":
>> into every class you write.
>>
>> See if reading this helps.
>> http://effbot.org/pyfaq/tutor-what-is-if-name-main-for.htm
>>
>> Laura
>
> Hi,
> Thanks. The scipy issue seems solved. But this silly issue is giving so much of time. I am checking. Please see a sample code,
>
> import sys
> sys.stderr = sys.stdout
> class Colors:
>     def Blue(self):
>         self.var="This is Blue"
>         print self.var
>     def Red(self):
>         print self.var
>
>
>
> if __name__ == "__main__":
>     Colors().Blue() #THIS IS FINE
>     Colors().Red() #NOT FINE

I'm assuming that when you run this, you get the output "This is Blue"
followed by an AttributeError from Colors.Red complaining that the var
attribute is not set. If you want this to work, then maybe you should
set the attribute.

But as Laura noted, you probably don't want to be calling more than
one thing in your if __name__ == "__main__" block. Just call the entry
point of your program.

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

Chris Angelico
In reply to this post by subhabrata.banerji@gmail.com
On Wed, Jun 17, 2015 at 1:17 AM,  <subhabrata.banerji at gmail.com> wrote:

> Thanks. The scipy issue seems solved. But this silly issue is giving so much of time. I am checking. Please see a sample code,
>
> import sys
> sys.stderr = sys.stdout
> class Colors:
>     def Blue(self):
>         self.var="This is Blue"
>         print self.var
>     def Red(self):
>         print self.var
>
>
>
> if __name__ == "__main__":
>     Colors().Blue() #THIS IS FINE
>     Colors().Red() #NOT FINE

You're still not saying what's going on. Did you try this code as a
simple Python script first, before trying to bundle it up into an .exe
file?

Fortunately, my primary crystal ball is active, and I believe what's
going on is that you expect Blue() to set something and then Red() to
see it. However, you're calling those methods on two different
throw-away objects, so they have separate state. What you expect to
happen, I honestly have no idea. (Also, why are you fiddling with
sys.stderr? You don't then appear to be using it, unless you have an
issue with exceptions getting printed to the other stream.)

ChrisA

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

subhabrata.banerji@gmail.com
In reply to this post by subhabrata.banerji@gmail.com
On Tuesday, June 16, 2015 at 9:33:58 PM UTC+5:30, Chris Angelico wrote:

> On Wed, Jun 17, 2015 at 1:17 AM,  wrote:
> > Thanks. The scipy issue seems solved. But this silly issue is giving so much of time. I am checking. Please see a sample code,
> >
> > import sys
> > sys.stderr = sys.stdout
> > class Colors:
> >     def Blue(self):
> >         self.var="This is Blue"
> >         print self.var
> >     def Red(self):
> >         print self.var
> >
> >
> >
> > if __name__ == "__main__":
> >     Colors().Blue() #THIS IS FINE
> >     Colors().Red() #NOT FINE
>
> You're still not saying what's going on. Did you try this code as a
> simple Python script first, before trying to bundle it up into an .exe
> file?
>
> Fortunately, my primary crystal ball is active, and I believe what's
> going on is that you expect Blue() to set something and then Red() to
> see it. However, you're calling those methods on two different
> throw-away objects, so they have separate state. What you expect to
> happen, I honestly have no idea. (Also, why are you fiddling with
> sys.stderr? You don't then appear to be using it, unless you have an
> issue with exceptions getting printed to the other stream.)
>
> ChrisA

Thank you for your reply. I am trying to experimenting over small ones before going to actual code. Your error interpretations are right.
I could work out a small solution please check if it is going fine.
It is giving me result.

if __name__ == "__main__":
    c1=Colors()
    c2=c1.Blue()
    c3=c1.Red()

Regards,
Subhabrata Banerjee.

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

subhabrata.banerji@gmail.com
In reply to this post by subhabrata.banerji@gmail.com
On Tuesday, June 16, 2015 at 9:33:58 PM UTC+5:30, Chris Angelico wrote:

> On Wed, Jun 17, 2015 at 1:17 AM, wrote:
> > Thanks. The scipy issue seems solved. But this silly issue is giving so much of time. I am checking. Please see a sample code,
> >
> > import sys
> > sys.stderr = sys.stdout
> > class Colors:
> >     def Blue(self):
> >         self.var="This is Blue"
> >         print self.var
> >     def Red(self):
> >         print self.var
> >
> >
> >
> > if __name__ == "__main__":
> >     Colors().Blue() #THIS IS FINE
> >     Colors().Red() #NOT FINE
>
> You're still not saying what's going on. Did you try this code as a
> simple Python script first, before trying to bundle it up into an .exe
> file?
>
> Fortunately, my primary crystal ball is active, and I believe what's
> going on is that you expect Blue() to set something and then Red() to
> see it. However, you're calling those methods on two different
> throw-away objects, so they have separate state. What you expect to
> happen, I honestly have no idea. (Also, why are you fiddling with
> sys.stderr? You don't then appear to be using it, unless you have an
> issue with exceptions getting printed to the other stream.)
>
> ChrisA

Dear Group,

Thank you all. It seems going fine now. I have one additional question if I run the .exe files created in Non Python Windows environment. Linux has Python builtin but in Non Python environment how may I run it? Is there any set of prequisites I have to follow. I am not finding much web help, if any one may kindly suggest.

Regards,
Subhabrata Banerjee.

Reply | Threaded
Open this post in threaded view
|

Creating .exe file in Python

Chris Angelico
On Wed, Jun 17, 2015 at 11:10 PM,  <subhabrata.banerji at gmail.com> wrote:
> Thank you all. It seems going fine now. I have one additional question if I run the .exe files created in Non Python Windows environment. Linux has Python builtin but in Non Python environment how may I run it? Is there any set of prequisites I have to follow. I am not finding much web help, if any one may kindly suggest.
>

There have been some proposals to make an easy way to produce a single
package that has a Windows executable header, but can be easily
unpacked and run using a system-provided Linux or Mac OS Python.
However, I don't think any have been deployed yet. So the simple
answer is: You can't do what you're trying to do. Instead, take a step
back, and look at just getting your Python program to run on all
platforms... and that's easy, just distribute the .py files. Much MUCH
easier, more reliable, and simpler.

ChrisA

12