I've created a script using selenium and chromedriver on pycharm that works absolutely fine. I want to create an exe of that script so that I can run it on other PCs without installing python or the other dependencies. I've tried using pyinstaller but it is not working. Can someone guide me how can I convert that script into exe.
Thanks!!!
You are getting any error ? as pyinstaller is the best option to turn your script in to executables.
Related
I wrote a python program that uses the library tkVideoPlayer (and others). The python script runs fine without any errors but when I use pyinstaller to convert it into an exe, the exe doesn't run at all and I get the following error. (see image)
Things I have tried already:
Locating the file and moving it to the folder my exe is in.
Using a star import for the library
Using the --hidden option when creating the exe and specifying av/av.libs
Issue occurred due to me using Anaconda 3 (Sypder). It was using a virtual Environment and pyinstaller failed to locate the library correctly.
Solution: Installed python 3 directly onto windows, then installed pyinstaller and and all the libraries I used. Since that isn't a virtual environment it worked fine and the exe ran perfectly.
I wrote a python script that uses an external .exe file for running commands, and I want to pack both .exe and .py files into one .exe file using pyinstaller
At the moment I don't know if pyinstaller supports this? I will be happy to hear if there are alternative ways.
Thanks in advance
I found how to do it, using the following command:
pyinstaller -y --add-data "C:/Users/Username/Projects/python3/foldername/someExeFile.exe";"." "C:/Users/Username/Projects/python3/foldername/somePyFile.py"
I'm new to Python, but I have set up an python script for searching some specific Values in 2 different excel sheets printing out matches (in excel).
Problem is, that our work machines are heavily locked down and without admin privileges, we can't really install anything (we can download though). Is there any version of Python that is Windows 7 compatible that will run standalone without requiring any sort of installer?
I have tried pyInstaller, but the problem is that in my script we need PANDAS.
And there is no possibility to pip install pandas to our local machines. All is blocked. ("pip install pandas" is not possible. I did the code with Anaconda)
So my question is: how can I set up a file for my coworkers, who have no permission to download pandas?
Can I set up an exe file (all use windows 7/10) in my private computer where pandas is already installed and forward it to the workers?
It should be very easy for them to use--> double click for executing the python script
Thanks in advance for any advice.
You can also use pyinstaller which personally I find the easiest to use. It can bundle executables for both Linux and Windows, but it must be run on that architecture that you wish to have executable for, i.e. if you want to have Linux executable the pyinstaller command with your code must be run on Linux OS of some kind.
More here: https://www.pyinstaller.org/
This is old so you may already have found a solution but this might help others.
Python by default is an interpreted language. This means that compiling it into an .exe file is impossible.
However, using some modules it is indeed possible to convert a .py script into a windows executable.
You can try py2exe.
py2exe is a Python Distutils extension which converts Python scripts
into executable Windows programs, able to run without requiring a
Python installation.
They have a tutorial here.
I am trying to create an exe from python script using cx_freeze
I have been able to create the build and test it successfully on win7 but whenever I try to run the exe on win xp I get the following error.
Have tried uninstalling and reinstalling cx_freeze but it wont help.
I am using python 3.4
AttributeError: function 'SetProcessDPIAware' not found
Complete error description
Got the solution.
Build the application on win xp pc.
Add the following lines to your setup file-
os.environ["TCL_LIBRARY"]=r"C:\Python34\tcl\tcl8.6"
os.environ["TCLLIBPATH"]=r"C:\Python34\tcl\tcl8.6"
os.environ["TK_LIBRARY"]=r"C:\Python34\tcl\tk8.6"
All must point to the correct tcl paths within the python setup.
In my case it was looking for tcl in some other location due to some environment variable confusion.
And build your script using cx_freeze again.
Will work like a charm.
I have wrote a simple Python script for searching files & finding the duplicates as I am currently learning Python. Nothing complicated at all. This is also my first try of using cx-freeze to build an Windows executable. I'm using Python 3.3.
I'm using the included cxfreeze script to create .exe file. So, I've typed cxfreeze search.py --target-dir dist . Everything goes OK during buildup, and I get the 'dist' folder with files in my home directory (using Lubuntu Linux). Problem is, the Lubuntu recognises the file with the name 'search' as executable, but it hasn't got an .exe extension. On the Windows platform, it is showed just as an file without an extension. So when I try to run it on Windows XP, it just won't work. Adding an .exe extension also do not help.
Do someone have a clue what am I doing wrong?
Thanks.