Pytorch won't install in PyCharm on MacOS

半城伤御伤魂 提交于 2021-01-05 09:10:17

问题


I'm new to the MacOS and I have recently downloaded PyCharm on it. I was able to successfully install some packages like numpy, matplotlib, sympy, etc. However, Pytorch won't get installed; not through PyCharm nor through the Terminal. These are the commands I tried in the Terminal (other than attempting to install them directly from PyCharm):

  • pip install torch
  • pip install torch torchvision torchaudio

I could post the error messages but some are quite lengthy :(

I'm using Python 3.9 interpreter with pip on the latest version (20.2.4) (everything else is also up to date). Running this on the new Mac Mini (running the M1 chip).

Any ideas on what I should do? Thanks!!!


回答1:


Try building from the source code, run these commands

  1. git clone https://github.com/pytorch/pytorch.git
  2. cd pytorch
  3. git submodule update --init --recursive
  4. python3 setup.py build
  5. python3 setup.py install



回答2:


Are you using a venv? If so you could try checking the box "install to user's site packages directory" in the Project Interpreter settings when you add a package.



来源:https://stackoverflow.com/questions/64949501/pytorch-wont-install-in-pycharm-on-macos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!