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

Install Monai with all dependencies on windows following the documentation #6118

Closed
bpavie opened this issue Mar 8, 2023 · 5 comments · Fixed by #7234
Closed

Install Monai with all dependencies on windows following the documentation #6118

bpavie opened this issue Mar 8, 2023 · 5 comments · Fixed by #7234

Comments

@bpavie
Copy link

bpavie commented Mar 8, 2023

Describe the bug
The installation of Monai with all dependecies does not work following the documentation
https://docs.monai.io/en/stable/installation.html#from-github

To Reproduce

git clone https://github.com/Project-MONAI/MONAI.git
cd MONAI/
pip install -e '.[all]'

Get the following error:
ERROR: '.[all]' is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).

How it should be run on windows
pip install -e .[all]

However, on windows 10, I still get an error:

from pydantic import BaseModel, ValidationError
      ModuleNotFoundError: No module named 'pydantic'
      [end of output]
@ytl0623
Copy link
Contributor

ytl0623 commented Oct 17, 2023

Hi there, I got the same error when I use command: pip install -e '.[all]'.
But if I tried to use command pip install -r requirements-dev.txt, it looks worked!!!
And I found that there are three requirements file: requirements.txt requirements-dev.txt requirements-min.txt in MONAI directory, maybe you can download all dependencies with those file.

@ytl0623
Copy link
Contributor

ytl0623 commented Oct 17, 2023

For the second question,

from pydantic import BaseModel, ValidationError ModuleNotFoundError: No module named 'pydantic' [end of output]

After I use command pip install pydantic, and it works for me.

@ytl0623
Copy link
Contributor

ytl0623 commented Oct 26, 2023

@wyli @bpavie

Hi there, I found the way install MONAI with all dependencies on Windows.
The command should run pip install -e ".[all]" (double quotation marks), and it works for me(like below).

(monai) C:\Users\User\MONAI>pip install -e ".[all]"
Obtaining file:///C:/Users/User/MONAI
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done

...

Successfully built monai
Installing collected packages: monai
  Attempting uninstall: monai
    Found existing installation: monai 1.3.0+9.gcc20c9be.dirty
    Uninstalling monai-1.3.0+9.gcc20c9be.dirty:
      Successfully uninstalled monai-1.3.0+9.gcc20c9be.dirty
Successfully installed monai-1.3.0+9.gcc20c9be.dirty

So, maybe we can mark the differences between installation on Linux and Windows in the documentation https://docs.monai.io/en/stable/installation.html#from-github.

And the second question, we can add package 'pydantic' in [options.extras_require] section in the setup.cfg file.

(Line 48)
[options.extras_require]
all =
nibabel
ninja
...
pydantic

Hope the above method helps you!

@wyli
Copy link
Contributor

wyli commented Oct 26, 2023

thanks @ytl0623, for the ModuleNotFoundError, could you please share the full error log by any chance? the project's tests currently couldn't detect this error.

@ytl0623
Copy link
Contributor

ytl0623 commented Nov 13, 2023

Hi, @wyli, the error log is like below when running command pip install -e '.[all]' on Windows system.

ERROR: '.[all]' is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).

And I found that the way install MONAI with all dependencies should run pip install -e ".[all]" (double quotation marks).
The reason why it works is that the Windows shell doesn't recognize single quotes to delimit a string at all, so on Windows you'll need to use double quotes.

Finally, maybe we can mark the differences between installation on Linux and Windows in the documentation . And maybe this still deserves a PR for Windows users. #7234

Thanks!

ytl0623 added a commit to ytl0623/MONAI that referenced this issue Nov 15, 2023
ytl0623 added a commit to ytl0623/MONAI that referenced this issue Nov 16, 2023
… MONAI with all dependencies on Windows

Fixes Project-MONAI#6118

Signed-off-by: ytl0623 <david89062388@gmail.com>
ytl0623 added a commit to ytl0623/MONAI that referenced this issue Nov 17, 2023
… MONAI with all dependencies on Windows

Fixes Project-MONAI#6118

Signed-off-by: ytl0623 <david89062388@gmail.com>
KumoLiu pushed a commit that referenced this issue Nov 17, 2023
#7234)

… MONAI with all dependencies on Windows

Fixes #6118

### Description

The Windows shell doesn't recognize single quotes to delimit a string at
all, so on Windows you'll need to use double quotes. It's the same
command no matter which type of quotes you use; after the shell does its
processing, the argument is passed to pip with the quotation marks
already removed.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: ytl0623 <david89062388@gmail.com>
marksgraham pushed a commit to marksgraham/MONAI that referenced this issue Jan 30, 2024
Project-MONAI#7234)

… MONAI with all dependencies on Windows

Fixes Project-MONAI#6118

### Description

The Windows shell doesn't recognize single quotes to delimit a string at
all, so on Windows you'll need to use double quotes. It's the same
command no matter which type of quotes you use; after the shell does its
processing, the argument is passed to pip with the quotation marks
already removed.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: ytl0623 <david89062388@gmail.com>
Signed-off-by: Mark Graham <markgraham539@gmail.com>
juampatronics pushed a commit to juampatronics/MONAI that referenced this issue Mar 25, 2024
Project-MONAI#7234)

… MONAI with all dependencies on Windows

Fixes Project-MONAI#6118

### Description

The Windows shell doesn't recognize single quotes to delimit a string at
all, so on Windows you'll need to use double quotes. It's the same
command no matter which type of quotes you use; after the shell does its
processing, the argument is passed to pip with the quotation marks
already removed.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: ytl0623 <david89062388@gmail.com>
Signed-off-by: Juan Pablo de la Cruz Gutiérrez <juampatronics@gmail.com>
Yu0610 pushed a commit to Yu0610/MONAI that referenced this issue Apr 11, 2024
Project-MONAI#7234)

… MONAI with all dependencies on Windows

Fixes Project-MONAI#6118

### Description

The Windows shell doesn't recognize single quotes to delimit a string at
all, so on Windows you'll need to use double quotes. It's the same
command no matter which type of quotes you use; after the shell does its
processing, the argument is passed to pip with the quotation marks
already removed.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: ytl0623 <david89062388@gmail.com>
Signed-off-by: Yu0610 <612410030@alum.ccu.edu.tw>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants