Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

Is it possible? When installing pip, install the python packages inside my $HOME folder. (for example, I want to install mercurial, using pip, but inside $HOME instead of /usr/local)

I'm with a mac machine and just thought about this possibility, instead of "polluting" my /usr/local, I would use my $HOME instead.

PEP370 is exactly about this. Is just creating a ˜/.local and do a pip install package enough to make these packages to be installed only at my $HOME folder?

1 Answer

0 votes
by (106k points)

For installing pip packages to $HOME folder you can use a virtualenv. You can pass the --user argument to the setup.py script. By using the latest version of pip it can be done below is the command that will be useful:-

pip install --user mercurial

After running the command the result in the hg script will be installed in $HOME/.local/bin/hg and the rest of the hg package in $HOME/.local/lib/pythonx.y/site-packages/.

Related questions

0 votes
1 answer
0 votes
1 answer
+2 votes
3 answers
0 votes
1 answer
asked Oct 10, 2019 in Python by Sammy (47.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...