compilation

Microsoft Visual C++ Compiler for Python 3.4

Microsoft Visual C++ Compiler for Python 3.4 Question: I know that there is a “Microsoft Visual C++ Compiler for Python 2.7” but is there, currently or planned, a Microsoft Visual C++ Compiler for Python 3.4 or eve Microsoft Visual C++ Compiler for Python 3.x for that matter? It would be supremely beneficial if I didn’t …

Total answers: 3

Compiling Python 3.4 is not copying pip

Compiling Python 3.4 is not copying pip Question: I have compiled Python 3.4 from the sources on Linux Mint, but for some reason it is not copying pip to its final compiled folder (after the make install). Any ideas? Asked By: Rui Lima || Source Answers: According to PEP 453 — Explicit bootstraping of pip …

Total answers: 3

Cython setup.py for several .pyx

Cython setup.py for several .pyx Question: I would like to cythonize faster. Code for one .pyx is from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize(“MyFile.pyx”) ) What if i want to cythonize several files with ext .pyx, that i will call by their name all .pyx files in a folder What …

Total answers: 2

Checking for __debug__ and some other condition in Python

Checking for __debug__ and some other condition in Python Question: In Python sometimes I want to do something like (1) if __debug__ and verbose: print “whatever” If Python is run with -O, then I’d like for that whole piece of code to disappear, as it would if I just had (2) if __debug__: print “whatever” …

Total answers: 2

Issue compiling using py2exe on Windows 7 x64

Issue compiling using py2exe on Windows 7 x64 Question: I am using py2exe to compile my script into an exe file to run on Windows, but I am hitting errors based on my OS, which is Window 7 x64. I am running the below script in cmd using execmaker.py py2exe: from distutils.core import setup import …

Total answers: 5

Create a single executable from a Python project

Create a single executable from a Python project Question: I want to create a single executable from my Python project. A user should be able to download and run it without needing Python installed. If I were just distributing a package, I could use pip, wheel, and PyPI to build and distribute it, but this …

Total answers: 3

Compiling Python modules on Windows x64

Compiling Python modules on Windows x64 Question: I’m starting out some projects in words processing and I needed NumPy and NLTK. That was the first time I got to know easy_install and how to compile new module of python into the system. I have Python 2.7 x64 plus VS 11 and VS 12. Also Cygwin …

Total answers: 6

How to get the list of options that Python was compiled with?

How to get the list of options that Python was compiled with? Question: You can compile Python in various ways. I’d like to find out with which options my Python was compiled. Concrete use-case: was my Python compiled with readline? I know I can see this by doing “import readline”, but I’d like to see …

Total answers: 5

Is there a way to know by which Python version the .pyc file was compiled?

Is there a way to know by which Python version the .pyc file was compiled? Question: Is there any way to know by which Python version the .pyc file was compiled? Asked By: Aamir Rind || Source Answers: The first two bytes of the .pyc file are the magic number that tells the version of …

Total answers: 6

How to compile .c code from Cython with gcc

How to compile .c code from Cython with gcc Question: Now that I’ve successfully installed Cython on Windows 7, I try to compile some Cython code using Cython, but gcc makes my life hard. cdef void say_hello(name): print “Hello %s” % name Using gcc to compile the code throws dozens of undefined reference to -erros, …

Total answers: 2