Giter Site home page Giter Site logo

Comments (6)

kraigb avatar kraigb commented on May 21, 2024 1

Thanks for the report. I'll look into it when I have a chance (but that might be a little while given a relatively short time I have before the holidays).

from python-sample-vs-cpp-extension.

kraigb avatar kraigb commented on May 21, 2024 1

Having (finally) reviewed this all, I see that Py_LIMITED_API shouldn't be included when using PyBind11. This is correct in the sample: the superfastcode2 project, which is oriented around PyBind11, doesn't include that preprocessor definition (the superfastcode project using CPython, does).

Clearly, then, the only fix needed here is to clarify the documentation to use Py_LIMITED_API with only CPython.

Thanks for pointing it out!

from python-sample-vs-cpp-extension.

Mjang714 avatar Mjang714 commented on May 21, 2024

Thanks. I wanted to give you a quick update. I tried building the package with the python setup script in your example, and ran the script to create the python module and it worked fine with python 3.7. I am beginning to think that this specific issue with the way visual studio is set up on my PC. I am using the community edition is there any additional setup that I may be missing?

from python-sample-vs-cpp-extension.

kraigb avatar kraigb commented on May 21, 2024

I'm not sure...I've been using the Community edition as well. Offhand, I'm thinking that it's perhaps a mismatch of the selected interpreter for the project in VS.

You said you built successfully on the command line, yes? If you just run "python --version", that reports 3.7, correct? And what's the output from "where python.exe"? (To see which installation you're running.)

In VS, then, in Solution Explorer, expand the "CppAndPython" project, then expand "Python Environments". What environment is shown there? If it doesn't match the Python 3.7 that you successfully built with, right-click Python Environments, select "Add/Remove Python Environments", and set the box for the same 3.7 interpreter. Then try the build again. (The Python Environments window, which is a peer to Solution Explorer, is where you can look at the details of each of the interpreters.)

from python-sample-vs-cpp-extension.

Mjang714 avatar Mjang714 commented on May 21, 2024

when running "python --version" I did indeed get Python 3.7.1. When running the python command from the terminal I get
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

I did however figure out what the issue was though. The Preprocessor Py_LIMITED_API; prevented the macro for Py_Buffer from being defined, and also prevented python version retrieval I guess. I am not sure why this would be a problem from 2.7.11 to 3.X. I think the authors of Python 3.X choose to deprecate some of the functionalities of Py_LIMITED_API for some reason, again I am not certain why. Have anyone else ever run into an issue with Py_LIMITED_API being defined in the Preprocessors? Thanks again for all your help!!! HAPPY HOLIDAYS!!!!

from python-sample-vs-cpp-extension.

Mjang714 avatar Mjang714 commented on May 21, 2024

Thanks!!!!

from python-sample-vs-cpp-extension.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.