ImportError: cannot import name make_pipeline - windows

I keep getting and error when trying to test machine learning code on Python http://scikit-learn.org/stable/auto_examples/feature_selection_pipeline.html#example-feature-selection-pipeline-py.
I'm using windows 8.1. I've downloaded spyder and anaconda with python version 2.7.
I can run other examples fine, but whenever something uses pipe I get the error:
ImportError: cannot import name make_pipeline.
I'm using the latest development version of scikit-learn.

Related

Pycharm doent recognize numpy package from previously created conda environment

im using Pycharm 2022.2.3.
I have Anaconda Navigator 2.3.2. Created in anaconda a new virtual environment based on python 2.7 called testpy2. Added the numpy package needed to execute a code. I did it from Ananconda Navigator GUI. The installation was succesful. I could see now numpy in my installed package list.
Open Pycharm project, select as interpreter the existing conda environment test2py.
The code is:
import random
import numpy as np
print "Hola"
The problem is it give the error: ImportError: DLL load failed when importing Numpy.
So I cant execute the program because of numpy.
When i go to see the packages something similar to:
then i got stuck in loading. Pycharm should recognize and load all the packages in the conda environemnt as shown in the image above, but in my case i got stuck in loading.
Im running on Windows 10 and i dont have any python installed at all
Any help would be apreciated.

shiboken2 & PySide2 issues

I get this error when trying to run a PyQt5 Application, I keep getting it and I think it's when I use pyuic5 to export code from QT Designer and then try to run it.
from .shiboken2 import *
ImportError: DLL load failed: The specified procedure could not be found.
I have used pip freeze to find the versions of shiboken2 and pyside2 and they are both the same version.
I installed Python 3.7 + And it works.

Bug using Python 3.7 (from QGIS) and trying to install package with pip

I use QGIS 3.6 and Python 3.7 and I try to install a package with pip in command line tool under Windows 7 but I have the following message :
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x0000188c (most recent call first):
My path and PYTHONPATH are well configured with link to QGIS' Python folders. The problem appeared recently with use of Python 3.7.
At least for Mac recent QGIS versions seem to support only Python 3.6, not 3.7, see https://qgis.org/en/site/forusers/download.html

ImportError: No module named googlemaps

I've installed this package via pip27 on macports. My OS is OSX El Capitan 10.11.6. My python install is 2.7.10.
I'm trying to run an example script that imports googlemaps module, but I keep getting that ImportError. I have a feeling that it's how pip installed it and the reason why python can't find it, but I'm relatively new to pip so I don't know where to start investigating.
I also tried googling for a fix but no dice. Any idea what's happening here?
Here's my code:
import googlemaps # can't import
import argparse
from datetime import datetime
# collect args for lat, long, # of addresses, radius of search
parser = argparse.ArgumentParser(description='Randomize addresses on Google Maps')
parser.add_argument('-lt', '--latitude')
parser.add_argument('-lng', '--longitude')
parser.add_argument('-n', '--count')
parser.add_argument('-r', '--radius')
args = parser.parse_args()
print('Results: ', vars(args))
Error message:
Traceback (most recent call last):
File "randomize_addresses.py", line 1, in <module>
import googlemaps
ImportError: No module named googlemaps
Found a fix. I uninstalled googlemaps via pip and then reinstalled using easy_install. Apparently OSX doesn't like pip.
Looks like you used pre-installed python since you mentioned version 2.7.10 (default version shipped with macOS) which is located at /usr/bin/.
MacPorts installs binaries and libraries under /opt/local. Try to install python via MacPorts and run the program again. Python and pip should both be linked so that packages installed via pip is available to python.
In this case packages installed using pip27 would be available to python27 installed via MacPorts and not /usr/bin/python.
Another way would be to download get-pip.py and install it against /usr/bin/python (pip installation guide).
Note: Make sure you are using python installed via MacPorts. To check this run which python, it should show something like /opt/local/bin/python2.7

Error "matplotlib is not a package" on Mac problems

Getting the No module named 'matplotlib.pyplot'; matplotlib is not a package error when trying to run:
import matplotlib.pyplot
plt.plot([1,2,3,4],[4,7,8,12])
plt.show()
Im running python 3.3, and have installed the correct matplotlib, and six library. i have checked this by running pip list.
I have also tried running the file in terminal, and when i do this the error changes from matplotlib is not a module to no module named pyplot.

Resources