beautiful soup in python 3 - pip3 in staSH?
I've installed beautiful soup, but I'm getting error messages saying I need to convert to Python 3 when it runs the beautifulSoup files. I've checked for the latest update, and tried pip3 command in staSH which gives a no command error. I did try converting the init.py file and any others that threw up an error with pythonista conversion tool to python3, but led to further problems eventually that conversion wouldn't solve.
import requests, bs4
res = requests.get('http://nostarch.com')
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/B60B81CE-83F6-4C3A-867B-08E54FFE878D/Pythonista3/Documents/MyScripts/beautifulSoupTest.py", line 1, in <module>
import requests, bs4
File "/private/var/mobile/Containers/Shared/AppGroup/B60B81CE-83F6-4C3A-867B-08E54FFE878D/Pythonista3/Documents/site-packages/bs4/init.py", line 53
'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'<>'You need to convert the code, either by installing it (
python setup.py install) or by running 2to3 (
2to3 -w bs4).'
SyntaxError: invalid syntax
bs4 is built into Pythonista. You do not need to install it.
Thank you! Googling in all the wrong places for the past hour!...
Hello ! same problem, that's cool to know that BS4 is built into Pythonista but... it doesn't solve the problem !
I can't remove bs4 with pip so... I don't know what to do.
For those who will find that thread and want an clear answer : reinstall pythonista.
Reinstalling Pythonista works, but it's probably a bit overkill. If a module installed with Stash pip causes problems, it's normally enough to delete the module from site-packages and restart Pythonista, so that Pythonista's built-in version of the module is used instead. If that doesn't help, you can also try deleting everything from site-packages and then restart Pythonista - that will have a similar effect as reinstalling Pythonista, but you won't lose all of your data.
Some how its not said directly here ( at least from what I can see). But normally in StaSh, pip remove 'module' works. Granted, i does not remove dependencies that were installed. Anyway, if I screw up something like this, then In StaSh, I will do pip remove <package>, then do pip list to see if it has been removed. Then do a hard restart on Pythonista. In the past I have forgotten to do a hard restart, after using the pip remove cmd. Even though it looks like the new version is installed, the old module is still in memory and being used. Well at least that has been my experience