Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22001

pip install regex Fails to build on Anaconda python3.6.9 virtualenv

$
0
0

I'm using anaconda 64bits on a manjaro distribution. I created a python3.6 enviroment using conda create -n tensorflow python=3.6 anaconda.

I also installed pip install tensorflow-gpu==1.12 and conda install cudnnif that matters.

On my original python 3.7 outside of anaconda (/usr/bin/python3) it installs fine, but when I enter the virtualenv by conda activate tensorflow, and try to install by pip install regex==2017.4.5 it yelds an error.

Other versions of the package seem to be getting the same error, it is not version specific.

See the error message below:

Installing collected packages: regex                                                                                                                                                  [25/1582]
  Running setup.py install for regex ... error
    ERROR: Command errored out with exit status 1:
     command: /opt/anaconda/anaconda3/envs/tensorflow/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jcrdpn4y/regex/setup.py'"'"'; __file__='"'"'/tmp$
pip-install-jcrdpn4y/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'e$
ec'"'"'))' install --record /tmp/pip-record-if4z1bod/install-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-jcrdpn4y/regex/
    Complete output (56 lines):
    /opt/anaconda/anaconda3/envs/tensorflow/lib/python3.6/site-packages/setuptools/dist.py:472: UserWarning: Normalizing '2017.04.05' to '2017.4.5'
      normalized_version,
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    copying Python3/regex.py -> build/lib.linux-x86_64-3.6
    copying Python3/_regex_core.py -> build/lib.linux-x86_64-3.6
    copying Python3/test_regex.py -> build/lib.linux-x86_64-3.6
    running build_ext
    building '_regex' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/Python3
    gcc -pthread -B /opt/anaconda/anaconda3/envs/tensorflow/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/anaconda/anaconda3/e$
vs/tensorflow/include/python3.6m -c Python3/_regex.c -o build/temp.linux-x86_64-3.6/Python3/_regex.o
    Python3/_regex.c: In function ‘do_best_fuzzy_match’:
    Python3/_regex.c:16731:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
    16731 |             for (i = 0; i < best_list.count; i++) {
          |                           ^
    Python3/_regex.c:16765:77: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
    16765 |                             if (state->total_errors < error_limit || i == 0 &&
          |                                                                      ~~~~~~~^~
    16766 |                               offset == 0)
          |                               ~~~~~~~~~~~
    Python3/_regex.c: In function ‘do_match’:
    Python3/_regex.c:16624:9: warning: ‘status’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    16624 |     int status;
          |         ^~~~~~
    Python3/_regex.c:16776:32: warning: ‘better’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    16776 |                             if (better) {
          |                                ^
    Python3/_regex.c:16763:34: note: ‘better’ was declared here
    16763 |                             BOOL better;
          |                                  ^~~~~~
    Python3/_regex.c:16772:76: warning: ‘best_match_pos’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    16772 |                                 better = state->reverse ? state->match_pos >
          |                                                           ~~~~~~~~~~~~~~~~~^
    16773 |                                   best_match_pos : state->match_pos <
          |                                   ~~~~~~~~~~~~~~
    Python3/_regex.c:16717:24: note: ‘best_match_pos’ was declared here
    16717 |             Py_ssize_t best_match_pos;
          |                        ^~~~~~~~~~~~~~
    Python3/_regex.c: In function ‘pattern_subx’:
    Python3/_regex.c:20715:20: warning: ‘kwargs’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    20715 |             item = PyObject_Call(replacement, args, kwargs);
          |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Python3/_regex.c:20715:20: warning: ‘args’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    gcc -pthread -B /opt/anaconda/anaconda3/envs/tensorflow/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/anaconda/anaconda3/en
vs/tensorflow/include/python3.6m -c Python3/_regex_unicode.c -o build/temp.linux-x86_64-3.6/Python3/_regex_unicode.o
    gcc -pthread -shared -B /opt/anaconda/anaconda3/envs/tensorflow/compiler_compat -L/opt/anaconda/anaconda3/envs/tensorflow/lib -Wl,-rpath=/opt/anaconda/anaconda3/envs/tensorflow/lib -Wl,--
no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/Python3/_regex.o build/temp.linux-x86_64-3.6/Python3/_regex_unicode.o -o build/lib.linux-x86_64-3.6/_regex.cpython-36m-x86_64-linux-gn
u.so
    /opt/anaconda/anaconda3/envs/tensorflow/compiler_compat/ld: build/temp.linux-x86_64-3.6/Python3/_regex.o: unable to initialize decompress status for section .debug_info
    /opt/anaconda/anaconda3/envs/tensorflow/compiler_compat/ld: build/temp.linux-x86_64-3.6/Python3/_regex.o: unable to initialize decompress status for section .debug_info
    /opt/anaconda/anaconda3/envs/tensorflow/compiler_compat/ld: build/temp.linux-x86_64-3.6/Python3/_regex.o: unable to initialize decompress status for section .debug_info
    /opt/anaconda/anaconda3/envs/tensorflow/compiler_compat/ld: build/temp.linux-x86_64-3.6/Python3/_regex.o: unable to initialize decompress status for section .debug_info
    build/temp.linux-x86_64-3.6/Python3/_regex.o: file not recognized: file format not recognized
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/anaconda/anaconda3/envs/tensorflow/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jcrdpn4y/regex/s
etup.py'"'"'; __file__='"'"'/tmp/pip-install-jcrdpn4y/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exe
c(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-if4z1bod/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Some things I noticed above:

  • Upon building, the error message pointed out file not recognized: file format not recognized

  • Something called "ld" exited a fail status on the building process collect2: error: ld returned 1 exit status. I suppose this is just to signify that something went wrong while builind on /run/ or /usr/temp, but it may be helpful.

I don't actually believe it's a problem with gcc, since other packages install fine.

I also don't believe it to be an error of system-wide dependencies, because outside of the virtualenv everything works fine.

And please keep in mind: I am using a manjaro, arch distributions don't have -dev or -devel packages (e.g. python-devel) to install separatelly. Normally those come included with the original package (i.e. python or python3).

Thanks for any help :).


Viewing all articles
Browse latest Browse all 22001

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>