badlands-model / badlands

Basin and Landscape Dynamics model

Home Page:https://badlands.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in install

jmk95Liverpool opened this issue · comments

Hi,

I am currently trying to install the Badlands python package onto my desktop. I keep receiving the error message below:

Collecting badlands
Using cached badlands-2.2.3.tar.gz (185 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\jmk95\AppData\Local\Temp\pip-install-b42xdva9\badlands_f62436b63cee46798ca09046df7d0d71\setup.py", line 24, in
subprocess.call(["make", "-C", "utils"])
File "C:\Anaconda3\2022.05\lib\subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Anaconda3\2022.05\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Anaconda3\2022.05\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

All dependencies are installed and up to date.
I am running conda as an admin as well, so it doesn't seem to be a permissions issue?
I have manually reinstalled set up tools and pip: they are both up to date.
I can install other python packages - including the Badlands companion package from the same source

Any help would be greatly appreciated.

Hi there,

The pip package hasn't been made for windows and I think this is why you are receiving this error message.

What you can do is to install it from the source. To do so, first open your anaconda environment where you have all the dependencies install then clone badlands & badlands-companion using git:

git clone https://github.com/badlands-model/badlands.git
git clone https://github.com/badlands-model/badlands-companion.git

cd to the respective folder and run the install command:

cd badlands/badlands
python3 setup.py install --user
cd ../../badlands-companion
python3 setup.py install --user

I think it because badlands is not pure Python and has some pre-compiled code in its pip package.

Sorry - now I'm getting this error trying to run the basin example:
ImportError: cannot import name 'fvframe' from partially initialized module 'badlands'

Not sure, did it complain during compilation? maybe python3 setup.py install works.

(mybadlands) E:\PhD\BadlandsGit\badlands>python setup.py install --user
Traceback (most recent call last):
File "E:\PhD\BadlandsGit\badlands\setup.py", line 24, in
subprocess.call(["make", "-C", "utils"])
File "D:\ProgramData\anaconda3\envs\mybadlands\lib\subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "D:\ProgramData\anaconda3\envs\mybadlands\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "D:\ProgramData\anaconda3\envs\mybadlands\lib\subprocess.py", line 1436, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

Still not have the same error. All dependencies are installed

The pip packages have been compiled for Mac and Linux OS only so it does make sense that they would not work under windows.

For windows you would need to install it from the source. I have uploaded a a yaml environment file in the master branch so the first thing would be to clone again the badlands repository from GitHub.

To make the environment do:
conda env create --file environment.yml

This should create the environment called badlands, activate it:
conda activate gospl

Then navigate to badlands repository and:
python3 setup.py install --user

Regarding the badlands-companion, I guess this is the same issue, there isn’t a windows package. So you will need to proceed with above install command. The tribad package is found here: https://github.com/Geodels/tribad