Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Install Python Modules From Emacs

Testing: get the latest file path _with:

Code

import sys

python_path = sys.executable

print(python_path)

Results

/opt/homebrew/opt/python@3.10/bin/python3.10

Verify `pip3` is there then run this:

Code

/opt/homebrew/opt/python@3.10/bin/pip3 install beautifulsoup4

That'll give you something like this if the modules hasn't been installed yet:

#+begin_example Collecting beautifulsoup4 Using cached beautifulsoup4-4.11.1-py3-none-any.whl (128 kB) Collecting soupsieve<1.2 Using cached soupsieve-2.3.2.post1-py3-none-any.whl (37 kB) Installing collected packages: soupsieve, beautifulsoup4 Successfully installed beautifulsoup4-4.11.1 soupsieve-2.3.2.post1 #+end_example

Then you can use it with:

Code

from bs4 import BeautifulSoup

Results