Skip to content
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

issue with installing gwlf-e using pip #85

Open
amypiscopo opened this issue Feb 12, 2019 · 7 comments
Open

issue with installing gwlf-e using pip #85

amypiscopo opened this issue Feb 12, 2019 · 7 comments

Comments

@amypiscopo
Copy link

Hi there, I have tried to install gwlf-e using the command: pip install gwlf-e, but receive this error: "Attempted to compile AOT function without the compiler used by numpy.distutils present. Cannot find suitable msvc." (I do have the specified version of numba installed.) In case this is relevant, I do have Microsoft Visual Studio installed on my desktop, including "Python Tools for Visual Studio" but I am not sure specifically which packages / compilers I might need, or if this is even relevant. Could someone please advise? Thanks,
-Amy

@rajadain
Copy link
Member

Hi Amy,

Most of our development has been on Linux and macOS which comes with C / C++ compilers built-in for Python. According to this page you need to install Microsoft Visual C++ 9.0 standalone: Visual C++ Compiler for Python 2.7 (x86, x64) to have the C++ compiler for Python 2.7. I'm not sure if that would be enough, but should get you past this block.

If you're on Windows 10, you can also look into using the Windows Subsystem for Linux (WSL) for installing this, which may work better.

Let us know how it goes.

Thanks.
Terence

@SRGDamia1
Copy link
Member

I'm also stuck here. I cannot get past the compiler error even with the Visual C++ compilers installed.

@SRGDamia1 SRGDamia1 reopened this Dec 7, 2020
@AvinashFidel
Copy link

AvinashFidel commented Jan 25, 2021

I am also facing the same issue, @SRGDamia1 did you get any solution on this?

@SRGDamia1
Copy link
Member

No, I'm sorry, I never got it to work.

@rajadain
Copy link
Member

I've been trying to get this to work on Windows for a few weeks. I feel like I'm pretty close, but not there yet.

However, I have been able to get it to run on WSL2 running Ubuntu 20.04. If you'd like to setup WSL2 on your Windows 10 computer, please follow the instructions here: https://docs.microsoft.com/en-us/windows/wsl/install-win10

Once you have an Ubuntu environment setup, the next step is to install Python 2.7. This project still uses it, even though Python 2.7 has been EOL'd and is no longer included by default in Ubuntu:

$ sudo apt install python2 python2-dev
$ python2 --version
Python 2.7.18

The next step is to install pip2 for fetching packages:

$ curl https://bootstrap.pypa.io/2.7/get-pip.py --output get-pip.py
$ python2 get-pip.py
$ pip2 --version
pip 20.3.4 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

The next step is to install virtualenv so you can install the dependencies in an isolated manner:

$ pip2 install virtualenv
$ python2 -m virtualenv --version
virtualenv 20.4.2 from /home/rajadain/.local/lib/python2.7/site-packages/virtualenv/__init__.pyc

Then make a directory where you'd like to install GWLF-E and create a virtual environment within it:

$ mkdir -p ~/gwlfe-test
$ cd ~/gwlfe-test
$ python2 -m virtualenv .env
$ source .env/bin/activate

Now install llvmlite and numba one by one, since they have some post-install tasks that need to happen first. Then install gwlf-e.

.env $ pip install llvmlite==0.23.2
.env $ pip install numba==0.38.1
.env $ pip install gwlf-e

These steps worked on my machine:

.env $ pip freeze

certifi==2018.4.16
enum34==1.1.6
funcsigs==1.0.2
gwlf-e==2.0.0
llvmlite==0.23.2
mock==2.0.0
nose==1.3.7
numba==0.38.1
numpy==1.14.5
pbr==5.5.1
singledispatch==3.4.0.3
six==1.11.0

Let me know if this works!

@rajadain
Copy link
Member

Doing some more research into this, it seems like the AOT error was a numba issue numba/numba#3329. This has been fixed in numba/numba#3329 and is available in numba==0.41.0.

I have put up a branch that upgrades GWLF-E to that https://github.com/WikiWatershed/gwlf-e/tree/tt/windows. This will need to be tested against the MMW application to ensure that it doesn't break anything. But until that happens and a new release of GWLF-E is available, you can install using that branch.

Using Python 2.7.18 on Windows 10, I created a virtualenv and then I did:

$ pip install llvmlite==0.26
$ pip install numba==0.41.0
$ pip install git+git://github.com/WikiWatershed/gwlf-e@tt/windows

And it works. Please let me know if this helps.

@SRGDamia1
Copy link
Member

I'm sorry, I haven't gotten to try this yet. I'm not sure when I'll get to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants