Installation always stuck on PyCaret 2.2.2 + Package problems - python

I'm stuck on an issue that I can't seem to solve. I was fine using PyCaret on my other PC and had recently got a new desktop.
I was working on one dataset on my old PC and had no problems with setup() and PyCaret preprocessed my data without any issues. When I worked on my the same dataset with my new desktop and Jupyter newly installed, I noticed I ran into an ValueError: Setting a random_state has no effect since shuffle is False. You should leave random_state to its default (None), or set shuffle=True. I thought it was strange but went on to set fold_shuffle=True to get through this.
Next, I encountered AttributeError: 'Simple_Imputer' object has no attribute 'fill_value_categorical'. It seems I'm getting failures at every step of setup(). I went through the forums and found a thread where at the bottom of it, #eddygeek mentioned that PyCaret was set up to fail if the sklearn version is wrong. This got me looking into the packages I have that may meet dependencies between packages.
I noticed the following issues:
I get several errors:
ERROR: Command errored out with exit status 1: C:\Users\%%USER%%\anaconda3\python.exe'
Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment
ERROR: Could not find a version that satisfies the requirement scikit-learn==0.23.2
Screenshot of more errors attached
Jupyter Notebook fails to launch because of Pandas Profiling Import Error: cannot import name 'soft_unicode' from 'markupsafe'. I got around this by installing markupsafe===2.0.1 but this leads to incompatibility warning by pandas-profiling 3.2.0 saying it needs markupsafe 2.1.1
PyCaret keeps getting installed as 2.2.2 version. I think that's why it keeps looking for scikit-learn 0.23.2 when the latest PyCaret 2.3.10 works with scikit-learn >=1.0. I've tried uninstalling and reinstalling PyCaret several times but it's still the same.
What I've done
I'm on Python 3.9.12 that was installed together with Anaconda3. My PyCaret was installed with pip install pycaret[full] --user on Anaconda Prompt.
In my pip list, I have:
scikit-learn 1.1.2
markupsafe 2.1.1
pandas-profiling 3.2.0
pycaret 2.2.2
I've added C:\Users\%%USER%%\AppData\Roaming\Python\Python39\Scripts to PATH
I'm really at my wits end so I hope I can get some advice on this. Thank you.

I've encountered the very same issues and solved as follows.
According to the documentation, there are a few problems with your setup:
PyCaret is not yet compatible with sklearn>=0.23.2
PyCaret is tested and supported on the following 64-bit systems:
Python 3.6 – 3.8
Python 3.9 for Ubuntu only
So if you're using python 3.9 on Windows, I'd start with that.
I went into a rabbit hole of downgrading the packages and getting one error after another.
Long story short, the setup that finally worked was:
sklearn 0.23.1
scipy 1.5.2
Both installed on a virtual conda environment but at the end I had to run:
pip3 install pycaret[full]
Notice pip3 intead of pip because I was getting permission errors.

You are using a very old version of pycaret which does not work in Python 3.9. Please install the latest version in a fresh (conda) environment. Make sure it is a new environment in order to avoid any package issues.
# This installs the pre-release 3.0.0 release which has reduced dependencies.
pip install --pre pycaret

Related

Pip Errors Out When Installing Anything

I've run into an odd issue where pip just won't work. I'm using the latest version of PyCharm, and I've tried both Python 3.8.10 and 3.9.6.
I've done clean installations of both, removed from PATH, reinstalled with new installer, reinstalled pip, etc.
The error code I run into appears no matter what library I am trying to download. I've tried PyAudio, PyGame, OpenCV-Python and others.
Pip was working fine a couple days ago, and no changes have been made to any files in that time.
Attempting to run pip install --upgrade pip does not have an effect.
I've been running off virtual enviroments with setuptools 40.8.0 and pip 21.1.3 installed.
The full error for installing PyAudio can be seen here: https://pastebin.com/iQmZwsRv
PyGame error: https://pastebin.com/WEF8uM2d
OpenCV-Python Error: https://pastebin.com/LuZq99Cu
Py- audio - it's not compatible with your Py charm I suppose due to the latest install updates, try to install it on the main environment. Also, try to downgrade your version of python as many dependencies are not compatible with your version of python as stated by error[it is not compatible with this Python]
Open Cv - Fails to build the wheel package as it is attributed also in error [CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.]
May I know what build tool are you using?

Installing Tensorflow on mac m1

I am using PyCharm and in the Python Interpreter I install my packages. In other words
In Pycharm: from Python 3.9 venv --> Interpreter Settings --> Install Package: Tensorflow (+) --> Search for Package --> Install
I almost got anything I want (numpy, scipy, pandas, even torch!). However, I tried to install Tensorflow and I get the following ERROR:
ERROR: Could not find a version that satisfies the requirement tensorflow
ERROR: No matching distribution found for tensorflow
So, I tried using the shell and it is already installed in my pip list with the version 2.4.0 as of today.
Since I am using a virtual env in PyCharm, is there a way that I can solve the error and have the package installed? OR how can I migrate the installed packages from my pip to this venv?
If you are an M1 user you would already know that working on apps is a headache with the new silicon apple Mac.
I look forward to some help and suggestions.
Thanks!
Basically, at the time of posting this issue, tensorflow does not support Python 3.9 and only works for 3.8.
Further details are provided #47151

Anaconda installing tensorflow and fancyimpute

As a premise, I would specify that I am new to Python, so please forgive eventual inaccuracies.
So, I have recently installed Anaconda, and updated the Python version to 3.7.1.
In order to impute some missing values in my dataset using KNN, I've found a useful function in a package called fancyimpute.
However, such package is not among those already available (that is, from Spyder, the IDE I'm using, I cannot simply import it), so I need to install it.
Opening, as such, the Anaconda prompt and typing "conda install fancyimpute" doesn't work, returning the following:
"PackagesNotFoundError: The following packages are not available from current channels:
fancyimpute
Current channels:
(here a list of some channels)
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page".
Going, therefore, with "pip install fancyimpute" (although to me it's still not clear the difference between conda install and pip install) after a while I obtain the following:
"Collecting tensorflow (from fancyimpute)
Could not find a version that satisfies the requirement tensorflow (from fancyimpute) (from versions: )
No matching distribution found for tensorflow (from fancyimpute)"
I have therefore now run "conda install tensorflow", and is already about 30 minutes that is Solving environment.
What can I do? How can I obtain the desired package and avoid similar problems in future? Many thanks and hope I was clear in exposing the problem.
UPDATE: https://anaconda.org/search?q=fancyimpute From here, it seems that fancyimpute isn't available on my platform, w-64. How can I overcome this problem?
SOLVED: Apparently, I have solved the problem.
I have first created an ad hoc environment and installed tensorflow using conda.
Then, I have pip installed fancyimpute: at this point, got a couple of new errors ("Failed building wheel for fastacache", and same for cvxpy), both solved installing Microsoft Visual C++ Build Tools. So, finally, I have been able to install also fancyimpute.
Nonetheless, at this point, I coulnd't import it (ImportError: DLL load failed: The specified module could not be found. Failed to load the native TensorFlow runtime). After uninstalling and reinstalling tensorflow using conda-forge as channel, now it works.
User brittainhard on anaconda.org had the same idea. To use his/her version of the library (hosted on anaconda.org):
conda install -c brittainhard fancyimpute

Pip3 installing of Tensorflow issue

I'm trying to install python and tensorflow to learn as part of a class I am taking, and am having some issues installing tensorflow. I keep getting the same set of errors:
C:\Users\X\AppData\Local\Programs\Python\Python36-32\python.exe: can't find '__main__' module in 'C:\\'
or
Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow
I've tried uninstalling and reinstalling python while adding it to my path, and that solved me not being stuck with syntax errors (most of the time), but I haven't been able to make any progress. Any advice on moving forward would be appreciated.
To be clear, I am typing the following command into my command prompt:
pip3 install --upgrade tensorflow
As per the instructions on the TensorFlow website - I've been finding the "C:\>" raises a syntax error however.
your pip3 is broken, because I can clearly see tensorflow distribution on PyPi for python 3.6 https://pypi.python.org/pypi/tensorflow/1.5.0. Also, I just created a new virtual env for python 3.6 and I am able to pip install it.
Also you can download manually the "tensorflow-1.5.0-cp36-cp36m-win_amd64.whl",assuming you have windows, and pip install tensorflow-1.5.0-cp36-cp36m-win_amd64.whl

AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'

I am trying to develop some time-series sequence prediction, using the latest resources available. To that end, I did check the example code from TensorFlow time-series, but I'm getting this error:
AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'
I'm using Anaconda. The current environment is Python 3.5 and TensorFlow 1.2.1. Also tried TensorFlow 1.3, but nothing changed.
Here is the code I'm trying to run. I did not find anything useful related to the issue on Google. Any ideas on how to solve it?
As Conan.Net wrote:
I tried to remove/clean some environments from anaconda and install
all again and it work this time.
This solution worked for me as well, so though not ideal, it will solve the problem. If you are using anaconda, it might happen when installing some packages and then removing them (e.g. tensorflow vs tensorflow-gpu) leaves some dependencies hanging. In my case, I used:
conda remove --name py2_tf_gpu --all
then
conda create --name py2_tf_gpu python=2 anaconda pandas numpy scipy jupyter
source activate py2_tf_gpu
pip install --ignore-installed --upgrade tensorflow-gpu
pip currently installs a later(1.4) than anaconda(1.3) version and I had need for it.
Maybe the version of tensorflow doesn't match the version of keras.
Using a lower version of keras solve this problem

Categories

Resources