-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Cannot install pandas correctly due to unreachable code #32882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@cleconte987 Thank you for the report! As a quick-fix I would have remove the Line 436 in aee8e11
from: extra_compile_args = ["-Werror"] to: extra_compile_args = [] |
@WillAyd Is it a good idea to have something like: if is_platform_windows():
extra_compile_args = []
...
elif is_platform_macos():
extra_compile_args = []
...
else:
extra_compile_args = ["-Werror"]
... in |
I don’t think we need to do that. clang / gcc mostly have the same flags, and if anything checking in clang is a little looser
Can you post the full traceback (not a screenshot)?
On Mar 21, 2020, at 11:23 AM, MomIsBestFriend ***@***.***> wrote:
@WillAyd <https://github.com/WillAyd> Is it a good idea to have something like:
if is_platform_windows():
extra_compile_args = []
...
elif is_platform_macos():
extra_compile_args = []
...
else:
extra_compile_args = ["-Werror"]
...
in setup.py?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#32882 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAEU4UMFPAWPFKYTLCJR6JDRIUA2NANCNFSM4LQ4J44Q>.
William Ayd
[email protected]
|
Here are the whole logs: running build_ext |
Ok I will try! |
@cleconte987 can you post the output of pd.show_versions()? |
Actually the full full logs the first time I did it are these ones: Compiling pandas/_libs/algos.pyx because it changed. Notice the warning: Unreachable code for pandas/_libs/groupby.pyx pandas is not installed yet so I cannot do pd.show_versions(). Or pandas is installed but I cannot import it from source as C extensions are not built: ImportError: C extension: No module named 'pandas._libs.tslibs.conversion' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first. |
Good point. Can you share your Cython Version and C compiler? Also can you attach the parsers.c file where the warning cones from?
…Sent from my iPhone
On Mar 21, 2020, at 4:29 PM, cleconte987 ***@***.***> wrote:
Actually the full full logs the first time I did it are these ones:
Compiling pandas/_libs/algos.pyx because it changed.
Compiling pandas/_libs/groupby.pyx because it changed.
Compiling pandas/_libs/hashing.pyx because it changed.
Compiling pandas/_libs/hashtable.pyx because it changed.
Compiling pandas/_libs/index.pyx because it changed.
Compiling pandas/_libs/indexing.pyx because it changed.
Compiling pandas/_libs/internals.pyx because it changed.
Compiling pandas/_libs/interval.pyx because it changed.
Compiling pandas/_libs/join.pyx because it changed.
Compiling pandas/_libs/lib.pyx because it changed.
Compiling pandas/_libs/missing.pyx because it changed.
Compiling pandas/_libs/parsers.pyx because it changed.
Compiling pandas/_libs/reduction.pyx because it changed.
Compiling pandas/_libs/ops.pyx because it changed.
Compiling pandas/_libs/ops_dispatch.pyx because it changed.
Compiling pandas/_libs/properties.pyx because it changed.
Compiling pandas/_libs/reshape.pyx because it changed.
Compiling pandas/_libs/sparse.pyx because it changed.
Compiling pandas/_libs/tslib.pyx because it changed.
Compiling pandas/_libs/tslibs/c_timestamp.pyx because it changed.
Compiling pandas/_libs/tslibs/ccalendar.pyx because it changed.
Compiling pandas/_libs/tslibs/conversion.pyx because it changed.
Compiling pandas/_libs/tslibs/fields.pyx because it changed.
Compiling pandas/_libs/tslibs/frequencies.pyx because it changed.
Compiling pandas/_libs/tslibs/nattype.pyx because it changed.
Compiling pandas/_libs/tslibs/np_datetime.pyx because it changed.
Compiling pandas/_libs/tslibs/offsets.pyx because it changed.
Compiling pandas/_libs/tslibs/parsing.pyx because it changed.
Compiling pandas/_libs/tslibs/period.pyx because it changed.
Compiling pandas/_libs/tslibs/resolution.pyx because it changed.
Compiling pandas/_libs/tslibs/strptime.pyx because it changed.
Compiling pandas/_libs/tslibs/timedeltas.pyx because it changed.
Compiling pandas/_libs/tslibs/timestamps.pyx because it changed.
Compiling pandas/_libs/tslibs/timezones.pyx because it changed.
Compiling pandas/_libs/tslibs/tzconversion.pyx because it changed.
Compiling pandas/_libs/testing.pyx because it changed.
Compiling pandas/_libs/window/aggregations.pyx because it changed.
Compiling pandas/_libs/window/indexers.pyx because it changed.
Compiling pandas/_libs/writers.pyx because it changed.
Compiling pandas/io/sas/sas.pyx because it changed.
[ 1/40] Cythonizing pandas/_libs/algos.pyx
[ 2/40] Cythonizing pandas/_libs/groupby.pyx
warning: pandas/_libs/groupby.pyx:1097:26: Unreachable code
[ 3/40] Cythonizing pandas/_libs/hashing.pyx
[ 4/40] Cythonizing pandas/_libs/hashtable.pyx
[ 5/40] Cythonizing pandas/_libs/index.pyx
[ 6/40] Cythonizing pandas/_libs/indexing.pyx
[ 7/40] Cythonizing pandas/_libs/internals.pyx
[ 8/40] Cythonizing pandas/_libs/interval.pyx
[ 9/40] Cythonizing pandas/_libs/join.pyx
[10/40] Cythonizing pandas/_libs/lib.pyx
[11/40] Cythonizing pandas/_libs/missing.pyx
[12/40] Cythonizing pandas/_libs/ops.pyx
[13/40] Cythonizing pandas/_libs/ops_dispatch.pyx
[14/40] Cythonizing pandas/_libs/parsers.pyx
[15/40] Cythonizing pandas/_libs/properties.pyx
[16/40] Cythonizing pandas/_libs/reduction.pyx
[17/40] Cythonizing pandas/_libs/reshape.pyx
[18/40] Cythonizing pandas/_libs/sparse.pyx
[19/40] Cythonizing pandas/_libs/testing.pyx
[20/40] Cythonizing pandas/_libs/tslib.pyx
[21/40] Cythonizing pandas/_libs/tslibs/c_timestamp.pyx
[22/40] Cythonizing pandas/_libs/tslibs/ccalendar.pyx
[23/40] Cythonizing pandas/_libs/tslibs/conversion.pyx
warning: pandas/_libs/tslibs/conversion.pyx:598:53: Buffer unpacking not optimized away.
warning: pandas/_libs/tslibs/conversion.pyx:598:53: Buffer unpacking not optimized away.
[24/40] Cythonizing pandas/_libs/tslibs/fields.pyx
[25/40] Cythonizing pandas/_libs/tslibs/frequencies.pyx
[26/40] Cythonizing pandas/_libs/tslibs/nattype.pyx
[27/40] Cythonizing pandas/_libs/tslibs/np_datetime.pyx
[28/40] Cythonizing pandas/_libs/tslibs/offsets.pyx
[29/40] Cythonizing pandas/_libs/tslibs/parsing.pyx
[30/40] Cythonizing pandas/_libs/tslibs/period.pyx
[31/40] Cythonizing pandas/_libs/tslibs/resolution.pyx
[32/40] Cythonizing pandas/_libs/tslibs/strptime.pyx
[33/40] Cythonizing pandas/_libs/tslibs/timedeltas.pyx
[34/40] Cythonizing pandas/_libs/tslibs/timestamps.pyx
[35/40] Cythonizing pandas/_libs/tslibs/timezones.pyx
[36/40] Cythonizing pandas/_libs/tslibs/tzconversion.pyx
[37/40] Cythonizing pandas/_libs/window/aggregations.pyx
[38/40] Cythonizing pandas/_libs/window/indexers.pyx
[39/40] Cythonizing pandas/_libs/writers.pyx
[40/40] Cythonizing pandas/io/sas/sas.pyx
running build_ext
building 'pandas._libs.algos' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/pandas
creating build/temp.macosx-10.9-x86_64-3.6/pandas/_libs
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs -Ipandas/_libs/src/klib -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/algos.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/algos.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/algos.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/algos.cpython-36m-darwin.so
building 'pandas._libs.groupby' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/groupby.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/groupby.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/groupby.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/groupby.cpython-36m-darwin.so
building 'pandas._libs.hashing' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/hashing.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/hashing.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/hashing.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/hashing.cpython-36m-darwin.so
building 'pandas._libs.hashtable' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs -Ipandas/_libs/src/klib -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/hashtable.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/hashtable.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/hashtable.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/hashtable.cpython-36m-darwin.so
building 'pandas._libs.index' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs -Ipandas/_libs/src/klib -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/index.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/index.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/index.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/index.cpython-36m-darwin.so
building 'pandas._libs.indexing' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/indexing.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/indexing.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/indexing.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/indexing.cpython-36m-darwin.so
building 'pandas._libs.internals' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/internals.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/internals.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/internals.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/internals.cpython-36m-darwin.so
building 'pandas._libs.interval' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs -Ipandas/_libs/src/klib -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/interval.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/interval.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/interval.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/interval.cpython-36m-darwin.so
building 'pandas._libs.join' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -Ipandas/_libs/src/klib -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/join.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/join.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/join.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/join.cpython-36m-darwin.so
building 'pandas._libs.lib' extension
creating build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/src
creating build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/src/parser
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -Ipandas/_libs -I./pandas/_libs/tslibs -I./pandas/_libs -Ipandas/_libs/src/klib -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/lib.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/lib.o -Werror
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -Ipandas/_libs -I./pandas/_libs/tslibs -I./pandas/_libs -Ipandas/_libs/src/klib -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/src/parser/tokenizer.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/src/parser/tokenizer.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/lib.o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/src/parser/tokenizer.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/lib.cpython-36m-darwin.so
building 'pandas._libs.missing' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs/tslibs -I./pandas/_libs -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/missing.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/missing.o -Werror
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/missing.o -o /Users/clement/Desktop/Contributing_to_pandas/pandas/_libs/missing.cpython-36m-darwin.so
building 'pandas._libs.parsers' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs -Ipandas/_libs/src/klib -Ipandas/_libs/src -I/Users/clement/Desktop/Contributing_to_pandas/lib/python3.6/site-packages/numpy/core/include -I/Users/clement/Desktop/Contributing_to_pandas/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pandas/_libs/parsers.c -o build/temp.macosx-10.9-x86_64-3.6/pandas/_libs/parsers.o -Werror
pandas/_libs/parsers.c:50827:52: error: code will never be executed [-Werror,-Wunreachable-code]
} else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
^~~~
pandas/_libs/parsers.c:50827:38: note: silence by adding parentheses to mark code as explicitly dead
} else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
^
/* DISABLES CODE */ ( )
1 error generated.
error: command 'gcc' failed with exit status 1
Notice the warning: Unreachable code for pandas/_libs/groupby.pyx
pandas is not installed yet so I cannot do pd.show_versions()
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Yes the Cython version is 0.29.15 Here is a snippet containing line 50827:
|
In #34280 I solved a similar error by re-installing the C-compiler and then running
Maybe that works here too? |
I used the turn-around proposed by @MomIsBestFriend to build pandas. |
I just ran into this with Clang 10 on CentOS 7.
|
Same error on Termux (Android Linux simulator). |
Since this is an older version being built that we no longer support, closing. But can reopen if something similar is found in the future |
After running python setup.py build_ext --inplace -j 0:
MacOS 10.14
python 3.6.6
I tried to install pandas from source in a setup virtual environment using pip.
I cloned the repository, created the virtual environment with python -m venv.
I ran pip install -r requirements-dev.txt
Had a few problems with versions of dependencies being too recent and not satisfying requirements, but I manually downgraded them.
And when I ran the above "python setup.py build_ext --inplace -j 0" I got the issue mentioned.
Thanks for your help
The text was updated successfully, but these errors were encountered: