I am having trouble importing modules into my python projects. I just switched over to a 2020 Macbook Pro and think that this may have something to do with the problem since I never had problems before. This mac runs zhs as the default shell.
#!/usr/bin/python3
import time
import os
import selenium
This is the only code that I have written so far (I never used to need to specify that it was a python file with #!/usr/bin
...)
I get this error message:
ModuleNotFoundError: No module named 'selenium'
and I am pretty sure that it isn't a problem with selenium since the same problem occurred when I tried to import yaml
When I enter a python shell through the terminal, I can import selenium with no error...
$ python3
Python 3.8.5 (default, Jul 21 2020, 10:48:26)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import selenium
>>>
Both selenium and my new project are inside /usr/local/lib/python3.8/site-packages
I also tried modifying the PYTHONPATH
in zshrc
which didn't seem to help.
I think it should be a quick fix, but I'm not used to how this shell works. Any help greatly appreciated!