Dec-27-2016, 09:35 AM
So I have Ubuntu and I wanted to try Python 3.6, so I installed it using "apt altinstall" command.
After playing around with it, I decided to see how it executes my earlier scripts and opened a webscraper of mine, which uses requests and beautifulsoup.
And problems appeared. Python 3.6 does not see the "requests" module. The module is located in the folder "/usr/lib/python3/dist-packages/" which by default is not a part of Python 3.6's sys.path. After some googling around I still don't know how to make python 3.6 permanently know that libraries should be sought in that folder.
Okay, so I added to my script the line "import sys; sys.path.append('/usr/lib/python3/dist-packages/')" which solved the problem (in a rather ugly way), but now another problem appeared: beautifulsoup does not know what lxml is anymore.
I am at a loss. What I am supposed to do with those problems?
After playing around with it, I decided to see how it executes my earlier scripts and opened a webscraper of mine, which uses requests and beautifulsoup.
And problems appeared. Python 3.6 does not see the "requests" module. The module is located in the folder "/usr/lib/python3/dist-packages/" which by default is not a part of Python 3.6's sys.path. After some googling around I still don't know how to make python 3.6 permanently know that libraries should be sought in that folder.
Okay, so I added to my script the line "import sys; sys.path.append('/usr/lib/python3/dist-packages/')" which solved the problem (in a rather ugly way), but now another problem appeared: beautifulsoup does not know what lxml is anymore.
Quote:bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
I am at a loss. What I am supposed to do with those problems?