-
Notifications
You must be signed in to change notification settings - Fork 140
could not determine kind of name for C.PyDict_ClearFreeList #38
Comments
@jaunruh are you maybe using Python 3.9? (The C.PyDict_ClearFreeList function has been removed from the Python C API with Python 3.9). As the README states, It should be possible to install Python 3.7 on macOS (installer from python.org) in parallel to other Python versions. The pkg-config file can be found in |
Any quick fix for this if using Python3.9? Thanks. |
As a dirty quick fix I think you can just uncomment the functions that have been removed since Python 3.7. I've done this for Python 3.8 here for my own use. Some more have to be removed for Python 3.9 (as per the py 3.9 release notes). I think this calls for a PR, the maintainer has signaled here that it would get accepted. (However, I don't think it would a good idea to introduce breaking changes for Py 3.7 users. I guess there would need to be a switch for different Py versions, which I haven't looked into yet as I didn't need it). |
No I am aware that Maybe go uses 3.9 for installation purposes? Because I still get the entire setup to work flawlessly. Just the installation process gives the error above. |
It sounds a bit like you might have a dirty cache. When I try on MacOS with go 1.15.6 (and clean go caches) and install with pointing to Python 3.9 I get the same error as you:
To fix this, I need to clean the caches: The main one is:
but it also doesn't hurt to
And reinstall with pointing to the correct Python version (3.7), works now without error message:
Hope this helps? |
Yes, this instruction worked! |
i have this issue:
|
@ozhuravel-prx could it be that you‘re on an M1 (arm64) Mac and try to go build an arm64 executable but your Python installation is actually amd64? Does it work if you build with something like |
yes, i'm m1 user. I have tried to execute your command, and this is what i got:
|
The error reads like you’re still building for GOARCH=arm64. Can you double check that the env var is set correctly to match the architecture of your Python binaries? |
Could you help me with this? How I can check and set env variables to match amd64 python binaries? |
ah sorry, crosscompile with cgo might not work. Can you try to install/use the amd64 golang binaries? (instead of the arm64 ones) |
this helped, thank you. is there any way to run python 3.8 with |
I had success running go-python3 with Python 3.8 on Win, Mac (only tried amd64), Linux after having removed the binding for the PyEval_ReInitThreads function, which has been removed from the Python C API starting with Python 3.8. I have done this for my own use here. (This fork works with exactly Python 3.8. More changes like this would need to be done for Python 3.9 and newer). |
I have the same problem. Have you solved it? |
I think a quick solution was to use the Golang |
Describe what happened:
When using
go get github.com/DataDog/go-python3
I get the response:But the package seems to work fine nevertheless.
Describe what you expected:
Probably no such error message?
Steps to reproduce the issue:
Simply using
go get ...
Note: I use a M1 MacBook
The text was updated successfully, but these errors were encountered: