0

On my MacOS 12.4 is Python pre-installed, in the version Python 3.8.9. I did nothing for that, neither changed pathes.

If I run a Python script, which needs some modules with import requests or from bs4 import BeautifulSoup, I get errors ModuleNotFoundError: No module named ... - all modules are affected.

But, if I install same modules with pip3 install bs4, modules are installed correctly.

What should I change in scripts or Python settings so, that scripts can import modules on usual way?

3
  • Where is the python and pip3 executables? Python is not preinstalled since 12.3, Apple provides does one in Xcode
    – mmmmmm
    Jul 22, 2022 at 18:04
  • Indeed, I installed Xcode devtools before terminal got Python3
    – Evgeniy
    Jul 22, 2022 at 18:06
  • I just tried on a clean setup /usr/bin/pip3 install bs4 started /usr/bin/python3 and in that from bs4 import BeautifulSoup and it worked. import requests failed - which is expected as what package is requests? Also where is your pip3
    – mmmmmm
    Jul 22, 2022 at 19:24

0

You must log in to answer this question.

Browse other questions tagged .