3

How do I change the gcc version of python used within anaconda or a virtual environment? Right now when I start python it shows:

[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] 

on linux2 This is the same as the system-wide gcc in /usr/bin/ However, I want it to use the version /etc/scl/prefixes/devtoolset-2: which is gcc 4.8

Many thanks.

  • What does `which python` say? And `which gcc`? – John Zwinck Jul 14 '17 at 10:59
  • 1) You should use the same gcc version your glibc and other libraries have been built with. 2) `/etc` is definitively the wrong place to install external files, expecially binaries! That's what `/opt`, resp. `/user/local` are for. – too honest for this site Jul 14 '17 at 11:16

1 Answers1

6

Python shows you the compiler and version that was used to build python, it doesn't use this at runtime. The version of GCC used to build python doesn't matter itself.

Vibhutha Kumarage
  • 1,372
  • 13
  • 26
  • 2
    Why is this downvoted? It's the correct answer, just the wording could be better. –  Jul 14 '17 at 11:16