I am getting acquainted with python development and it's been some time since I wrote python code. I am setting up my IDE (Pycharm) and Python3 binaries on Windows 10.
I want to start working with the pytorch library and I am used to before in python2 just typing pip install and it works fine.
Now it seems pip is not installed by default and has been replaced by something called conda?
What's the best way to install the pytorch package from the command line?
here is a screenshot link
CodePudding user response:
PyTorch Documentation does have a selector that will give you the commands for pip and conda.
However, Python3 should have pip installed, it may just be pip3 (that's what it was for me).
CodePudding user response:
if you have multiple version of python installed, you need to call the specific pip of that version to install for that version like
C:\Users\copperfield\Desktop>python -m pip install some_library
you can check the version by
C:\Users\copperfield\Desktop>python --version
but if you have multiples version you might need to append a number to it in order to differentiate between version so call it as python3
or python3x or python3.x where x is the specific version so for example for python 3.10 that is python310
or python3.10
Note, you can enter your python interpreter in your console by simply calling python (or python3 in your case), to get out of it simply call exit()
C:\Users\copperfield\Desktop>python
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("hello world")
hello world
>>> exit()
C:\Users\copperfield\Desktop>
the pip calls (as show previously) are to be executed in the console, not in the interpreter