I'm trying to use the ansible module github_release that use the python module github3.py.
The machine that I need run the playbook don't have permission to access the internet so I downloaded (pip download github3.py) then in other machine I inslated (pip install ./*.whl).
I'm sure that the python module is instaled:
$ pip show github3.py
Name: github3.py
Version: 1.3.0
Summary: Python wrapper for the GitHub API(http://developer.github.com/v3)
Home-page: https://github3.readthedocs.io
Author: Ian Stapleton Cordasco
Author-email: graffatcolmingov#gmail.com
License: 3-clause BSD
Location: /usr/lib/python2.7/site-packages
Requires: python-dateutil, uritemplate, requests, jwcrypto
Required-by:
But my playbook have the same error:
TASK [Get latest release from repository] ***********************************************************************************************************************
fatal: [vg1200yr.dc.sedc.internal.vodafone.com]: FAILED! => {"changed": false, "msg": "Missing required github3 module (check docs or install with: pip install github3.py==1.0.0a4)"}
Any idea why my playbook can find the github3 module?
Related
The error happens at the import line in the Python code.
sys.path.append("/usr/local/Cellar/mariadb-connector-c/3.3.3")
sys.path.append("/usr/local/Cellar/mariadb-connector-c")
import mariadb
I already have the mariadb and mariadb-1.1.5.post3.dist-info added to the sys.path, I can see it when I do a print (sys.path)
The error message I am getting is : Exception has occurred: ModuleNotFoundError No module named 'mariadb._mariadb'
pip show mariadb returns:
Name: mariadb
Version: 1.1.5.post3
Summary: Python MariaDB extension
Home-page: https://www.github.com/mariadb-corporation/mariadb-connector-python
Author: Georg Richter
Author-email:
License: LGPL 2.1
Location: /Users/melinda.walker/GitHub/bi-ingestion-scripts/venv/lib/python3.9/site-packages
Requires: packaging
Required-by:
I am also using a virtual environment.
My python --version is : Python 3.9.16
I used brew install mariadb-connector-c to install mariadb-connector-c.
It is similar to issues: Installing mariadb 1.1.3 package on Python and Python import Mariadb: 'ModuleNotFoundError'.
I tried what Georg suggested: pip3 uninstall mariadb and pip3 install --no-cache mariadb but I am still getting that error.
I am trying to install a company-internal package "algo_flows".
pip show algo_flows shows it
(py37) noam#9cae2d848b93:~$ pip show algo_flows
Name: algo-flows
Version: 1.0.0.dev36
Summary: UNKNOWN
Home-page: UNKNOWN
Author:
Author-email:
License: UNKNOWN
Location: /home/noam/.local/lib/python3.7/site-packages
Requires: anomalib, datetime, fastapi, matplotlib, ml-distillery, numpy, opencv-python, overrides, pydantic, pytest, pytest-dependency, pytest-order, pyyaml, torch, torchvision, uv-python-utils
Required-by: inspection-manager
but it can't be imported, and is not shown via help("modules")
There is no way I can create a reproducible of this, I have no idea what could cause this.
How can I debug it? pip install seems to work fine!
I am trying to understand an existing big python project which has lot of dependencies listed in requirement.txt. I like to understand what each libraries is meant for.
If there is a way to generate a short description given by them from pypi.org or other sources, that would greatly help.
For example:
#requirement.txt
gluonts
aiohttp
Expected outcome:
gluonts | GluonTS is a Python toolkit for probabilistic time series modeling
aiohttp | Async http client/server framework
Is there a tool (command line / online) that can provide descriptive insights on python dependencies ?
It is possible to get a description of packages installed using pip.
pip show [options] <package>
For example
pip show requests
Name: requests
Version: 2.25.1
Summary: Python HTTP for Humans.
Home-page: https://requests.readthedocs.io
Author: Kenneth Reitz
Author-email: me#kennethreitz.org
License: Apache 2.0
Location: ..\programs\python\python38\lib\site-packages
Requires: urllib3, certifi, chardet, idna
Required-by:
You can use the summary field as a description. This of course relies upon the author having provided a sufficiently clear description.
You can do this inside a python script using the following
from pip._internal import main as pipmain
description = pipmain(['show','requests'])
If you have those packages installed you can use pip show <package-name>. For example:
$ pip show aiohttp
Name: aiohttp
Version: 3.7.3
Summary: Async http client/server framework (asyncio)
Home-page: https://github.com/aio-libs/aiohttp
Author: Nikolay Kim
Author-email: fafhrd91#gmail.com
License: Apache 2
Location: /home/jack/repo/global-search-ingestion/global_search_lib/.venv/lib/python3.8/site-packages
Requires: typing-extensions, yarl, async-timeout, chardet, attrs, multidict
Required-by: faust, aiohttp-cors
To run this over your requirements.txt, you can use cut and xargs
pip show $(cat requirements.txt | cut -d "=" -f 1 | xargs)
And this will list out metadata for each library in you requirements.txt.
I am using Paramiko. Any idea how I can use the Paramiko.RSAKey.from_private_key() function?
I'm interested in using a function to parse a private key and use that private key for SSHClient.
Code I wanted to run:
file = './file.pem'
mypkey = paramiko.RSAKey.from_private_key_file(file)
Result:
ImportError: The version of cryptography does not match the loaded shared object. This can happen if you have multiple copies of cryptography installed in your Python path. Please try creating a new virtual environment to resolve this issue. Loaded python version: 2.4.2, shared object version: b'2.7'
It apears to be a problem with the lib cryptography:
from cryptography.hazmat.backends.openssl.backend import backend
I have python 3.7.1
I have installed Paramiko using pip install
Here are some infromation about the version I have used for paramiko :
pip show paramiko
Name: paramiko
Version: 2.6.0
Summary: SSH2 protocol library
Home-page: https://github.com/paramiko/paramiko/
License: LGPL
Requires: pynacl, bcrypt, cryptography
Required-by: sshtunnel
Here are some infromation about the version I have used for cryptography:
pip show cryptography
Name: cryptography
Version: 2.7
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
License: BSD or Apache License, Version 2.0
Requires: six, asn1crypto, cffi
Required-by: service-identity, pyOpenSSL, paramiko
I have unistalled cryptography and installed the same ver of the paramiko:
pip install cryptography==2.6.0
The same ERROR stays
This problem is almost always caused by having multiple copies of cryptography installed simultaneously. This can happen if you've installed cryptography both with pip and your system's package manager. Try building a new virtualenv, installing your dependencies into that, and that should resolve the issue.
I try to build docker-compose from source with setuptools like this
python setup.py develop
But I get the follwoing error:
error: requests 2.11.1 is installed but requests!=2.18.0,>=2.14.2 is required by set(['docker'])
but running
pip show requests
gives the following result:
Name: requests
Version: 2.18.4
Summary: Python HTTP for Humans.
Home-page: http://python-requests.org
Author: Kenneth Reitz
Author-email: me#kennethreitz.org
License: Apache 2.0
Location: /home/florian/.local/lib/python2.7/site-packages
Requires: certifi, chardet, idna, urllib3
Is there anything cached by setuptools or something similar?
try
sudo pip install --upgrade docker-compose
There was an issue in the git repo source code, that blocked me from building.