Posting warning message

T Berger brgrt2 at gmail.com
Tue Jun 12 01:51:38 EDT 2018


On Monday, June 11, 2018 at 7:24:58 PM UTC-4, Gregory Ewing wrote:
> Tamara Berger wrote:
> > I typed these 2 lines in the terminal:
> > 
> > 192:~ TamaraB$ sudo python3
>  > ...
> >>>>python3 -m pip install pytest
> 
> You need to enter this *single* line in the Terminal:
> 
>     sudo python3 -m pip install pytest
> 
> > What does the "-m" stand for in the line of code?
> 
> It's a cmmand-line option to the python interpreter
> telling it to execute a module.
> 
> (What you did was first launch the Python interpreter and
> then tell it to run "python3 -m pip install pytest" as a
> Python statement. But it's not Python code, it's a shell
> command.)
> 
> -- 
> Greg

Thanks, Greg. But I got a permission error. Here is my command at the prompt and the terminal's response.

192:~ TamaraB$ sudo python3 -m pip install pytest

Password:

The directory '/Users/TamaraB/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/TamaraB/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: pytest in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from pytest)
Requirement already satisfied: pluggy<0.7,>=0.5 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from pytest)
Requirement already satisfied: atomicwrites>=1.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from pytest)
Requirement already satisfied: more-itertools>=4.0.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from pytest)
Requirement already satisfied: six>=1.10.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from pytest)
Requirement already satisfied: py>=1.5.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from pytest)
Requirement already satisfied: attrs>=17.4.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from pytest)
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

So I'm stuck again. I thought "sudo" was supposed to take care of permissions. Do you have a suggestion?

Thanks,

Tamara



More information about the Python-list mailing list