Trouble installing scikit-learn on Windows 7 machine - python

I installed sci-kit learn with the installer scikit-learn-0.13.1.win32-py2.7.exe but when I try to call it in Canopy and iPython I get the following error: "ImportError: No module named sklearn".
I tried the following solutions found online but non of them work
Running python setup.py install in the directory and got this error: "ImportError: no module named sklearn._build_utils"
Tried pip install - U scikit-learn but the download keeping on timing out
Tried easy_install - U scikit-learn but the download also kept on timing out
I'm wondering if it is because I am using Canopy (Free version) and I should maybe uninstall it and install all my packages again using vanilla Python.
Thanks.

Have you tried adding sklearn to your python path manually? Have a look at this thread, it might help!
How to add to the pythonpath in windows 7?

Related

I installed the pandas package and I'm still getting the same error: No module named 'pandas'

input:
import pandas
output:
ModuleNotFoundError: No module named 'pandas'
I installed the package with the command line - pip3 install pandas,
my python version is 3.10.7
The source of the installed panda package: c:\users\kfirs\appdata\local\programs\python\python310\lib\site-packages
not sure if this will help but in the command prompt type pip --version check to make sure you're on a version that is fluent with pandas, don't know much about pandas but I assume you should try and do the same with pandas. My knowledge is limited but try installing on the same drive as python as this could possibly be why things are not working. 3rd sometimes I have issues with windows after installing pip packs so try restarting your pc sometimes my imports right after installing don't work and this usually fixes but only if it's truly installed where it needs to be and the version needed. Hope I could help.

Having issue importing requests and I assume it's my python runtime not being set correctly

Probably stupidly I tried to install the latest version of Python, in this case using the download from python site, but after doing that I was then getting python still running on the previous version python-3.6. I'm on OSX and was using sublime.
So I have been trying to work out how to update it to use the newest version. I've followed; https://opensource.com/article/19/5/python-3-default-mac.
All of the responses to queries now point to the python-3.9.5 version. So that's great and my runtime is using that. However after installing the requests using pip install I get the following error when running.
import requests
ModuleNotFoundError: No module named 'requests'''
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
I stumbled upon Modules are installed using pip on OSX but not found when importing which I have been trying to work through.
I have been able to run the import command successfully in terminal, however it's intermittent as I've tried again and it's broken, so I'm lost. I'm running it something trying to run the python3.6 version, which after updating I followed these instructions to remove when I have uninstalled that from my mac https://www.macupdate.com/app/mac/5880/python/uninstall.
If there is any ideas, would love some help, mainly to try and tell me what that error message is telling me.
In particular, what does this mean?
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.6/
I should clarify too; when I run 'pip list'
I see
requests 2.25.1
Assuming that you are not installing requests package properly, and assuming your python executable is named python:
python -m pip install requests
If however, your python executable is named something else instead, e.g. python3, replace python with that name:
python3 -m pip install requests

Importing matplotlib returns "ModuleNotFoundError" after installing matplotlib with pip

I'm trying to display data using a pie chart in python, so i tried to install matplotlib using pip. After doing that, I tried importing matplotlib but I get an error: ModuleNotFoundError: No module named 'matplotlib'.
In the Command Prompt I typed 'pip install matplotlib' and everything appeared to be successful. This is the last line:
Successfully installed backports.functools-lru-cache-1.5 cycler-0.10.0 kiwisolver-1.0.1 matplotlib-2.2.4 numpy-1.16.2 pyparsing-2.3.1 python-dateutil-2.8.0 pytz-2018.9 six-1.12.0
I've also tried 'python -m pip install -U matplotlib', but I still get a ModuleNotFoundError.
I've tried running the input statement in both python 3 and 2, neither worked.
I've looked at various different discussions on this, and none of them seemed to help me. How can I fix this?
There are various python installed in your OS. If you install matplotlib for somewhere the python that you are using does not search, you get importing errors. You should figure out which python you want to use and where the packages it searches.
check your python path. the matplotlib should be installed in the same path with your python environment.
I guess you use an IDE to run the python. some IDE have their own python environment.
if not solved. plz introduce some details about your system、how installed etc.

Unable to use pymssql in Python 3.5

I have installed pymssql using pip however It is never found when I try to import into a project.
I get the error, No module found 'pymssql'
I have attempted to copy the .pyd file (pymssql-2.1.2-cp35-cp35m-win_amd64.pyd) to the project directory and this is still a problem
So. just using...
import pymssql
...results in the module not being found, If I try to reinstall through pip it states it is installed and requirement is already satisfied.
How can i get this useable
I am using Python 3.5 and Windows 10
Python is installed in Appdata/Local/Programs/Python35
Modules are installed Appdata/Roaming/Python35/site-packages/
Installing the .whl file manually from the Pymssql website resolved the issue and allowed me to use the module in my project!

Installed external package (via pip) in Enthought Canopy now import throws ImportError: cannot import name scimath

I was trying to use the lmfit package for doing nonlinear least squares fit and I notices that the Canopy curated version is really old and doesn't have most of the objects. So I followed the instructions here https://support.enthought.com/entries/23389761 as I have done before no problem:
pip install --upgrade setuptools
pip install --upgrade lmfit
Now when I execute the same exact code some "import" statements (I suppose those involved with scimath) give:
ImportError: cannot import name scimath
Seems python standard library imports are fine e.g. import os.
I'm on Ubuntu Linux 14 with Canopy 1.5.2
What happened and how can I fix it and avoid breaking it again.
I solved the problem but I am still not sure why this occurred originally. I went into the package manager and uninstalled scimath reinstalled it and did explicit kernel restarts on my IPython notebooks and interpreters. This fixed it but I don't see why unless somehow the scimath installation was corrupted. Before that I tried restarting application, computer, and reinstalling canopy.

Categories