Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does pip install . (dot) mean?

Tags:

python

pip

I have a shell script whose last line is:

pip install . 

What does it do?

  • pip install <package-name> installs the specified package
  • pip install -r requirements.txt installs all packages specified in requirements.txt

But I am not sure what the above command does.

like image 700
Shamshad Alam Avatar asked Aug 18 '16 17:08

Shamshad Alam


People also ask

What is pip DOT install?

Basically you are specifying the location from which the pip package manager to extract the package information from.

Why exclamation mark is used in pip install?

It means run it as a shell command rather than a notebook command. For instance, using a command without ! in the terminal same as using the command with ! in jupyter notebook or google code lab.

What is the difference between pip install and Python pip install?

They do exactly the same thing. In fact, the docs for distributing Python modules were just updated to suggest using python -m pip instead of the pip executable, because it's easier to tell which version of python is going to be used to actually run pip that way.

Does it matter where you pip install?

To install modules locally, you need to create and activate what is called a virtual environment, so pip install installs to the folder where that virtual environment is located, instead of globally (which may require administrator privileges).


2 Answers

"Install the project found in the current directory".

This is just a specific case of pip install /path/to-source/tree.


To quote the the pip install documentation describing this usage:

pip install [options] [-e] <local project path> ... 
like image 62
Charles Duffy Avatar answered Oct 11 '22 00:10

Charles Duffy


Explicitly, pip install . will execute the setup.py file in the current directory (which will usually load a requirements.txt file).

like image 22
iacob Avatar answered Oct 11 '22 00:10

iacob