0

Python 3.9 on a Mac with OS 10.15.4. For some reason, I started encountering difficulties a while back installing packages from PyPI using the usual pip install..., so I resorted to downloading each new package, unzipping it, and running the setup from the terminal.

I'd like to avoid the hassle and return to pip, adding the correct option so I can install to a specified directory, where I've been downloading the packages manually. I've tried various suggestions without any success.

Desired location: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/

One attempt of many:

pip install packagename -t / /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/

I should point out that if this is related to virtual environments, that's something I'm trying to figure out separately.

fishbacp
  • 1,123
  • 3
  • 14
  • 29
  • 2
    as far as I understand pip installs to that folder by default, if you have multiple versions of python you can try running `python3 -m pip install packagename`, or `python3.9 -m pip install packagename` – Jason Rebelo Neves Mar 06 '21 at 21:31
  • Does this answer your question? [Install a Python package into a different directory using pip?](https://stackoverflow.com/questions/2915471/install-a-python-package-into-a-different-directory-using-pip) – sahasrara62 Mar 06 '21 at 21:39
  • 1
    `/Library/Frameworks/Python.framework/Versions/3.9/bin/python -m pip install Something` – sinoroc Mar 06 '21 at 22:07
  • @JasonRebeloNeves--that was simple. Thanks. I need to upvote your answer. – fishbacp Mar 06 '21 at 23:04
  • https://snarky.ca/why-you-should-use-python-m-pip/ – sinoroc Mar 07 '21 at 07:56

0 Answers0