Intellipaat Back

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

I know the obvious answer is to use virtualenv and virtualenvwrapper, but for various reasons, I can't,/don't want to do that.

So how do I modify the command

pip install package_name

to make pip install the package somewhere other than the default site-packages?

1 Answer

0 votes
by (106k points)

There are many ways to install a Python package into a different directory using pip some of them are as follows:-

You can use the below-mentioned command for installing a Python package into a different directory:-

pip install --target=d:\somewhere\other\than\the\default package_name

Another way you can use for installing a Python package into a directory is:

pip install --install-option="--prefix=$PREFIX_PATH" package_name

Wanna become an Expert in python? Come & join our Python Certification course 

Browse Categories

...