python - Why am I getting an invalid syntax error? -
i following tutorial on installing requests library, http library python. requests installation guide
the tutorial says install requests library, run command in terminal
pip install requests
i didn't terminal run command in first tried windows cmd after downloading pip, package management system used install , manage software packages written in python(shown below)
i tried python 3.4.2 terminal(shown below)
does know terminal run command in , syntax error terminal(tried both)? me it's weird because python terminal able recognize pip not install.....
you can create virtual environment project , install modules use. looks using windows machine. commands follows
c:dirrectory_for_your_project>c:\python34\python.exe c:\python34\tools\scripts\pyvenv.py env #create environment c:dirrectory_for_your_project>env\scripts\activate.bat #activate enviornment (env) c:dirrectory_for_your_project>pip install requests #pip modules include in project (env) c:dirrectory_for_your_project>python script.py #run script
there deactivate script when exit env. make sure activate env whenever trying run script command line , should fine.
note: solution problem , based on personal preference. should still add necessary scripts path might come in handy in future.
Comments
Post a Comment