I've got both python 2.7 and 3.5 installed on my Mac OSX 10.7.4. My python script written in 3.5 works fine using the command:
python3 <file.py>
However, running another script compatible with python 2.7 gives me this error:
python testfile.py
Traceback (most recent call last):
File "testfile.py", line 29, in <module>
br.select_form(name="signinWidget")
File "build/bdist.macosx-10.7-intel/egg/mechanize/_mechanize.py", line 524, in select_form
mechanize._mechanize.FormNotFoundError: no form matching name 'signinWidget'
The script uses mechanize and BeautifulSoup packages.
>which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
I tried:
python -m pip install BeautifulSoup,mechanize
but it does not resolve this.
How do I ensure that the script is pointing to the correct packages which are installed on my mac already?