Install gplearn - python

I try to install GPLearn to run in Python.
I have used pip to install GPLearn by the command:
pip install gplearn
Everything seems to work fine
When starting a new python project in VS2019 and running the code
import gplearn
print('ok')
This gives the error No module named 'gplearn'.
Tried the exact same approach with Scikit-learn and it worked just fine.

It's likely the version of pip used to install gplearn is not the same version of python you are using in VS2019.
Try the top answer found here: "ImportError: No module named httplib2" even after installation

Related

how i can i solve no module named can error?

hello i'm using python 3 and ros noetic, and i got this error
import can
ImportError: No module named can
I've got this error before, and I solved it through a very simple can-bus related installation command in google. But I can't find that command now
I've tried all the like $ sudo apt install python3-can.
but I can't fix it at all
thank you................
The problem is, that the module can't be found by your python.
first, try to remove the package with:
pip uninstall python-can
and re-install it with
pip install python-can
In case you have several versions of python installed (such as python2 and python3) make sure, you use
pip3
instead of pip.
Next you can try to manually search your package directories for the package, if it is even there.
Try cloning the library with git and running the setup.py installation, worked for me.

Importing does not seem to work python and returns "ModuleNotFoundError" even though module is installed

Currently I'm trying to install tensorflow with pip, I've used the following command to install it with:
pip3 install --user --upgrade tensorflow which after installing returns Successfully installed tensorflow-2.5.0. But when I install I get a lot of notices "Requirement already satisfied" but I'm unsure if this is normal or not.
I have a following local python file on my Windows 10 computer called test.py and inside is a simple import
test.py
import tensorflow as tf
When I run python I get the following error:
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
When I run pip3 list I can see that the module tensorflow is there, but importing it does give the error. It seems to happen with other modules too, as I've tried installing pymongo and it gave me the same error.
What I've tried
Uninstalling, re-installing python
Uninstalling and re-installing tensorflow
Python3 version: 3.9.5
Pip3 version: 21.1.1
I would try python3 -m pip install tensorflow. Running pip as a module ensures the versions are the same and can help with compatibility.
Most probably you have installed tensorflow on python3(guessing after seeing pip3 command) but you are running script on python2 (guessing after seeing "When I run python").
Assuming you aren't using virtualenv
Try running
python3 test.py
If this didnt help then try below command.
python3.x test.py # where x could be your minor version Ex: python3.6/python3.7

No module named 'cv2' even after successfully installing it using pip

I am working on ssd - tensor flow project. For which I have to use cv2.
I am able to import it in Jupyter notebook as well as in terminal too.
On running the following command
print cv2.__version__
I am getting output:-
3.4.1
which surely means its installed successfully. (I used sudo pip install opencv-python command to install and had tried brew install as well to resolve the issue) , but still when I run my example.py files using terminal commands. they are giving the following error
No module named 'cv2
I had tried every possibility (by searching for every related issue but still not able to resolve it). Please help.
This worked for me:
sudo apt-get install libopencv-dev python-opencv

No Module named "sklearn"

I am trying to import 'sklearn' using Python 3.4.3 on a Raspberry Pi 3 running Raspian.
I downloaded microconda3, which includes all the necessary modules to use scikit.
However, when I attempt to import 'sklearn' in IDLE, I receive an error stating that there is no module named 'sklearn'.
Try starting fresh and reinstall all of the necessary modules through miniconda3. Maybe the scikit-learn included on that install did not work.
You can then try
sudo apt-get install python3-scipy python3-sklearn
You can install the module with the following command using pip:
pip install -U scikit-learn.
See: Scikit-learn Docs

Why ImportError: No module named lightgbm

My OS is Ubuntu, and I've followed the official installation guide to install lightgbm. However, when I import it, this error is raised:
ImportError: No module named lightgbm
How can I solve this?
Do I also need to go to /python-package folder to run setup.py after running those linux commandlines?
I had the same problem, and solved running the installation directly on the notebook
!pip install lightgbm
Besides running those linux command lines. I also need to go to /python-package then run 'python setup.py install'.
conda install -c conda-forge lightgbm solved the problem for me
you need just run in a notebook cell before importing
For Windows users, VC runtime <https://go.microsoft.com/fwlink/?LinkId=746572> is needed if Visual Studio (2015 or 2017) is not installed.
Install wheel <http://pythonwheels.com> via pip install wheel first. After that download the wheel file and install from it:
pip install lightgbm
The following should do the trick:
export PATH=/usr/local/bin/anaconda3/bin${PATH:+:${PATH}}
PYTHONPATH=$PYTHONPATH:/usr/local/bin/anaconda3/lib/python3.6/site-packages
Note that you might need to change the paths if you are using a different Python version.
Thank you for above question and answers, had a similar issue.
Problem:
After successfull install of lightgbm, I was getting the error ImportError: No module named 'lightgbm' (in Jupyter Notebook on Google Cloud's Notebook Instance in AI Platform project).
Issue:
Realized that the install of lightgbm was in Python 2.7 even when the notebook was running in Python 3 (path: './.local/lib/python2.7/site-packages').
Solution:
The error was gone after the Jupyter Notebook was set to run on Python 2 instead of Python 3.
within Jupyter Notebook cell is: try running
import sys
!{sys.executable} -m pip install lightgbm
With python try, from pypi.org, this line
pip install lightgbm
or
pip3 install lightgbm
Also, you can try this one if you use anaconda
conda install lightgbm

Categories

Resources