Closed cubayang closed 5 years ago
Hello Yang,
I can't reproduce the error on my mac, but doing some poking around on the interwebs it looks like this error may be caused by a Python version mismatch. It's likely that the setup.py being used when you compile is from your system Python that ships with mac, which is typically 2.x. Then you try to load this library with ipython, which starts from the 3.x Anaconda Python installation (because the system python does not include ipython) and an error is thrown. If this is in fact the case, the reason I could not reproduce the error is because I have appended my Anaconda directory to my path in my terminal bash profile, so when I type "python" into a terminal it looks there first instead of in the system python directory.
Try running python3 setup.py build_ext --inplace
instead and let me know if it works.
Hi Christopher,
Thanks a lot for your reply.
I tried running with python3 setup.py build_ext --inplace, it is still not working. As you have mentioned, I might have some setup issue of my anaconda, I will try to fix and see if it works.
I'm going to close this for now since I can't reproduce it. It could be that the system python is also 3.x, in which case you may need to explicitly specify the path to the Anaconda executable or prefix your bash path so you don't have to specify every time you are working in a terminal.
Hi Nick,
I am trying to generate shared library to use the C write method on Mac OS using:
python setup.py build_ext —-inplace
A write.so file can be generated, however, when I tried to import write in ipython, an error occurs:
I tried to find a solution online, but it seems a bit complicated. Have you ever met this problem before?
Thanks in advance, Yang