Python pip install gcc

How to install gcc7 via python pip

When you know about this project and you want to new install gcc7 to support your project or you get trouble as ModuleNotFoundError: No module named «gcc7» or ImportError: cannot import name «gcc7» in your project, let follow this tutorial to install gcc7

Installation:

Step 1: First, ensure you installed pip in your os, to check pip has been installed on your computer

Ensure pip, setuptools, and wheel are up to date:

py -m pip install --upgrade pip setuptools wheel
python3 -m pip install --upgrade pip setuptools wheel

Optional — If you want to install

— Install virtualenv — if you installed it, please ignore

py -m pip install --user virtualenv

— Create a virtual environment

— Active the virtual environment

test_gcc7_env\Scripts\active

— Install virtualenv — if you installed it, please ignore

— Create a virtual environment

python3 -m venv test_gcc7_env

— Active the virtual environment

source test_gcc7_env/bin/active

Step 2: OK, now, let flow below content to start the installation gcc7

To install gcc7 on Windows(CMD):

To install gcc7 on Unix/macOs:

Step 3: If you want to install a specific gcc7 version, add == to the end command line

Please see the version list below table:

Step 4: Otherwise, you can install gcc7 from local archives:

Download the distribution file from gcc7-0.0.9-py2.py3-none-macosx_10_13_x86_64.whl or the specific gcc7 version in the below list of distribution

After that, install by command:

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

gcc compilation problem on pip install #37

gcc compilation problem on pip install #37

Comments

I’m struggling with the ‘pip install’ approach to getting pysteps installed on my Mac (OS Mojave 10.14.2). I’ve tried:

pip install numpy
(which was successful)
pip install git+https://github.com/pySTEPS/pysteps
after progressing some way, it fails with the following message:
:
:
creating build/temp.macosx-10.9-x86_64-3.7/pysteps/motion
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c pysteps/motion/_vet.c -o build/temp.macosx-10.9-x86_64-3.7/pysteps/motion/_vet.o -fopenmp
clang: error: unsupported option ‘-fopenmp’
error: command ‘gcc’ failed with exit status 1

Any thoughts as to why this fails?

The text was updated successfully, but these errors were encountered:

Hi Luigi, as @pulkkins said, it seems that the macOS the default compiler (clang LLVM) does not support openmp yet.

One possible solution is to use Anaconda to create the Pysteps environment and install the following packages:

conda install llvm gcc libgcc 

And then install Pysteps in that environment.

Another option is to update the compilers:

xcode-select --install export CC=clang ; export CXX=clang pip install git+https://github.com/pySTEPS/pysteps 

Thanks! I’ll give it a try and confirm success one way or another. Regards!

Reference to this Another option is to update compilers
For me the above command didn’t work but this one worked.
export CC=/usr/local/Cellar/gcc/8.2.0/bin/gcc-8

Hi @m-anand, thanks for the other solution. Did you update the compilers using homebrew? Can you share the commands that you used so they can be used as reference?
Thanks!

Hi @m-anand, thanks for the other solution. Did you update the compilers using homebrew? Can you share the commands that you used so they can be used as reference?
Thanks!

I used :
brew install gcc
export CC=/usr/local/Cellar/gcc/8.2.0/bin/gcc-8

I’ve update gcc using brew as suggested by @m-anand but it didnt work. I get slightly further than last time, but invariably:

creating build/temp.macosx-10.9-x86_64-3.7/pysteps/motion clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c pysteps/motion/_vet.c -o build/temp.macosx-10.9-x86_64-3.7/pysteps/motion/_vet.o -fopenmp clang: error: unsupported option '-fopenmp' error: command 'clang' failed with exit status 1 ---------------------------------------- 

Command «/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c «import setuptools, tokenize;file=’/private/var/folders/n_/1n0301tj0xv1nzcgmsn03qk40000gn/T/pip-req-build-mhfad__q/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))» install —record /private/var/folders/n_/1n0301tj0xv1nzcgmsn03qk40000gn/T/pip-record-j83nr5ce/install-record.txt —single-version-externally-managed —compile» failed with error code 1 in /private/var/folders/n_/1n0301tj0xv1nzcgmsn03qk40000gn/T/pip-req-build-mhfad__q/

Источник

Читайте также:  Php what does that mean
Оцените статью