I am trying to convert a python script to an executable file.
I have tried cxFreeze and py2exe, but both told me that Python27 are not in the registry. I found several other questions that tell me to go to regedit and find the python folder, but it is not there. I tried going to HKEY_CURRENT_USER/Software and Python27 was not there.
Do I need to add it there to run the installer for cxFreeze or py2exe or is there another way?
Tools like PyInstaller package python scripts with the python run-time interpreter into standalone Windows applications. Installation of python (2.7.x) and all required python libraries is a prerequisite.
My suggestion is to install the latest Python 2.7 from this location: https://www.python.org/downloads/release/python-2710/. Make sure to choose the correct architecture, apparently 32-bit is the easiest to get working.
I fixed the issue. Apparently I accidentally installed 32-bit Python on a 64-bit machine. So I have to use the 32-bit installer because it installs the registry key in a different place. Thanks for the help anyways.
Related
I was trying to create Python executables on Windows 10 Pro (latest) so was upgrading to the latest packages but it's changed.
I've just gotten rid of Python 3.6 and reinstalled Python 3.9. I then went and installed PythonWin for it using the following (there no longer seems to be what was a standard install package):
**pip install pywin32**
Python is on the start menu but, unlike earlier installs, the new way of installing PythonWin this doesn't seem to give me any kind of way to run the program. Surely it should create some kind of shortcut on the start menu?
Any advice on this would be most helpful.
James
SOLVED!
While I still have no idea why a Start Menu shortcut wasn't installed, I have found the executable that runs PythonWin.
It was located in the following folder:
"C:\Users<MyUserID>\AppData\Local\Programs\Python\Python39\Lib\site-packages\pythonwin"
Thanks :)
It is stated in Python documentation here that:
By default, the libraries are searched in prefix/lib/pythonversion and exec_prefix/lib/pythonversion, where prefix and exec_prefix are installation-dependent directories, both defaulting to /usr/local.
But when I looked into my /usr/local directory, what I found was a folder named python2.7. I did install python3.5 not python2.7 on my device (MacBook mid 2012).
You could use sys module to find that.
import sys
print sys.path
Ouput like:
['', '/usr/local/lib/python2.7/dist-packages/mccabe-0.3.1-py2.7.egg', ...
Mac comes with a default Python 2.7 installation. Your installation did not remove python2.7. Probably also the reason why the system libraries are not under usr/local.
You never state how you attempted to install Python 3.5 onto your MacBook, depending on the installation options you used while building the Python source (or the bundle you downloaded) the install location could be different from the defaults. If you provide further details on your installation method, it will be easier to answer all aspects of your question.
As far as I can tell, Apple does not use the installation defaults to provide Python with OSX. On my OSX El Capitan machine, I can see the system Python library at /System/Library/Frameworks/Python.framework/Versions/2.7 and the binary at /usr/bin/python (Python 2.7.x comes preinstalled for all recent versions of OSX).
It looks like the easiest way to get Python 3.5 on Mac is to use MacPython which will install alongside the system version of Python (as you should not alter the default system version of Python or risk breaking OSX). It installs some helper applications into your Finder's Applications directory and installs the library files to /System/Library/Frameworks/Python.framework/Versions/3.5. Since you will have more then one version of Python installed, you would also need to put some effort into making sure your scripts are using the proper version.
If you have a /usr/local/python2.7 directory, that sounds like something that was previously installed by a user. If I remember correctly, OSX does not normally use /usr/local for system software.
Hope that helps
I'm new to stack overflow. I was wondering if anybody knew if there was a .msi package for a python interpreter for python 3.5, I'm teaching a basic python class and wanted to be prepared for when it starts in a few weeks. There is a .msi packaged interpreter for 2.7 python on the official python.org downloads page but not 3.5 it seems. I am trying to use the interpreter in the community PyCharm IDE because I'm assuming most of the students will be using windows, not Linux (like I'm using). Any help would be greatly appreciated. Thank you in advance.
After Python 3.4.4 was released python.org stopped providing MSI installers for their Windows releases. Web-based, exectuable, and zipped installers are now provided for both 32-bit and 64-bit Windows releases. I'm not sure what the reason for this switch was, but an exectuable will install Python just fine. You can find Python 3.5.2 Windows executable installer at the bottom of this page.
All Python installs come with a Python interpreter. Make sure you select to add Python to your PATH during the install process. After Python finishes installing, open a Command Prompt, and type python to access the Python interpreter.
I'm running Windows 7 and I currently have python 3.3 installed on my system. I need to install the python 2.7 interpreter so that I can work with some outdated code, and I don't want to uninstall Python 3.3. Does anyone know how to do this without reinstalling IDLE and duplicating the system files that python33 and python27 have in common? Thanks.
As both the python versions are installed in different folders, so you need not worry about it.
You can use set "PYTHONPATH=%PYTHONPATH%;C:\My_python_lib" command in windows to temporary change the default python version to use.
While working on the projects requiring different python, you can use virtual environment approach. The following link will help you on this topic: http://docs.python-guide.org/en/latest/dev/virtualenvs/
This is widely used concept by python developers.
just install them in different folders.
When you install python 2.7 , it will be automatically be installed in a different folder just go into that folder and run python idle from there.
Im trying to install kivy in my portable python with this installer:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#kivy
(Its a pre-compiled version of kivy)
When executing the file, it says "Python 2.7 version required", but since the python version im using is portable, I guess this is normal.
So my question is, is there a workarround to install a precompiled package in portable python? By somehow registering the portable python installation?
More (maybe innecesary) information:
My guess would be registering portable python in the system (Windows 7
64), but I already tried by changing the "path" enviroiment variable to point all
the required python paths without success.
I cant use the kivy modules to install it by compiling it on my computer because its too hard for me,(cython wont work, or then another of the 7 different modules will give me problems, untill i destroy my python installation. I already destroyed my
previous python installation while doing so, and had to reinstall
windows to get python working again -_-
Thats why I want to migrate
into portable python, but if this is not possible I will just go back
to normal python and install kivy on it...
The Kivy package on windows includes a portable python installation with Kivy installed.
Double click on the kivy.bat.
You will have a console have easy_install and pip available. Compiler is set to Mingw, and cython is already installed. Everything will be installed in the portable installation, not your system installation.
Enjoy :)
Note: if you want to see how we do, just edit the kivy.bat.