How to install python 2.6.8 on windows 7? - python

I have downloaded the two releases of python 2.6.8 from here http://www.python.org/getit/releases/2.6.8/ and I don't know how to install that on my Windows 7 64bit OS. Please someone help me. I searched but I can't find good tutorial.
Thanks!

2.6.8 is a source only release. Download either 2.6.6 or 2.7.3 depending on your requirements, which come with Windows installers.

If you want to install Python 2.6.8 on a Windows machine, you can do the following:
If you don't have Microsoft Visual Studio, install it: the Express edition is available here: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products
Unzip your source code to a folder (lets call it E:\Python) and open E:\Python\PCbuild\pcbuild.sln in Visual Studio.
Set your build configuration to Debug for Win32 (available under Build => Configuration Manager.
Build your solution. You should see errors, these are related to modules for which patches were released such as zlib and sqlite. Fixing those is a little outside my expertise regarding a Python Windows install but there are patches available as I've resolved some of them on my Unix builds.
In any case, there should now be a python_d.exe file in your E:\Python\PCbuild folder. This is your Python executable.

Related

How to install python on Windows without an MSI installer?

Take python 3.6.x for example. The last windows installer for python 3.6.x is 3.6.8: no more installers for 3.6x version that comes later (see https://www.python.org/downloads/windows/)
3.6.8 happens to be the last maintenance release of python3.6, I don't know if it is somehow related to not propose a package installer for windows but only sources.
Practical problem here: How should I proceed to install 3.6.12 on Windows?
Please don’t simply advice « Install 3.7 or 3.8, it is more recent ». I know that 3.6 is not the latest, but sometimes you have to stick with a particular version for support or compatibility.
Since I have to use 3.6.x, I am looking for the latest version available in this branch (currently 3.6.12) to still benefit from security patches.
This gives two path:
install 3.6.8 with MSI installer then upgrade to 3.6.12 from source,
install 3.6.12 from source.
What are the steps involved for option 1 or 2?
It is possible to create your own MSI installer from the source distributions at https://www.python.org/downloads/source/. This is what I did to install Python 3.6.12 on my Windows machine.
In each source distribution, the files at PCBuild/readme.txt and Tools/msi/README.txt provide guidance for how to build your own Python installer. If you have not built Python from source before on Windows, this may be a challenge to set up.
If you do not want to build the installer yourself, you can download unofficial installers from https://github.com/adang1345/PythonWindows. These are the installers that I built recently as part of a personal project.
After looking at this question I would suggest or advise you should download and install the latest version instead (python 3.8). it would save you some stress and the pain of having to download a higher version later on.
Thank you.

Python 3.7.3 Inadvertently Installed on Mac OS 10.15.1 - Included in Xcode Developer Tools 11.2 Now?

I decided yesterday to do a clean install of Mac OS (as in, erase my entire disk and reinstall the OS).
I am on a Macbook Air 2018. I did a clean install of Mac OS 10.15.1.
I did this clean install due my previous Python environment being very messy.
It was my hope that I could get everything reigned in and installed properly.
I've started reinstalling my old applications, and took care to make sure nothing was installed in a weird location.
However, when I started setting up VS Code, I noticed that my options for Python interpreters showed 4 options. They are as follows:
Python 2.7.16 64-bit, located in /usr/bin/python
Python 2.7.16 64-bit, located in /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python 3.7.3 64-bit, located in /user/bin/python
Python 3.7.3 64-bit, located in /Library/Developer/CommandLineTools/usr/bin/python3
In terminal, if I enter where python python3
it returns
/usr/bin/python /usr/bin/python3.
How in the world did python3 get there?
My only idea is that it now is included in the Xcode Developer Tools 11.2 package, as I did install that. I cannot find any documentation of this inclusion.
Any ideas how this got here? More importantly, how do I remove it? I want to use Homebrew for all of my installation needs. Also, why does VS Code show 4 options?
Thanks!
The command line tool to run the python 2.7 environment is at /usr/bin/python, but the framework and dependencies for it are in /System. This includes the Python.app bundle, which is just a wrapper for scripts that need to run using the Mac's UI environment.
Although these files are separate executables, it's likely that they point to the same environment.
Every MacOS has these.
Catalina does indeed also include /usr/bin/python3 by default. The first time you run it, the OS will want to download Xcode or the Command line tools to install the 'complete' python3. So these pair are also the same environment.
I don't think you can easily remove these, due to the security restrictions on system files in Catalina.
Interestingly, Big Sur still comes with python2 !

Compiling Python 3.6.9 on Windows

I am trying to install Python 3.6.9 and am having problems.
First I downloaded Python-3.6.9-tgz, then extracted it to get Python-3.6.9.tar, then extracted that to get a folder called Python-3.6.9
This has setup.py in it. So on windows 10 I opened the command prompt and navigated to that folder and typed: setup.py install. This opens up visual studio that I already have and does nothing. Please let me know if I need to do something else.
I tried to add environmental variables but nothing has worked.
First of all: You should really just download Python 3.7.4. Python 3.7 is backwards compatible with Python 3.6.
The Python 3.6.9 release is a security-only release primarily aimed at Long-term-support Linux distributions that must continue to support 3.6.x packages. As such no binary installers are provided, and Windows users are instead expected to have upgraded to 3.7 already.
If you still feel you want to compile Python 3.6.9, then the README.rst file includes installation instructions for Unix, Linux, BSD, macOS, and Cygwin, and for Windows points you to a dedicated file:
On Windows, see PCbuild/readme.txt.
which can be found online at https://github.com/python/cpython/blob/v3.6.9/PCbuild/readme.txt. The same directory holds a batch script designed to make building Python easier on Windows. From the above documentation:
Building Python using the build.bat script
In this directory you can find build.bat, a script designed to make
building Python on Windows simpler. This script will use the env.bat
script to detect one of Visual Studio 2015, 2013, 2012, or 2010, any of
which may be used to build Python, though only Visual Studio 2015 is
officially supported.
By default, build.bat will build Python in Release configuration for
the 32-bit Win32 platform. It accepts several arguments to change
this behavior, try build.bat -h to learn more.
The setup.py script is used indirectly by the build process. Don't run it yourself.

Install python modules with Visual Studio 2008 on Windows x64

I try installing python modules (this time flask-bcrypt or py-bcrypt) and I can't get it to work because compilation failed.
I learned that I needed Visual Studio 2008 (I do own 2010 Professional, but it seems thats not enough). So I downloaded the Express Edition and ran again. This time it failed with some ValueError on path which turned out to be an issue with Python being x64 but Visual Studio being 32 bit.
I then made a search and did not find a single opportunity to configure my Express Edition for x64. All tutorials assumed the Professional version.
It can't seriously be correct that I need to buy the Professional version to be able to compile this plugins without some hacking in the code, can it?
Is there any easy way to get this stuff up and running. I would be glad to see someone provide a generic solution like
Install python
Install xyz
Do this and that
So that I can finally just run the usual Unix commands like pip install abc to install a module. I got this up and running with virtualenv finally, but as soon as I need to compile I get stuck again.
The command line VS 2008 compilers are included with "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1". During on the download and installation, make sure you select the x64 compiler.
Once you have the SDK installed, Python can build extensions without a copy of Visual Studio (Express or Professional) installed. It just takes a few commands to properly configure the environment.
I've extracted the following from my notes:
rem Configure the environment for 64-bit builds.
rem Use "vcvars32.bat" for a 32-bit build.
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
rem Convince setup.py to use the SDK tools.
set MSSdk=1
set DISTUTILS_USE_SDK=1
python setup.py install should now work. I don't know if anything special needs to be done to support pip.
For Python 2.7 you can use the Microsoft Visual C++ Compiler for Python 2.7, which is able to build 64-bit binaries and is a lot smaller than the SDK: only 84 MB.

Installing PIL (Python Imaging Library) in Win7 64 bits, Python 2.6.4

I'm trying to install said library for use with Python. I tried downloading the executable installer for Windows, which runs, but says it doesn't find a Python installation. Then tried registering (http://effbot.org/zone/python-register.htm) Python, but the script says it can't register (although the keys appear in my register).
Then I tried downloading the source package: I run the setup.py build and it works, but when I run setup.py install it says the following:
running install
running build
running build_py
running build_ext
building '_imaging' extension
error: Unable to find vcvarsall.bat
What can I do?
UPDATE (May 2014): Like said by some comments and answers, PIL is currently unmantained, and the way to go now is to use Pillow (https://pypi.python.org/pypi/Pillow/, pip install pillow).
I found a working win7 binary here: Unofficial Windows Binaries for Python Extension Packages It's from Christoph Gohlke at UC Irvine. There are binaries for python 2.5, 2.6, 2.7 , 3.1 and 3.2 for both 32bit and 64 bit windows.
There are a whole lot of other compiled packages here, too.
Be sure to uninstall your old PILfirst.
If you used easy_install:
easy_install -mnX pil
And then remove the egg in python/Lib/site-packages
Be sure to remove any other failed attempts. I had moved the _image dll into Python*.*/DLLs and I had to remove it.
I've just had the same problem (with Python 2.7 and PIL for this versions, but the solution should work also for 2.6) and the way to solve it is to copy all the registry keys from:
HKEY_LOCAL_MACHINE\SOFTWARE\Python
to
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python
Worked for me
solution found at the address below so credits should go there:
http://effbot.slinkset.com/items/Adding_Python_Information_to_the_Windows_Registry
Compiling PIL on Windows x64 is apparently a bit of a pain. (Well, compiling anything on Windows is a bit of a pain in my experience. But still.) As well as PIL itself you'll need to build many dependencies. See these notes from the mailing list too.
There's an unofficial precompiled binary for x64 linked from this message, but I haven't tried it myself. Might be worth a go if you don't mind the download being from one of those slightly dodgy file-upload sites. Other than that... well, you could always give up and instead the 32-bit Python binary instead.
If you installed a win64 python, you need a win64 PIL. The official PIL download site only has win32, as far as I can tell. The win32 installer will not see your 64-bit python installation.
No amount of tinkering with permissions or redistributables will fix this. You could use the win32 python instead (the Win64 python is mutant anyhow; Microsoft decided that C 'long' should be 32 bits in their 64-bit world, so python 'ints' are only 32 bits in Win64 python).
Since sizeof(long)!=sizeof(ptr) in win64, porting C extensions can be problematic, and will not be the same as porting them to linux 64. E.g. it seems that Win64 numpy is experimental/broken whereas linux64 numpy has been fine for years. My recommendation is if you use win64, stick with win32 python. If you want 64-bit python use linux.
I think I had a similar problem in the past, with another python library. I believe that it was a windows permission issue. Try adding "Users" to your python directory, and give them full access.
Make sure you have the Visual C++ Redistributable package installed on your machine.
Just got this error msg on my 32 bit Windows - I read the FAQ here: http://pythonware.com/products/pil/faq.htm and this sort of indicates that Windows is funny. Looked again at install pg and downloaded the Windows executable for Python26 # Python Imaging Library 1.1.7 for Python 2.6 (Windows only) - and the _imaging module gets installed when you run this. Should solve problem. So you can't just do the python setup.py install routine on: Python Imaging Library 1.1.7 Source Kit (all platforms) (November 15, 2009).
I was having the same problem so I decided to download the source kit and install it according to how you posted above...
Downloaded Source Kit
Opened command prompt on that folder and typed python setup.py build
Then I typed python setup.py install
It worked perfectly!
Now, some notes: when I typed python setup.py build, I saw that Microsoft Visual Studio v9.0 C compiler was being used to build everything.
So probably it's something with your compiler not correctly configured or something...
Anyways, that worked with me so thank you!
Pillow is new version
PIL-1.1.7.win-amd64-py2.x installers are available at
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil
http://www.lfd.uci.edu/~gohlke/pythonlibs/
press contrl F
type Pillow‑2.4.0.win‑amd64‑py3.3.exe
then click and downloadd the 64 bit version
Pillow is a replacement for PIL, the Python Image Library, which provides image processing functionality and supports many file formats.
Note: use from PIL import Image instead of import Image.
PIL‑1.1.7.win‑amd64‑py2.5.exe
PIL‑1.1.7.win32‑py2.5.exe
Pillow‑2.4.0.win‑amd64‑py2.6.exe
Pillow‑2.4.0.win‑amd64‑py2.7.exe
Pillow‑2.4.0.win‑amd64‑py3.2.exe
Pillow‑2.4.0.win‑amd64‑py3.3.exe
Pillow‑2.4.0.win‑amd64‑py3.4.exe
Pillow‑2.4.0.win32‑py2.6.exe
Pillow‑2.4.0.win32‑py2.7.exe
Pillow‑2.4.0.win32‑py3.2.exe
Pillow‑2.4.0.win32‑py3.3.exe
Pillow‑2.4.0.win32‑py3.4.exe

Categories

Resources