Compiling Python 3.6.9 on Windows - python

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.

Related

How to link already installed python to MSYS2

I already have python 2.7 and 3.7 installed on my computer. I just don't want to re-download python using pacman.
Is there a way to link python with MSYS2?
Thanks in advance.
If you want to use Python in MSYS2, you need to use the one bundled with pacman. Mingw-64 compiles Python using GCC for Windows and it is heavily patched downstream so that it will run. You can't use the normal Windows Python that is compiled against Microsoft Visual C, it isn't compatible.

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 !

Cannot find python 3.5.x interpreter using .msi extension

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.

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.

How to install python 2.6.8 on windows 7?

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.

Categories

Resources