ImportError: No module named saml2.auth - python

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

Related

Can't install dbt-snowflake; "No module named 'cmake'"

(Context: Barely a novice at Terminal, know some SQL, don't know Python)
I'm taking a course on dbt, have my own Snowflake set up, and I'm trying to install dbt-snowflake on Mac. Attempting to run:
pip install dbt-snowflake
This fails, and it returns:
`
Traceback (most recent call last):
File "/Users/xxxx/course/venv/bin/cmake", line 5, in <module>
from cmake import cmake
ModuleNotFoundError: No module named 'cmake'
error: command '/Users/xxxx/course/venv/bin/cmake' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyarrow
Failed to build pyarrow
ERROR: Could not build wheels for pyarrow, which is required to install pyproject.toml-based projects
`
I once successfully changed Python version in virtual environment to 3.9 to see whether that was the problem (but I can't replicate how I changed it), that didn't solve the problem, and currently it's back to 3.11.
Have installed multiple versions of snowflake (3.7, 3.9, 3.11). I don't really understand how this works in context of everything.
I have tried deleting and recreating virtual environments (under same name, venv)
uninstalled and reinstalled cmake (pip install --upgrade cmake); this is version 3.25.0
I don't understand how I can have cmake installed and be told there is no module named 'cmake'.
Is there a particular version of Python I should be running, and if so, how do I reliably change that in virtual environments and different directories?
EDIT TO ADDRESS A COMMENT: I installed Python versions via terminal brew install python#3.9

ERROR: Could not build wheels for spacy, which is required to install pyproject.toml-based projects

Hi Guys, I am trying to install spacy model == 2.3.5 but I am getting this error, please help me!
Try using python 3.6-3.9 instead, where there are binary wheels for pip install to use instead of having to compile from source.
(This is a conflict with python 3.10 and some generated .cpp files in the source package. Python 3.10 wasn't released yet when this version was published.)
I had the similar error while executing pip install -r requirements.txt but for aiohttp module:
socket.c -o build/temp.linux-armv8l-cpython-311/aiohttp/_websocket.o
aiohttp/_websocket.c:198:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"
^~~~~~~ 1 error generated.
error: command '/data/data/com.termux/files/usr/bin/arm-linux-androideabi-clang'
failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for aiohttp
Failed to build aiohttp
ERROR: Could not build wheels for aiohttp, which is required to install
pyproject.toml-based projects
Just in case I will leave here solution to my error. This error is specific to Python 3.11 version. On Python with 3.10.6 version installation went fine.
To solve it I needed to update requirements.txt.
Not working versions of modules with Python 3.11:
aiohttp==3.8.1
yarl==1.4.2
frozenlist==1.3.0
Working versions:
aiohttp==3.8.2
yarl==1.8.1
frozenlist==1.3.1
Links to the corresponding issues with fixes:
https://github.com/aio-libs/aiohttp/issues/6600
https://github.com/aio-libs/yarl/issues/706
https://github.com/aio-libs/frozenlist/issues/305
Try using:
!pip install spacy==2.3.5
Do not give space between == and 2.3.5
If you give any space between equal sign and version, it may give error.

How to resolve: "ContextualVersionConflict" on 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?

No module named 'pm4py'

I want to use 'pm4py' but while import:
from pm4py.objects.log.importer.xes import factory as xes_import_factory
I got error:
ModuleNotFoundError: No module named 'pm4py
I use Visual Studio Code on Windows. When I use pip install pm4py from it's terminal(or cmd) I got error like:
Building wheel for cvxopt (setup.py) ... error
ERROR: Command errored out with exit status 1:
But when i use same line pip install pm4py in Anaconda Prompt then it returns that all Requirements are already satisfied (I think I already installed this package). I even found the folder named 'pm4py' in anaconda\lib\site-packages.
pm4py also doesn't appear on the pip list in cmd (and i think it should?).
I've been searching the internet for several hours and can't find a solution. What can I do to use import pm4py?
Solved for jupyter notebook projects: by executing conda install -c conda-forge ciso8601 then pip install pm4py
I encountered the same issue and guess this has been depreciated as development ceased.

Python error message "Incompatible library version" libxml and etree.so

Update 2:
the main problem turned out to be a different one from what I had thought it was, and asked for help here. I moved the new question to a new post:
Install custom python package in virtualenv
Update:
ok, so I screwed up my non-virtualenv by accident.
The non-virtualenv (normal bash) I could easily fix by removing the manually installed (via pip) lxml and running
conda install lxml --force
But for some reason, that doesn't work in the virtualenv.
There, running
conda install lxml --force
works without error message, but when I run python and simply say
>>> import lxml
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named lxml
Any suggestions??
old message:
I'm trying to use virtualenv for my python flask application.
The python code runs perfectly fine without the virtualenv.
I've installed the packages I need in the virtualenv, but I after installing lxml via
pip install lxml
Installing collected packages: lxml
Successfully installed lxml-3.6.0
I get the following error message when running my code:
File "/Users/XXX/xxx/flask-aws/lib/python2.7/site-packages/docx-0.2.4-py2.7.egg/docx.py", line 17, in <module>
from lxml import etree
ImportError: dlopen(/Users/XXX/xxx/flask-aws/lib/python2.7/site-packages/lxml/etree.so, 2): Library not loaded: libxml2.2.dylib
Referenced from: /Users/XXX/xxx/flask-aws/lib/python2.7/site-packages/lxml/etree.so
Reason: Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0
I have seen other people report similar problems at stackoverflow, and one guy remarked that the problem might related to the virtualenv, but there was no solution.
Once again: The python code runs perfectly fine without virtualenv! But inside virtualenv, I can't get it to work.
I'm using Anaconda Python 2.7 on a Mac.
I'd appreciate any help guys!
I had the same error and stumbled upon this link, after searching for the incompatible library error "libxml2.2.dylib provides version 10.0.0"
Installing libxml2 that worked for me:
brew install libxml2
brew link --force libxml2
Solution that works for me in virtual environment is to force pip to recompile lxml:
pip install lxml --force-reinstall --ignore-installed --no-binary :all:

Categories

Resources