How to resolve: "ContextualVersionConflict" on Python? - python

I was trying to run scanpy's neighbors function with my genes expression dataset:
import scanpy as sc
sc.pp.pca(adata)
sc.pp.neighbors(adata)
and got this error:
C:\Users\User\anaconda3\lib\site-packages\numba\core\cpu.py:77: UserWarning: Numba extension module 'sparse._numba_extension' failed to load due to 'ContextualVersionConflict((llvmlite 0.33.0+1.g022ab0f (c:\users\User\anaconda3\lib\site-packages), Requirement.parse('llvmlite<0.38,>=0.37.0rc1'), {'numba'}))'.
numba.core.entrypoints.init_all()
I then Tried to update my llvmlite==0.33 version due to this error using
pip install llvmlite --upgrade
and got another error:
ERROR: -umba 0.50.1 has requirement llvmlite<0.34,>=0.33.0.dev0, but you'll have llvmlite 0.37.0 which is incompatible.
ERROR: Cannot uninstall 'llvmlite'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Python doesn't let me to upgrade llvmlite to the newer version and therefore I cannot use scanpy's functions. I tried to update numba, I tried to reinstall everything, but nothing worked.
What should be done in order to solve this problem?

Related

Importing pymc3 leads to the following error: 'TheanoConfigParser' object has no attribute 'gcc__cxxflags'

As the title already mentions, I am trying to import pymc3. However, I keep getting confronted with the following error:
TheanoConfigParser' object has no attribute 'gcc__cxxflags
At the top of the error message it reads:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The installed Theano(-PyMC) version (1.0.5) does not match the PyMC3 requirements.
It was imported from ['C:\\Users\\caspe\\miniconda3\\envs\\precourse\\lib\\site-packages\\theano']
For PyMC3 to work, a compatible Theano-PyMC backend version must be installed.
See https://github.com/pymc-devs/pymc3/wiki for installation instructions.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
According to the error message, it seems that I did not install the correct Theano version. So I uninstalled Theano and installed theano-pymc instead. I tried to uninstall and reinstall theano-pymc and pymc3 and also delete the directories after uninstalling, but the error remains.
How can I successfully import pymc3?

Can't Install latest Tensorflow versions

I tried installing Tensorflow using the pip install tensorflow, but I got this error code instead. I'll really use y'alls help
ERROR: Wheel 'termcolor' located at C:\users\user\appdata\local\pip\cache\wheels\b6\0d\90\0d1bbd99855f99cb2f6c2e5ff96f8023fad8ec367695f7d72d\termcolor-1.1.0-py3-none-any.whl is invalid.

Issues with Pandas and Numpy Version

I think have a whole mess of conflicts. I was attempting to run some code in a notebook and got the following message:
ImportError: this version of pandas is incompatible with numpy < 1.16.5
your numpy version is 1.16.2.
Please upgrade numpy to >= 1.16.5 to use this pandas version
I have version 1.2.2 of pandas installed.
I ran conda update numpy and still got the same error when I tried to run the notebook. I ran conda list and it says my version is 1.20.0 but if I run:
import numpy
print(numpy.version.version)
It says my version is 1.16.2. Running pip list it says my version is 1.16.2. I tried to force an upgrade by using pip install -Iv numpy==1.20.0 --force-reinstall and it returned the following error at the end of the install:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
target-encoding 0.5.0 requires numpy==1.16.2, but you have numpy 1.20.0 which is incompatible.
Successfully installed numpy-1.20.1
Yet it still says that my version is 1.16.2 and that pandas is still incompatible with numpy.
Thank you in advance for any help you can give me to resolve this quagmire.
Same issue here. Solved by reinstalling numpy a few times subsequently, until there is not any version of it installed. And then install again the version I needed.

How to resolve the ERROR: Failed building wheel for h5py

I am working on windows 7.
Currently I have tensorflow 2.4.1 and keras 2.3.1 installed in my laptop.
I have trained a model on coalab and saved t on my laptop. When I try to load it it gives error :
ValueError: Unknown layer: Functional
It may be due to difference in version of Keras. Google colab uses Keras 2.4.3.
When I tried to install keras 2.4.3 using command:
pip install Keras==2.4.3
I got the following error:
Loading library to get version: hdf5.dll
error: Unable to load dependency HDF5, make sure HDF5 is installed properly
error: Could not find module 'hdf5.dll' (or one of its dependencies). Try using the full path with constructor syntax.
ERROR: Failed building wheel for h5py
Failed to build h5py
ERROR: Could not build wheels for h5py which use PEP 517 and cannot be installed directly*.
I tried to install h5py as well but it gives an error too!
Please let me know if anyone has a solution for this.
while : h5py which use PEP 517 and cannot be installed directly, try this
pip install --upgrade pip setuptools wheel
or check the python version , for example h5py 2.6 only supports up to python 3.6 , look at this.

ImportError: No module named saml2.auth

I'm trying to build a SAML authentication mechanism in Python using the OneLogin module, but I keep getting this error: ImportError: No module named saml2.auth
I have followed the steps listed here:
https://github.com/onelogin/python3-saml
and installed dependencies as well but i can't install xmlsec library and it says Failed building wheel for xmlsec and failed with error code 1.
(I have done pip install wheel as well)
Any suggestions how to get around this error?
Solved by:
sudo pip install python3-saml
xmlsec (a dependency of python3-saml) had some installation issues on version previous of 1.3.5.
v1.3.5 solved those issues
All i needed was the latest version with everything fixed from here: github.com/mehcode/python-xmlsec/releases/tag/1.3.5

Categories

Resources