DeprecationWarning when importing Scikit-learn - python

I'm using JupyterLab.
When importing some packages, or executing some functions from scikit-learn,
very long list of deprecation warnings fill the screen.
I googled about this problem and upgraded the packages (scikit-learn, numpy), but I still get the warnings.
pip install scikit-learn --upgrade
Requirement already satisfied: scikit-learn in c:\users\...\appdata\local\programs\python\python39\lib\site-packages (1.0.2)
Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\...\appdata\local\programs\python\python39\lib\site-packages (from scikit-learn) (3.0.0)
Requirement already satisfied: joblib>=0.11 in c:\users\...\appdata\local\programs\python\python39\lib\site-packages (from scikit-learn) (1.1.0)
Requirement already satisfied: numpy>=1.14.6 in c:\users\...\appdata\local\programs\python\python39\lib\site-packages (from scikit-learn) (1.22.1)
Requirement already satisfied: scipy>=1.1.0 in c:\users\...\appdata\local\programs\python\python39\lib\site-packages (from scikit-learn) (1.7.2)
Some say that these are not problems because they are just warnings and not harmful.
But it's very annoying. How can I solve this problem?

Related

'No module named 'webdriver_manager'' after reinstalling, checking library correctness

When I want to
from webdriver_manager.chrome import ChromeDriverManager
I get ModuleNotFoundError. I have uninstalled and installed again using pip3, and chekced the previous related questions here about the same matter, but still can't figure it out. Below are the installation details.
C:\Users\eywy0>pip3 install webdriver_manager
Requirement already satisfied: webdriver_manager in c:\users\eywy0\anaconda3\lib\site-packages (3.7.1)
Requirement already satisfied: requests in c:\users\eywy0\anaconda3\lib\site-packages (from webdriver_manager) (2.27.1)
Requirement already satisfied: python-dotenv in c:\users\eywy0\anaconda3\lib\site-packages (from webdriver_manager) (0.20.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\eywy0\anaconda3\lib\site-packages (from requests->webdriver_manager) (1.26.9)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\eywy0\anaconda3\lib\site-packages (from requests->webdriver_manager) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in c:\users\eywy0\anaconda3\lib\site-packages (from requests->webdriver_manager) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\eywy0\anaconda3\lib\site-packages (from requests->webdriver_manager) (2021.10.8)
Any clue on what might have gone wrong? Thanks for any help!!

ModuleNotFoundError: No module named 'wikipedia'

I am trying to make a line of code, that searches Wikipedia for information. Here's my code:
import wikipedia
print(wikipedia.summary("Wikipedia"))
I have used the same module in the past, with no problem. Now here comes the error. When I run this SIMPLE 2 lines of code, I get: Modulenotfounderror: No module named: "wikipedia"
Yes, I have tried pip install wikipedia, and pip3 install wikipedia and it says:
Requirement already satisfied: wikipedia in c:\users\dinoh\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (1.4.0)
Requirement already satisfied: beautifulsoup4 in c:\users\dinoh\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from wikipedia) (4.10.0)
Requirement already satisfied: requests<3.0.0,>=2.0.0 in c:\users\dinoh\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from wikipedia) (2.27.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\dinoh\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (1.26.8)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\dinoh\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\dinoh\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\dinoh\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (2.0.10)
Requirement already satisfied: soupsieve>1.2 in c:\users\dinoh\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from beautifulsoup4->wikipedia) (2.3.1)
I don't know what to do.
Alrighty, so the fix for my own question was that I needed to use the correct version of python. So I just installed a slightly older version of python (3.9) as I was using 3.10 currently, and then swapped the version of python I was using in vscode. Worked like a charm. If you're feeling lazy, you can also download the version you need off of the Microsoft store like I did. :)
Click here for image cause I don't have embed perms yet lol

Could not find a version that satisfies the requirement statsmodels.api [ Python ]

When I try pip install statsmodels.api command,
I had these errors
ERROR: Could not find a version that satisfies the requirement statsmodels.api (from versions: none)
ERROR: No matching distribution found for statsmodels.api
Python version is Python 3.8.5
C:\Windows\system32>pip install statsmodels
Requirement already satisfied: statsmodels in c:\python38\lib\site-packages (0.12.0)
Requirement already satisfied: numpy>=1.15 in c:\python38\lib\site-packages (from statsmodels) (1.19.1)
Requirement already satisfied: patsy>=0.5 in c:\python38\lib\site-packages (from statsmodels) (0.5.1)
Requirement already satisfied: pandas>=0.21 in c:\python38\lib\site-packages (from statsmodels) (1.1.2)
Requirement already satisfied: scipy>=1.1 in c:\python38\lib\site-packages (from statsmodels) (1.5.2)
Requirement already satisfied: six in c:\python38\lib\site-packages (from patsy>=0.5->statsmodels) (1.15.0)
Requirement already satisfied: python-dateutil>=2.7.3 in c:\python38\lib\site-packages (from pandas>=0.21->statsmodels) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in c:\python38\lib\site-packages (from pandas>=0.21->statsmodels) (2020.1)
I think you want this:
pip install statsmodels
You're trying to install one submodule of a Python module/package. You have to install the whole package.
If you've already done this, then you already have the statsmodels.api module and don't have to install anything else.
I do not know how you have configured your environments (if you have many). but ensure that you install your package in the correct environment. However, please try the following for me:
conda install -c anaconda statsmodels

Issues importing pandas and matplotlib in anaconda spyder

I tried installing pandas and matplotlib using the pip-command in Anaconda prompt
pip install matplotlib and it gave me the following:
Requirement already satisfied: matplotlib in c:\programdata\anaconda3\lib\site-p
ackages (3.1.3)
Requirement already satisfied: python-dateutil>=2.1 in c:\programdata\anaconda3\
lib\site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\pr
ogramdata\anaconda3\lib\site-packages (from matplotlib) (2.4.6)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\programdata\anaconda3\lib
\site-packages (from matplotlib) (1.1.0)
Requirement already satisfied: cycler>=0.10 in c:\programdata\anaconda3\lib\site
-packages (from matplotlib) (0.10.0)
Requirement already satisfied: numpy>=1.11 in c:\programdata\anaconda3\lib\site-
packages (from matplotlib) (1.18.1)
Requirement already satisfied: six>=1.5 in c:\programdata\anaconda3\lib\site-pac
kages (from python-dateutil>=2.1->matplotlib) (1.14.0)
Requirement already satisfied: setuptools in c:\programdata\anaconda3\lib\site-p
ackages (from kiwisolver>=1.0.1->matplotlib) (45.2.0.post20200210)
And when trying to import in Spyder, it says no module found.
What should I do? Thanks in advance.
Make sure your spyder points to your anaconda environment. Currently it is not pointing to your anaconda env that is the reason you are getting this error.

I cant'g get virtualenvwrapper to inbstall on Ubuntu where it needs to be

I have followed the instructions to the letter on the website. The problem is inconsistency where things end up. When I type:
which virtualenv
I get back
/usr/local/bin/virtualenv
which looks OK to me (I am not a unix expert). But after doing
pip install virtualenvironmentwrapper
I get this:
Requirement already satisfied: virtualenvwrapper in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: virtualenv-clone in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied: stevedore in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied: virtualenv in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /usr/local/lib/python2.7/dist-packages (from stevedore->virtualenvwrapper)
Requirement already satisfied: six>=1.9.0 in ./.local/lib/python2.7/site-packages (from stevedore->virtualenvwrapper)
What do you do to fix this?
It rurns out warpper is not that much more useful. However, the original problem was never resolved.

Categories