installing pip autopep8 failed, invalid syntax? [duplicate] - python

This question already has answers here:
python3 --version shows "NameError: name 'python3' is not defined"
(2 answers)
Closed 4 years ago.
everyone.
I just started to learn python, and am currently trying to add some nice additional features to Atom.
I was trying to follow the steps from the video "Setting up a Python Development Environment in Atom":
https://www.youtube.com/watch?v=DjEuROpsvp4 (just for those who are interested to know more ,starting from around 13:30.)
But I failed at installing pip autopep8. As I downloaded "pip autopep8" in Atom and typed in "pip install autopep8" at the command line in python. what I got was a warning of "invalid syntax", which lead me to nowhere to know what got wrong.
invalid syntax, installing pip autopep8
I hope someone could help me figure out what was the problem, and how could I push the installing forward. Thank you all!

Try in CMD:
pip install autopep8
Upon looking at your image, don't run pip through your IDLE, run it straight from CMD
https://i.stack.imgur.com/RH9cR.png <-- Example
Editing because I found some additional info for future users. If you're running additional versions of python on the same system (Centos for instance requires python 2 for a lot of dependencies) you can use the pip instance of a specific python install by running the following:
python3.6 -m pip install discord
As an example, python3.6 in my case was the additional instance I installed on my Centos server. Normal pip was installing packages for the Python 2 instance.

Related

pip is not working in the vs code i tried changing the environment variables.. i'm stuck with this [duplicate]

This question already has answers here:
'pip' is not recognized as an internal or external command
(40 answers)
Closed 1 year ago.
pip not working with any followed commands:
pip is not showing anywhere:
It sounds like you may not have pip installed, judging from your pictures. If so type this to check python -m pip --version.
If you don't have it installed, perhaps try python -m pip install.
If you do have pip installed and are trying to install pygame, I suggest trying python -m pip install pygame.
I also found that using python didn't work but replacing it with py did. I did these things (a while ago) in terminal on a windows 10 machine, so my suggestions may not be relevant.

pip install func for python will not work on my win system [duplicate]

This question already has answers here:
Why does "pip install" inside Python raise a SyntaxError?
(7 answers)
Closed 2 years ago.
I was trying to develop a virtual machine for my friend, I decided to use python pip, but when I typed in install after pip (pip install wolframalpha), the "i" is highlighted as an "invalid syntax". I have tried capital "i" in install, but it still shows the error, I do believe I have searched for all possible reasons, but did not come to the one that is my reason for all my problems. also, i have tried python IDLE and the cmd prompt widows comes with, along with uninstalling and reinstall python 3.8.5, yet that did nothing. below is a screen shot of my problem.
pip install error
The problem is you are using python in your shell, instead what you want to do is open up command prompt and type pip install (your module), or if this throws you an error configure pip to your path variables than try again.

how to use an installed pip3 package on command line [duplicate]

This question already has an answer here:
Packaging a Python library with an executable
(1 answer)
Closed 3 years ago.
i made a pip3 package example-pkg-martinbarker-test online here that just prints a command. I installed it with pip install example-pkg-martinbarker-test==0.0.1 , how do I run the installed pip3 package from my terminal command line?
I'm trying to find a command like python3 -m example-pkg-martinbarker-test that will run my package from the command line, but all the resources online when I look for this information are just about installing packages. please help, I know this must be incredibly simple
if i well understand, you need first import your package in your python code (a python file) then call its functions

Invalid Syntax in Python for -m pip install (...) tried everything [duplicate]

This question already has answers here:
pip not working on windows python 2.7.9
(8 answers)
Closed 4 years ago.
I know there's a post like this, but I can't find the answer yet :S
I installed the last version of Python (3.7) and it's already come with pip right? I tried everything on CMD in intention to install libraries but everytime i got "Invalid Syntax".
py -m pip install ndjson;
python -m pip install ndjson;
pip install ndjson;
python.exe -m pip install ndjson;
even python --version got invalid syntax.
someone help me?
my windows is 64 bits..
EDIT:
enter image description here
You are in your Python interpreter rather than the terminal.
Open a new terminal and try pip install ndjson again.
Just so you know, if you see >>> at the start of your terminal, you're in the Python interpreter. You can't run pip commands from the Python interpreter; you can only run them from the terminal.
To exit the interpreter you can type quit() (or hit control D in some systems), which will bring you back to your terminal.

python package installing for novices [duplicate]

This question already has answers here:
What is the most compatible way to install python modules on a Mac?
(13 answers)
Closed 8 years ago.
i'm learning python from on online book and have come to the stage where the author asks the reader to install pip, virtualenv, nose, and distribute. to make it fun, he asks the reader to figure out how :-)
well, i'm an utter novice and have spent the last week trying to figure that out
on the basis of recommendation i found, i've downloaded homebrew and tried to use pip (sudo easy_install). it runs ok and says something about finishing processing dependencies.
yet when i try nosetests, i get a 'command not found'.
Edit - Zmo, i tried what you suggested and this is the result. thanks for your help.
unknown-00-25-00-47-cc-3d:~ k$ sudo /usr/bin/easy_install pip
Password:
Searching for pip
Best match: pip 1.5.4
Processing pip-1.5.4-py2.7.egg
pip 1.5.4 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin
Using /Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
unknown-00-25-00-47-cc-3d:~ k$ sudo /usr/local/bin/pip install nosetests
Downloading/unpacking nosetests
Could not find any downloads that satisfy the requirement nosetests
Cleaning up...
No distributions at all found for nosetests
Storing debug log for failure in /Users/k/Library/Logs/pip.log
I have two requests for the community:
1) can someone help me solve this specific problem? (i use a 2009 mac with mavericks) and
2) can someone point me in the direction of some resources online where an utter novice like myself can learn about packages for python? (every resource i see assumes some level of knowledge, which i don't have).
thanks in advance,
K.
I recommend going through the tutorial and installing first "easy Install" http://pythonhosted.org/setuptools/easy_install.html and then install pip and the rest of the items with it.
Also you can follow the tutorial on (http://pip.readthedocs.org/en/latest/installing.html ) after that everything will be installed with pip itself.
PS: This question also can be useful (What is the most compatible way to install python modules on a Mac?)
anyway, as you're on OSX 10.9, run exactly what follows in the terminal:
sudo /usr/bin/easy_install pip
sudo /usr/local/bin/pip install nosetests
if you get errors here, please copy/paste them in your question as an edit
/usr/local/bin/nosetests
for the resources, please refer to leonardo's links, all I'd do is copy/paste them here (or do the same duckducking as he did).

Categories