Skip to content

Suggestion: update numpy version in ml-agents-envs/setup.py #6002

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

Closed
xyz2022 opened this issue Oct 28, 2023 · 3 comments
Closed

Suggestion: update numpy version in ml-agents-envs/setup.py #6002

xyz2022 opened this issue Oct 28, 2023 · 3 comments
Labels
bug Issue describes a potential bug in ml-agents.

Comments

@xyz2022
Copy link
Contributor

xyz2022 commented Oct 28, 2023

Note: problem and solution contained within

context

Following this guide: https://github.com/Unity-Technologies/ml-agents/blob/develop/docs/Installation.md,
Which points to this repo: git clone --branch release_21 https://github.com/Unity-Technologies/ml-agents.git,
line 63 of file ml-agents/ml-agents-envs
/setup.py: "numpy==1.21.2"

problem

` Building wheel for numpy (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for numpy (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [214 lines of output]
setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.`

So try numpy==1.22.1 and it installs fine but new error when its time to run mlagents-learn: Failed to initialize NumPy: module compiled against API version 0x10 but this version of numpy is 0xe

Solution

Finally, pip install numpy==1.23.1 and everything works fine. No errors on install or on mlagents-learn

Conclusion:

For users installing the following this guide verbatim: https://github.com/Unity-Technologies/ml-agents/blob/develop/docs/Installation.md

The version of numpy in setup.py (in ml-agents-envs/setup.py and ml-agents/setup.py) should be changed to:
"numpy==1.23.1"

@xyz2022 xyz2022 added the bug Issue describes a potential bug in ml-agents. label Oct 28, 2023
@xyz2022
Copy link
Contributor Author

xyz2022 commented Oct 28, 2023

Environment info:
(mlagents) PS C:\ML2\ml-agents> python --version
Python 3.10.13
(mlagents) PS C:\ML2\ml-agents> pip list
Package Version


absl-py 2.0.0
attrs 23.1.0
cachetools 5.3.2
cattrs 1.5.0
certifi 2023.7.22
charset-normalizer 3.3.1
cloudpickle 3.0.0
colorama 0.4.6
filelock 3.13.0
fsspec 2023.10.0
google-auth 2.23.3
google-auth-oauthlib 1.1.0
grpcio 1.48.2
gym 0.26.2
gym-notices 0.0.8
h5py 3.10.0
huggingface-hub 0.18.0
idna 3.4
Markdown 3.5
MarkupSafe 2.1.3
mlagents 1.0.0
mlagents-envs 1.0.0
numpy 1.23.1
oauthlib 3.2.2
onnx 1.12.0
packaging 23.2
PettingZoo 1.15.0
Pillow 10.1.0
pip 23.3
protobuf 3.19.6
pyasn1 0.5.0
pyasn1-modules 0.3.0
pypiwin32 223
pywin32 306
PyYAML 6.0.1
requests 2.31.0
requests-oauthlib 1.3.1
rsa 4.9
setuptools 68.0.0
six 1.16.0
tensorboard 2.15.0
tensorboard-data-server 0.7.2
torch 1.13.1+cu117
tqdm 4.66.1
typing_extensions 4.8.0
urllib3 2.0.7
Werkzeug 3.0.1
wheel 0.41.2 '

@xyz2022
Copy link
Contributor Author

xyz2022 commented Oct 28, 2023

Additional note:
After posting this issue, I've seen in commit notes and PRs that python version must be 3.10.12
The doc's however, say "python 3.10.12 or higher".
Finally, the doc's say: run conda create -n mlagents python=3.10 && conda activate mlagents, this results in python 3.10.13 being installed. Which is higher than 3.10.12.
To be honest I think the maintainer should simply update the numpy version in setup.py to avoid all the headaches caused by the the doc's and numpy errors.
Can confirm: Windows + conda + python 3.10.13 + numpy 1.23.1 is a working combination.

@miguelalonsojr
Copy link
Collaborator

This has already been patched on develop and will be available next release. #5997

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue describes a potential bug in ml-agents.
Projects
None yet
Development

No branches or pull requests

2 participants