llllllllll / c-extension-tutorial Goto Github PK
View Code? Open in Web Editor NEWHow to Write and Debug C Extension Modules
Home Page: https://llllllllll.github.io/c-extension-tutorial/
How to Write and Debug C Extension Modules
Home Page: https://llllllllll.github.io/c-extension-tutorial/
Some questions that have been bothering me about the functions described in https://docs.python.org/3/c-api/memory.html:
PyMem_RawMalloc
, PyMem_Malloc
, PyObject_Malloc
, etc.?MemoryError
if they return None
?While the answers are out there (I ended up reading the source code and some Stack Overflow posts), they are non-trivial to find.
Here is the stderr of the setup-env command, anything obvious jump out to anyone? (trying to hack around it now)
Updating Homebrew...
^[[33mWarning:^[[0m openssl is a keg-only and another version is linked to opt.
^[[33mWarning:^[[0m xz-5.2.3 already installed
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SD
Ks/MacOSX10.12.sdk/usr/include/c++/4.2.1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libpython3.6dm.a(dynamic_annotations.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libpython3.6dm.a(pymath.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libpython3.6dm.a(dynamic_annotations.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libpython3.6dm.a(pymath.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libpython3.6dm.a(dynamic_annotations.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libpython3.6dm.a(pymath.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libpython3.6dm.a(dynamic_annotations.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libpython3.6dm.a(pymath.o) has no symbols
Error: Command '['/Users/SeanH/git/c-extension-tutorial/venv/bin/python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
Hello,
I tried to set this up, but I keep getting an error where the setup-env script never creates the venv:
...
renaming build/scripts-3.6/pydoc3 to build/scripts-3.6/pydoc3.6
renaming build/scripts-3.6/idle3 to build/scripts-3.6/idle3.6
renaming build/scripts-3.6/2to3 to build/scripts-3.6/2to3-3.6
renaming build/scripts-3.6/pyvenv to build/scripts-3.6/pyvenv-3.6
~/Desktop/c_extension_tutorial/c-extension-tutorial
bash: ./submodules/cpython/python: is a directory
cp: venv/bin/python-gdb.py: No such file or directory
bash: venv/bin/activate: No such file or directory
Requirement already satisfied: ipython in /usr/local/lib/python3.5/site-packages
Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.5/site-packages (from ipython)
...
The issue is that there is a ./submodules/cpython/Python
directory (I am on MacOS X) and it seems like the python
file was never compiled, although there is a python.exe
.
Is there any idea as to how I might go about fixing this? I didn't want to rename the Python
directory lest I break something else...
I am trying to install the tutorial on a brand new Ubuntu 16.04 LTS virtual machine. I am able to clone the repository and compile Python 3.6. However, the install script fails near the end when it's trying to execute:
venv/bin/python -Im ensurepip --upgrade --default-pip
When I run the command manually, I see the problem is that the "zlib" module is missing (can't decompress data; zlib not available).
What am I doing wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.