Reputation:
Hello thanks for looking.
i am trying to import third party modules but having a hard time.
I have already done the edit to the environment variable and i get python to show up in cmd but I can not find the correct syntax to do the install.
based on the python org site i should use python -m pip install SomePackage
i have also read that i should use pip install SomePackage
I have tried both and have not had success. I am in windows 10 below is the command prompt of my attempts.
C:\Users\T****J>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> -m pip install send2trash
File "<stdin>", line 1
-m pip install send2trash
^
SyntaxError: invalid syntax
>>> pip install send2trash
File "<stdin>", line 1
pip install send2trash
^
SyntaxError: invalid syntax
>>> python pip install send2trash
File "<stdin>", line 1
python pip install send2trash
^
SyntaxError: invalid syntax
>>> python -m pip install requests
File "<stdin>", line 1
python -m pip install requests
^
SyntaxError: invalid syntax
>>>
thanks again. searched the best i could and maybe i am missing something easy. I am new at this .
Upvotes: 0
Views: 22635
Reputation: 783
pip
is a program itself, similar to how npm
, bundler
or nuget
works.
What you are currently doing is firing up the Python interpreter, and writing the call to pip from there, it doesn't work like that.
What you're looking to do is to install a package with pip, like this:
C:\Users\T****J>pip install send2trash
and after that's done you can open the interpreter again and import the module like this:
C:\Users\T****J>python
>>> import send2trash
I strongly suggest, however, that you do a bit of research into virtualenv and how to use it, it will make your life easier on the long run
Upvotes: 0
Reputation: 11075
you are trying to give command line arguments within the interpreter...
If PIP is installed, you don't need to invoke the interpreter at all. Simply call:
C:\Users\T****J>pip install send2trash
from the command prompt.
otherwise, if you are using the pip module, you need to pass the command line arguments to the command line not to the interpreter...
C:\Users\T****J>python -m pip install send2trash
Upvotes: 1