Setting up ML Agents for Unity in 5 Minutes

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 135

  • @IsmaiArrouchdi
    @IsmaiArrouchdi 4 месяца назад +8

    Hey. First of all, great tutorial.
    I was hoping you could help with a error i've been seeing a lot in the comments. I was getting this error :""ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects"", so i tried to use your "requirements.txt" file and install the packages with the "correct" versions you specified. I couldn't help but notice the same error when typing "pip install - r requirements.txt" in cmd. I am using python 3.10.0, I also updated pip to the latest version, but i keep getting this error :
    RuntimeError: Broken toolchain: cannot link a simple C program
    [end of output]
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for numpy
    Failed to build numpy
    ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (numpy)"
    Could it be some C++ tools i didnt install (yes i did download the vs build tools for C++, v:14.0)
    Also i was wondering if i can follow an outdated tutorial (say CodeMonkey's tutorial for example) and use older versions of torch, python, mlagents etc... Would it theoreticaly work ?

    • @pingcode
      @pingcode  4 месяца назад +1

      This has been bothering me for a while too. It's upsetting because I cannot reproduce this behavior.
      You don't need any C++ tools because pip builds the binary version of numpy. If you want to manually install it from source code, then you would need C++, but I have never done that.
      One thing I can suggest, is running this *pip install --no-cache-dir setuptools wheel*
      This installs *steuptools* and *wheel* libraries. Try installing numpy after that (make sure you are still in the venv).
      Not sure if it will fix you issue, but its worth a shot
      As for following another tutorial, you definitely can try. However, I made this tutorial because following them came with a lot of headaches such as conflicting library versions, outdated python versions, etc. Most tutorials cover the same thing anyway.
      If you find a solution, please let me know about it so I can pin the comment!

    • @IsmaiArrouchdi
      @IsmaiArrouchdi 4 месяца назад +8

      @@pingcode
      I tried installing the setuptools and wheel libraries as you suggested, but it didn't work. The good news is that I found a comment on CodeMonkey's video suggesting a similar procedure with different versions of Python and the Unity editor. It worked for me, and the "mlagents-learn --help" command worked just fine. I'll juste paste the comment right here :
      " Hi from 2023! I had some trouble instaling the python enviroment but I made it work.
      Unity: 2022.3.14f1
      Python 3.9.13
      Before venv:
      py -3.9 -m venv venv
      After venv:
      python -m pip install --upgrade pip
      pip install mlagents
      pip3 install torch torchvision torchaudio
      pip install protobuf==3.20.3
      pip install packaging
      Works fine! Hope so u too :D "
      I started from scratch, created a new project with the suggested Unity version, and it worked.
      #### Another question: Does it matter if I install the ML Agents package (from the Unity editor) after the whole CMD procedure? Will it impact my simulations?
      Thank you for the quick response btw.

    • @pingcode
      @pingcode  4 месяца назад

      @@IsmaiArrouchdi No it shouldnt make a difference. You might have to restart Unity or CMD if it doesn't detect its been installed yet. But that's it.
      So looks like using a different python version helped you, that's good to know. I will pint the comment for others to look at.
      Thanks!

    • @GameDevForHire
      @GameDevForHire 3 месяца назад

      @@IsmaiArrouchdi this was the same solution for me. I guess you need the exact python version for the different version of Ml-agents

    • @ReachAviation
      @ReachAviation 2 месяца назад

      @@IsmaiArrouchdi This worked for me too.

  • @theashbot4097
    @theashbot4097 7 месяцев назад +8

    I am soo glad somebody is making a update to his older setup!

  • @ДаніілКрасніков
    @ДаніілКрасніков 8 месяцев назад +1

    jezz, finaly tutorial that really helped... i was trying to setup my training for almost a week. you`re life saver

    • @pingcode
      @pingcode  8 месяцев назад +1

      Appreciate it! Good luck with your project

  • @cosminp236
    @cosminp236 6 месяцев назад +1

    This is the best tutorial on installing ML Agents atm. I followed some other tutorials and documentation but got frustrated after trying so many different versions and nothing worked. This video will get everything working, so thanks a lot!

    • @pingcode
      @pingcode  6 месяцев назад

      Glad it helped!

  • @4valongaming388
    @4valongaming388 5 месяцев назад +1

    Thank you very much. I saw Code Monkey's videos and thought it's gonna be perfect, but the installation was weird, so I started looking and your vid is perfect for filling that gap.

    • @pingcode
      @pingcode  5 месяцев назад +1

      Glad I could help!

  • @IWAJVR
    @IWAJVR 7 месяцев назад +1

    Best. Tutorial. I. Have. Watched. In. My. Life.

    • @pingcode
      @pingcode  7 месяцев назад +1

      Thank you

  • @tornoa1
    @tornoa1 2 месяца назад

    buddy, thank you soooooo much for this tutorial. it helped me a lot. i was struggling so much with the setup

    • @pingcode
      @pingcode  2 месяца назад

      @tornoa1 anytime! Glad I could help 👍

  • @theconductor_real
    @theconductor_real 3 месяца назад +1

    ILY so much man I was about to give up but you saved me

    • @pingcode
      @pingcode  3 месяца назад +1

      @@theconductor_real awesome! Great to hear :)

  • @victorhurst5569
    @victorhurst5569 6 месяцев назад +1

    Legend. Got stuck on this for 2.5 hours

    • @pingcode
      @pingcode  6 месяцев назад +1

      I'm so glad it helped!

  • @justinbishop9584
    @justinbishop9584 4 месяца назад +1

    very much appreciated this video needed to be made!

    • @pingcode
      @pingcode  4 месяца назад

      You're welcome! 😊

  • @snakeywakey4109
    @snakeywakey4109 3 месяца назад

    Thank you so much! i spent like 5 hours trying to install this and i finally stumbled upon this tutorial

    • @pingcode
      @pingcode  3 месяца назад

      @@snakeywakey4109 glad I could help!

  • @bigedwerd
    @bigedwerd 3 месяца назад

    Awesome tutorial. I used your video to setup a shell script so I don't have to remember to do

    • @pingcode
      @pingcode  3 месяца назад +1

      @@bigedwerd awesome stuff, glad I could help

  • @ferb1742
    @ferb1742 2 месяца назад

    thank you so much my friend. you save my day!

  • @paulmeynckens6676
    @paulmeynckens6676 9 дней назад

    Thanks. It works like a charm.

    • @pingcode
      @pingcode  9 дней назад

      @@paulmeynckens6676 awesome 👌

  • @Zufation
    @Zufation 2 месяца назад

    thank you man I finally got it working

    • @pingcode
      @pingcode  2 месяца назад

      @@Zufation awesome!

  • @ВадимЮрика
    @ВадимЮрика 2 месяца назад

    You're the best!!

  • @spyrocsgo
    @spyrocsgo 5 месяцев назад

    Loved the tutorial

    • @pingcode
      @pingcode  5 месяцев назад

      Thank you 😊

  • @nicholaspaleologos7088
    @nicholaspaleologos7088 4 месяца назад +2

    I was hoping you could help as I get the error: TypeError: Invalid first argument to `register()`. typing.Dict[mlagents.trainers.settings.RewardSignalType, mlagents.trainers.settings.RewardSignalSettings] is not a class or union type.
    I am using 3.11.9 but i have tried python 3.10 and get the same error and help would be greatly appreciated

    • @pingcode
      @pingcode  4 месяца назад

      Are you working in a venv?
      Is pip up to date?
      Did you install packages when using python version 3.10.0 and not just switching python versions?
      If yes to all then I really don't know. I made a dropbox link to my requirements.txt file if you want to try install everything using that?
      www.dropbox.com/scl/fi/phe813xzccz69riaf678x/requirements.txt?rlkey=etb53insp2txwtz8x0yaqwmqx&st=vdsaergu&dl=0
      Delete venv folder, and remake it. Put the file in the venv folder. Activate the venv and run *pip install -r requirements.txt*

    • @nicholaspaleologos7088
      @nicholaspaleologos7088 4 месяца назад

      @@pingcode Thank you this worked you have literally saved my dissertation

    • @pingcode
      @pingcode  4 месяца назад

      @@nicholaspaleologos7088 awesome, glad it worked out!

  • @yuxiangchen2754
    @yuxiangchen2754 2 месяца назад

    tqu every much for this

  • @b_a_n_g..__.-._.-.__...b_a_n_g
    @b_a_n_g..__.-._.-.__...b_a_n_g 3 месяца назад

    thank you for the tutorial but can you please help im getting the error
    OSError: [WinError 127] The specified procedure could not be found.
    im unsure of what to do

  • @rehabuddinshawon6767
    @rehabuddinshawon6767 6 месяцев назад

    Thank You so much. You just saved me

    • @pingcode
      @pingcode  6 месяцев назад

      Glad I could help!

  • @noprobliem23
    @noprobliem23 5 месяцев назад

    Heyy! thanks for the tutorial, it worked perfectly. But I have a question like in the monkeycode video or any other youtube video about trying out the mlagents, they used agent assets. How would i get the assets? I've downloaded the latest mlagent released which was vers 21 and i dragged the Assets from that folder to mine, but there is an issue which was "The associated script can not be loaded" How would i fix this?

    • @pingcode
      @pingcode  5 месяцев назад

      Honestly no idea since I never used the agent asset. I'm assuming you mean the little blue character? I've never used it so I don't know. If that's not what you mean, can you be a bit more specific

    • @noprobliem23
      @noprobliem23 5 месяцев назад

      @@pingcode yeah it was and actually i resolved it by just using the latest mlagent version tar.gz and extract it and used its Project folder to access the assets properly (including the steps you shown in this vid)

    • @pingcode
      @pingcode  5 месяцев назад

      @potato8938 That's great to hear 👍

  • @Plaquedragon
    @Plaquedragon 5 месяцев назад +2

    i got this error when i did mlagents-learn --help ImportError: Error importing numpy: you should not try to import numpy from
    its source directory; please exit the numpy source tree, and relaunch
    your python interpreter from there. i dont understand it

    • @pingcode
      @pingcode  5 месяцев назад

      It's hard to say without knowing what you did.
      The error message is saying that you are trying to import numpy from its source directory. You might have done something wrong when changing directories in the terminal or you might have numpy installed in a weird way on your machine.
      Is there any part of the tutorial that you are confused about and need help with?

  • @DrHanes
    @DrHanes 7 месяцев назад

    Thank you!!!🙏

    • @pingcode
      @pingcode  7 месяцев назад

      No problem!

  • @soulfool5511
    @soulfool5511 7 месяцев назад

    Is it possible to train on GPU with mlagents?
    In the official documentation I found "Currently for the ML-Agents Toolkit, only CUDA v9.0 and cuDNN v7.0.5 is supported."
    It is sad, because I can't even install CUDA v9.0 anymore, because it is not compatible with never GPUs :(

    • @pingcode
      @pingcode  7 месяцев назад

      I am not sure, I never tried it.
      Please look at these links, they might be helpful in some way.
      forum.unity.com/threads/gpu-training-using-ml-agents-cuda-cudnn.910652/
      www.tensorflow.org/install/pip
      github.com/miyamotok0105/unity-ml-agents/blob/master/docs/Installation-Windows.md
      www.reddit.com/r/Unity2D/comments/16nko4k/how_to_utilize_cuda_during_the_training_of/

  • @Phoenix_3223
    @Phoenix_3223 4 месяца назад +4

    Edit: my comments do show up unless you sort by newest first idk why
    i always get this error message when installing mlagents in python :
    "ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects"
    I already tried installing numpy by itself but it was already there
    could someone please help me?

    • @pingcode
      @pingcode  4 месяца назад

      Did you make a virtual environment? If not, you might be using a version of numpy already installed on your pc.
      If you did make a virtual environment, try to unistall numpy and reinstall it from within it
      The error might be indicating a version of numpy not compatible with the current version of python or mlagents.

    • @Phoenix_3223
      @Phoenix_3223 4 месяца назад

      @@pingcode got the same error when trying to install numpy 1.21.2
      on the newest version it just doesnt even tries to create that "wheel"
      yes i am in an virtual environment
      heres an List of all the installed packages(if it helps):
      Package Version
      ----------------- ---------
      filelock 3.15.1
      fsspec 2024.6.0
      intel-openmp 2021.4.0
      Jinja2 3.1.4
      MarkupSafe 2.1.5
      mkl 2021.4.0
      mpmath 1.3.0
      networkx 3.3
      numpy 1.26.4
      pillow 10.3.0
      pip 24.0
      setuptools 57.4.0
      sympy 1.12.1
      tbb 2021.12.0
      torch 2.3.1
      torchaudio 2.3.1
      torchvision 0.18.1
      typing_extensions 4.12.2

    • @pingcode
      @pingcode  4 месяца назад

      @@Phoenix_3223 Thanks for that. Upon checking my pip install list, I see I have a lot more packages installed. Please check this link to download my requirements.txt file I just made: www.dropbox.com/scl/fi/phe813xzccz69riaf678x/requirements.txt?rlkey=etb53insp2txwtz8x0yaqwmqx&st=nxd615dq&dl=0
      You can try uninstall everything in your virtual environment and installing everything in this file using *pip install -r requirements.txt*
      Let me know if that works!

    • @Phoenix_3223
      @Phoenix_3223 4 месяца назад

      @@pingcode i did exactly that untill the installing just stopped because of the same error: ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

    • @jasperharris3555
      @jasperharris3555 4 месяца назад

      I had this and had the microsoft store version which was 3.10.11 and installing 3.10.0 fixed it

  • @AlmostCoolTho
    @AlmostCoolTho 6 месяцев назад

    Hey, when the help command runs I see you also have an error about torch.set_default_tensor_type() being deprecated. I see it still runs with this, but my results aren't showing on tensor board. Could this error be an indication of why? and any idea what the fix would be?

    • @pingcode
      @pingcode  6 месяцев назад

      I'm assuming you ran the tensorflow command in the terminal? I can't help you without more information. A common mistake is that a training session didn't finish yet, so no grpah can be made (which is indicated by the number of `steps`).
      Let me know what you have tried and I'll try to help you.
      In the meantime, make sure you read this
      unity-technologies.github.io/ml-agents/Using-Tensorboard/

    • @AlmostCoolTho
      @AlmostCoolTho 6 месяцев назад

      @@pingcode Yes looks like I excited it too early. Thank You

  • @KhaledHossamShosha
    @KhaledHossamShosha 4 месяца назад

    thank you very much it worked thanks

    • @pingcode
      @pingcode  4 месяца назад

      @@KhaledHossamShosha Awesome!

    • @KhaledHossamShosha
      @KhaledHossamShosha 4 месяца назад

      @@pingcode Dose i need a CUDA in this release ?

    • @pingcode
      @pingcode  4 месяца назад

      @KhaledHossamShosha do you have an nvidia gpu?
      Cuda is just used to speed up training to my understanding. I don't know much about it. You don't NEED it

    • @KhaledHossamShosha
      @KhaledHossamShosha 4 месяца назад

      @@pingcode i have RTX3050

    • @pingcode
      @pingcode  4 месяца назад

      @@KhaledHossamShosha yeah so then you should be able to use it. Try look up some documentation or videos

  • @cfactorygames
    @cfactorygames 23 дня назад

    here ask for barracuda when install it 999+ errors appears

  • @cfactorygames
    @cfactorygames 23 дня назад

    I've reveived an error when tried "pip install mlagents": error: subprocess-exited-with-error
    × Preparing metadata (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [21 lines of output]

    • @pingcode
      @pingcode  23 дня назад

      sorry, I don't know what could cause this error. Have you tried upgrading pip? Are you using python 3.10.0? Can you share the 21 lines of output that show the error?

  • @KhaledHossamShosha
    @KhaledHossamShosha 3 месяца назад

    Does i need to install pytorch and protobuf in every unity project that i create

    • @pingcode
      @pingcode  3 месяца назад +1

      @KhaledHossamShosha if you are installing mlagents and you are getting errors saying that you need them, then yes.
      Since you aren't installing these globally, you would have to do it for every project

  • @lucutes2936
    @lucutes2936 2 дня назад

    thx

  • @МаксимГригоренко-ц2о
    @МаксимГригоренко-ц2о 4 месяца назад

    why exactly python 3.10.0 ? I can't use 3.12 fo example ?

    • @pingcode
      @pingcode  4 месяца назад

      There are a lot of different libraries that need to work together in order to have ml agents run properly. Many of these libraries have version conflicts with different python versions.
      3.10.0 is a version I found to be stable. 3.12 for example is a newer python version that ml agents doesn't support yet.

  • @simonnaulet2118
    @simonnaulet2118 6 месяцев назад

    Hi, thank you for your simple and short tutorial. I got the error for "protobuf". After installing it, when I execute again mlagents-learn --help, i got the following error : TypeError: Invalid first argument to `register()`. typing.Dict[mlagents.trainers.settings.RewardSignalType, mlagents.trainers.settings.RewardSignalSettings] is not a class or union type. Can you help me please ?

    • @simonnaulet2118
      @simonnaulet2118 6 месяцев назад

      I had 2 versions of python installed on my computer. I needed to uninstall my recent version of Python to switch on the 3.10 version. I hope it helps someone ;)

    • @pingcode
      @pingcode  6 месяцев назад

      @simonnaulet2118 you dont have to uninstall that python version! You can just switch python versions in the terminal when needed.

    • @Plaquedragon
      @Plaquedragon 5 месяцев назад

      @@pingcode where terminal

    • @Plaquedragon
      @Plaquedragon 5 месяцев назад

      opps nvm

  • @pafodev
    @pafodev 7 месяцев назад

    Hey does it only work with python 3.10.0? i have 3.11 and it isnt working

    • @pingcode
      @pingcode  7 месяцев назад

      Yes, from my experience 3.10.12 is the latest version that works. This is odd because their documentation says 3.10.12 *or higher*
      unity-technologies.github.io/ml-agents/Installation/
      If you don't want to get rid of your current python version, you can install python 3.10.0 and switch the version of python you use in the terminal when running the commands shown in the video

    • @pafodev
      @pafodev 7 месяцев назад

      Ill give it a try and tell you, you deserve a sub , thanks man!@@pingcode

    • @pafodev
      @pafodev 7 месяцев назад

      @@pingcode IT WORKED, THANKSSS you deserve a sub!!

    • @pingcode
      @pingcode  7 месяцев назад

      @@pafodev No problem!

  • @iaxsgames6029
    @iaxsgames6029 4 месяца назад

    I don't know if someone will see this because it was posted 4 moths ago but I have this error that says
    TypeError: Invalid first argument to `register()`
    And I'm confused because when try and find a fix everything says 3.10.0 is'nt copatable with mlagents?

    • @pingcode
      @pingcode  4 месяца назад

      @iaxsgames6029 Are you working in a venv?
      Is pip up to date?
      Did you install packages when using python version 3.10.0 and not just switching python versions?
      If yes to all then I really don't know. I made a dropbox link to my requirements.txt file if you want to try install everything using that?
      www.dropbox.com/scl/fi/phe813xzccz69riaf678x/requirements.txt?rlkey=etb53insp2txwtz8x0yaqwmqx&st=vdsaergu&dl=0
      Delete venv folder, and remake it. Put the file in the venv folder. Activate the venv and run *pip install -r requirements.txt*

    • @iaxsgames6029
      @iaxsgames6029 4 месяца назад

      @@pingcode Do You Know How To Increase max_steps because right now when I say
      Mlagents-learn --run-id=****
      It always pops up at the bottom
      max_steps: 50000
      So It alwasy ends early

    • @pingcode
      @pingcode  4 месяца назад

      @@iaxsgames6029 you have to edit a YAML configuration file somewhere within the files. Please watch a tutorial on using ML-Agents for that. Code monkey's tutorial talk about it!

    • @mpumelelobaard9602
      @mpumelelobaard9602 19 дней назад

      im getting this error

  • @pingcode
    @pingcode  8 месяцев назад +1

    If you are interested in one on one tutoring for beginner's/intermediate's, I offer it for a fair price. Email me: (mypingo7 [at] yahoo [dot] com) if you are interested!

  • @Spiex81
    @Spiex81 6 месяцев назад

    i get this error at the end: TypeError: Invalid first argument to `register()`. typing.Dict[mlagents.trainers.settings.RewardSignalType, mlagents.trainers.settings.RewardSignalSettings] is not a class or union type.

    • @pingcode
      @pingcode  6 месяцев назад

      What version of Python are you using?

    • @Spiex81
      @Spiex81 6 месяцев назад

      @@pingcode sorry for the late reply, but i have 3.12.2

    • @pingcode
      @pingcode  6 месяцев назад +1

      @@Spiex81 you need 3.10, check description

    • @Spiex81
      @Spiex81 6 месяцев назад

      @@pingcode Ah ok thanks

  • @yonatan_bs
    @yonatan_bs 4 месяца назад

    i am getting the following error when i'm trying to run "pip install nlagents":
    ERROR: Failed building wheel for numpy
    Failed to build numpy
    ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (numpy)

    • @pingcode
      @pingcode  4 месяца назад

      Many people are having this issue and the reason isn't quite clear. The most I found online about this issue is that Numpy and Python are conflicting with each other. Try to install a different version of numpy. Make sure pip is updated. Make sure you are using Python 3.10.0 in the terminal.

    • @yonatan_bs
      @yonatan_bs 4 месяца назад

      @@pingcode that's probably the problem because when i try to install numpy i'm getting this error (and i'm using python 3.10 and pip is updated):
      (venv) C:\Users\yonat\ot>pip install numpy==1.19
      Collecting numpy==1.19
      Using cached numpy-1.19.0.zip (7.3 MB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... error
      error: subprocess-exited-with-error
      × Preparing metadata (pyproject.toml) did not run successfully.
      │ exit code: 1
      ╰─> [90 lines of output]
      Running from numpy source directory.
      :460: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      C:\Users\yonat\AppData\Local\Temp\pip-install-ha3yov2t
      umpy_1fff654732424398a076fa9ec2c2648c\tools\cythonize.py:73: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      required_version = LooseVersion('0.29.14')
      C:\Users\yonat\AppData\Local\Temp\pip-install-ha3yov2t
      umpy_1fff654732424398a076fa9ec2c2648c\tools\cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      if LooseVersion(cython_version) < required_version:
      performance hint: _common.pyx:275:19: Exception check after calling 'random_func' will always require the GIL to be acquired. Declare 'random_func' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
      performance hint: _common.pyx:299:19: Exception check after calling 'random_func' will always require the GIL to be acquired. Declare 'random_func' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
      performance hint: _common.pyx:322:50: Exception check after calling 'random_func' will always require the GIL to be acquired. Declare 'random_func' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
      performance hint: _common.pyx:1002:32: Exception check after calling 'f1' will always require the GIL to be acquired. Declare 'f1' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
      performance hint: _generator.pyx:706:41: Exception check after calling '_shuffle_int' will always require the GIL to be acquired.
      Possible solutions:
      1. Declare '_shuffle_int' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
      2. Use an 'int' return type on '_shuffle_int' to allow an error code to be returned.
      performance hint: _generator.pyx:735:45: Exception check after calling '_shuffle_int' will always require the GIL to be acquired.
      Possible solutions:
      1. Declare '_shuffle_int' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
      2. Use an 'int' return type on '_shuffle_int' to allow an error code to be returned.
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      for i in range(1, RK_STATE_LEN):
      self.rng_state.key[i] = val[i]
      self.rng_state.pos = i
      self._bitgen.state = &self.rng_state
      self._bitgen.next_uint64 = &mt19937_uint64
      ^
      ------------------------------------------------------------
      _mt19937.pyx:138:35: Cannot assign type 'uint64_t (*)(void *) except? -1 nogil' to 'uint64_t (*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to the type of the value being assigned.
      Processing numpy/random\_bounded_integers.pxd.in
      Processing numpy/random\bit_generator.pyx
      Processing numpy/random\mtrand.pyx
      Processing numpy/random\_bounded_integers.pyx.in
      Processing numpy/random\_common.pyx
      Processing numpy/random\_generator.pyx
      Processing numpy/random\_mt19937.pyx
      Traceback (most recent call last):
      File "C:\Users\yonat\AppData\Local\Temp\pip-install-ha3yov2t
      umpy_1fff654732424398a076fa9ec2c2648c\tools\cythonize.py", line 235, in
      main()
      File "C:\Users\yonat\AppData\Local\Temp\pip-install-ha3yov2t
      umpy_1fff654732424398a076fa9ec2c2648c\tools\cythonize.py", line 231, in main
      find_process_files(root_dir)
      File "C:\Users\yonat\AppData\Local\Temp\pip-install-ha3yov2t
      umpy_1fff654732424398a076fa9ec2c2648c\tools\cythonize.py", line 222, in find_process_files
      process(root_dir, fromfile, tofile, function, hash_db)
      File "C:\Users\yonat\AppData\Local\Temp\pip-install-ha3yov2t
      umpy_1fff654732424398a076fa9ec2c2648c\tools\cythonize.py", line 188, in process
      processor_function(fromfile, tofile)
      File "C:\Users\yonat\AppData\Local\Temp\pip-install-ha3yov2t
      umpy_1fff654732424398a076fa9ec2c2648c\tools\cythonize.py", line 77, in process_pyx
      subprocess.check_call(
      File "C:\Users\yonat\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['C:\\Users\\yonat\\ot\\venv\\Scripts\\python.exe', '-m', 'cython', '-3', '--fast-fail', '-o', '_mt19937.c', '_mt19937.pyx']' returned non-zero exit status 1.
      Cythonizing sources
      Traceback (most recent call last):
      File "C:\Users\yonat\ot\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in
      main()
      File "C:\Users\yonat\ot\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
      File "C:\Users\yonat\ot\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
      return hook(metadata_directory, config_settings)
      File "C:\Users\yonat\AppData\Local\Temp\pip-build-env-u1c354rr\overlay\Lib\site-packages\setuptools\build_meta.py", line 368, in prepare_metadata_for_build_wheel
      self.run_setup()
      File "C:\Users\yonat\AppData\Local\Temp\pip-build-env-u1c354rr\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
      super().run_setup(setup_script=setup_script)
      File "C:\Users\yonat\AppData\Local\Temp\pip-build-env-u1c354rr\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
      exec(code, locals())
      File "", line 489, in
      File "", line 469, in setup_package
      File "", line 274, in generate_cython
      RuntimeError: Running cythonize failed!
      [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.

  • @atnguyencong4116
    @atnguyencong4116 8 месяцев назад

    help me fix error: Failed building wheel for numpy, I am using python 3.10.2, numpy is 1.26.4. I got this error when pip install mlagents

    • @deoz210
      @deoz210 8 месяцев назад

      use python 3.9

    • @atnguyencong4116
      @atnguyencong4116 8 месяцев назад

      @@deoz210 Does 3.9 work with ml-agents 21

    • @pingcode
      @pingcode  7 месяцев назад

      apologies for the late reply, if you still have the issue. Do you know what numpy version you have? You might have an older numpy version installed on your PC that isn't compatible with python 3.10
      This issue page might be helpful to read what others have said. Someone mentions at the end they used numpy version 1.23.3 and it works
      github.com/Unity-Technologies/ml-agents/issues/6008

    • @BastiaanNetjes
      @BastiaanNetjes 7 месяцев назад +1

      @@pingcode I am running into the same issue. I am using Numpy 1.23.3 and python 3.10.0 and I also get the "ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects" message :/
      Help would greatly be appreciated!

    • @pingcode
      @pingcode  7 месяцев назад

      @@BastiaanNetjes I'm not sure since I never ran into this issue myself. The only thing I can suggest is to uninstall numpy and reinstall it to see if that fixes anything.
      To my knowledge, you might also need C++ Build Tools installed since python and some libraries like numpy use C/C++. Though this is speculation.
      Here is a link to the build tools: visualstudio.microsoft.com/visual-cpp-build-tools/

  • @calalmuradov6162
    @calalmuradov6162 6 месяцев назад

    I could not why

    • @pingcode
      @pingcode  6 месяцев назад

      you could not what?

    • @calalmuradov6162
      @calalmuradov6162 6 месяцев назад

      @@pingcode to install ml agents i made all like you

    • @pingcode
      @pingcode  6 месяцев назад

      @@calalmuradov6162 well, what is the problem?

  • @bauxitegamingworld9402
    @bauxitegamingworld9402 4 месяца назад

    Can you please help me with these???????? pleaseeeeeeeeeeeeeee
    (venv) C:\Windows\System32>mlagents-learn --help
    Traceback (most recent call last):
    File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python310\lib
    unpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
    File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python310\lib
    unpy.py", line 86, in _run_code
    exec(code, run_globals)
    File "C:\Windows\System32\venv\Scripts\mlagents-learn.exe\__main__.py", line 4, in
    File "C:\Windows\System32\venv\lib\site-packages\mlagents\trainers\learn.py", line 2, in
    from mlagents import torch_utils
    File "C:\Windows\System32\venv\lib\site-packages\mlagents\torch_utils\__init__.py", line 1, in
    from mlagents.torch_utils.torch import torch as torch # noqa
    File "C:\Windows\System32\venv\lib\site-packages\mlagents\torch_utils\torch.py", line 6, in
    from mlagents.trainers.settings import TorchSettings
    File "C:\Windows\System32\venv\lib\site-packages\mlagents\trainers\settings.py", line 25, in
    from mlagents.trainers.cli_utils import StoreConfigFile, DetectDefault, parser
    File "C:\Windows\System32\venv\lib\site-packages\mlagents\trainers\cli_utils.py", line 5, in
    from mlagents_envs.environment import UnityEnvironment
    File "C:\Windows\System32\venv\lib\site-packages\mlagents_envs\environment.py", line 48, in
    from .rpc_communicator import RpcCommunicator
    File "C:\Windows\System32\venv\lib\site-packages\mlagents_envs
    pc_communicator.py", line 1, in
    import grpc
    File "C:\Windows\System32\venv\lib\site-packages\grpc\__init__.py", line 22, in
    from grpc import _compression
    File "C:\Windows\System32\venv\lib\site-packages\grpc\_compression.py", line 20, in
    from grpc._cython import cygrpc
    ImportError: cannot import name 'cygrpc' from 'grpc._cython' (C:\Windows\System32\venv\lib\site-packages\grpc\_cython\__init__.py)

    • @pingcode
      @pingcode  4 месяца назад

      Are you using Python 3.10.0?
      I can't help you with a random error message.

    • @bauxitegamingworld9402
      @bauxitegamingworld9402 4 месяца назад

      @@pingcode Yeah i am using the python 3.10.