I'm getting an error when importing the skbio package on Google Colab. The error message is related to SpearmanRConstantInputWarning of the scipy.stats package. What should I do to solve this problem?
I've tried to uninstall and install skbio and scipy, but it has not worked.
Seems to be some issue with the version. If you run
pip install scikit-bio==0.5.6
it shouldn't show that problem, at least it worked when I tried for 0.5.6 and 0.5.5 in Colab.
I had a similar problem, but could not downgrade to scikit-bio==0.5.6 as it conflicted with my Python version (3.10). An alternative workaround is downgrading scipy:
conda install -c conda-forge scipy=1.8
Presumably which package to downgrade will depend on your circumstances.
(Would have added as a comment to 3991santiago's answer but I do not have the reputation)
Related
The statement is:
from tensorflow.python.trackable import base as trackable
But the module not found error is coming up.
##### File "C:\Users\mahit\anaconda3\lib\site-packages\keras\dtensor\lazy_variable.py", line 26, in <module>
from tensorflow.python.trackable import base as trackable
ModuleNotFoundError: No module named 'tensorflow.python.trackable'
The piece of code is inside keras library. I dont understand why this module not found error is coming up. Becase this is a code that came with the package. Also not sure what trackable does. Please help me resolve this.
The solution for me was to install keras in version 2.9.0
pip install keras==2.9.0
I got rid of this error: uninstall tensorflow and install tf-nightly. Nevertheless, I got another error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
In python code, with Linux OS, that error could be solved by using command: os.environ['XLA_FLAGS'] = '--xla_gpu_cuda_data_dir=/usr/lib/cuda/'
I had the same problem for the past one month and I was not able to resolve it. Then finally I just uninstalled tensorflow and installed tf-nightly with immediately resolved the issue.
The issue occurs as tensorflow recently moved the keras out of the default package and now is only available through the tf-nightly install.
Hope this resolves the issue
I have the same issue and have been check the current dir of tensorflow, the trackable folder does not exist.
So here is an easy way.
Git clone from the url: https://github.com/tensorflow/tensorflow
Find the tensorflow -> python -> trackable
Copy the trackable folder to your tensorflow install dir (For example: C:\Users\xxxx\anaconda3\Lib\site-packages\tensorflow\python).
Uninstall tensorflow using pip uninstall tensorflow and install pip install tf-nightly
This fix worked for me perfectly well.
I just got this error in CI builds with a requirements.txt that had
keras
tensorflow==2.9.1
and I assume the error was caused by pip install -r requirements.txt taking the recently released Keras 2.10 version, which probably assumes it's running next to TensorFlow 2.10, and that the minor mismatch led to this import error.
this is the code. im executing this using spyder. and tried many versions of tensorflow but unable to solve this
this is the error im getting. before i was gettng import error cannot import 'load_img'
I had a similar problem. I had tensorflow 2.6.0 installed but tensorflow-estimator 2.10.0. The problem was solved by downgrading tensorflow-estimator:
pip install --upgrade tensorflow-estimator==2.6.0
Download tensorflow before running your code.
pip install tensorflow
I am Windows and using python through jupyternotebook.
python 3.9.7, windows 64 bit,
I want to import geopandas, so I used the code conda install --channel conda-forge geopandas. It seemed work at first because I could successfully import geopandas without error, but when I want to run the following code, an import error appears.
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
world.columns
ImportError: the 'read_file' function requires the 'fiona' package, but it is not installed or does not import correctly.
Importing fiona resulted in: DLL load failed while importing ogrext
I saw other people asked the same questions, but none of their solutions worked. At first, I saw someone said nstalling geopandas by condas might installed wrong version of fiona and gdal. So I tried to update by conda update conda, and conda update -n base conda-package-handling and conda update --all. However, these code didn't work. Later, I directly installed the .whl file from python library: Fiona-1.8.20-cp39-cp39-win_amd64.whl and GDAL-3.4.1-cp39-cp39-win_amd64.whl, and use pip to install them. But the error still appeared.
I really have no idea how to deal with such issue, is it because the version of fiona and gdal was not consistent? Please give me some suggestions, thanks ahead!
I have solved this problem by creating a new environment followed this article: https://medium.com/analytics-vidhya/fastest-way-to-install-geopandas-in-jupyter-notebook-on-windows-8f734e11fa2b
This is the fast way to solve this problem.
Pystan has been installed successfully on EMR nodes (master, task and core nodes), but I still get this error
ModuleNotFoundError: No module named pystan
I installed pystan using pip install pystan through boostrap_scrtip_actions.
Does anyone know what could be the issue?
I use Python 3.7, emr 6.3.0.
Found the issue, posting the answer here for others.
When installing the pystan without specifying the version, it installs the latest version and in the latest version of pystan, it uses stan as the main module and not pystan.
To resolve the issue, specify your version or use import stan instead.
Refer to the latest pystan doc https://pypi.org/project/pystan/
I am trying to use Xgboost in GCP datalab. I have already installed sklearn but I keep getting the error :
" XGBoostError: sklearn needs to be installed in order to use this
module"
Below is the code I used:
import sklearn
!pip3 install xgboost
from xgboost.sklearn import XGBClassifier
model = XGBClassifier()
I have tried using Python v 2.7 instead, but no luck...does anyone know how to solve this issue in GCP Datalab?
I also faced the same issue, on python 3.7 32bit on ipython.
Solution: Uninstall the xgboost package by pip uninstall xgboost on terminal/cmd. Cross-check on the your console if you cannot import it. Now again install xgboost pip install xgboost or pip install xgboost-0.81-cp37-cp37m-win32.whl, given that you have already installed sklearn, it will work on newer console session.
xgboost wheel Link: https://pypi.org/project/xgboost/#files
I got the same error with a more complicated project, after releasing a new version suddenly it failed.
luckily in my case, I had docker images for each version, and was able to use pip freeze to see what changed.
In both version I used xgboost==0.81
In the version that worked I had scikit-learn==0.21.3 and in the new version it was scikit-learn==0.22
surprisingly enough, that's now what caused the issue. I've tried to uninstall xgboost like it was suggested here and reverted scikit-learn to the version is was originally on, and still no luck.
what did cause the issue was an update of numpy from 1.17.4 to 1.18.0.
reverting it solved it for me (not sure why)
this was python 3.6 on ubuntu
For me un- then re-installing first sklearn and then xgboost did the trick