Setting up conan in a fresh gitlab container - python

I have been attempting to get conan running inside of a docker container that also runs gitlab. I have been attempting to follow these two guides here:
https://docs.gitlab.com/omnibus/docker/ ****Using the Selinux version, im on RHEL 7
https://docs.gitlab.com/ee/user/packages/conan_repository/ *********Only get as far as the actual installing of conan
Whenever I then try to run the conan --version command I get an error message stating "no module named _sqlite3". So in order to try and fix that I have tried installing pysqlite3, libsqlite-dev, sqlite3, pretty much any sqlite named package (within the container of course) I can think of but to no success.
Here is the actual stack trace from the conan call in the event that it may give someone some insight into my issue.
Traceback (most recent call last):
File "/opt/gitlab/embedded/bin/conan", line 33, in <module>
sys.exit(load_entry_point('conan==1.32.0', 'console_scripts', 'conan')())
File "/opt/gitlab/embedded/lib/python3.7/site-packages/pkg_resources/__init__.py", line 473, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/opt/gitlab/embedded/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
return ep.load()
File "/opt/gitlab/embedded/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2447, in load
return self.resolve()
File "/opt/gitlab/embedded/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2453, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/opt/gitlab/embedded/lib/python3.7/site-packages/conans/conan.py", line 7, in <module>
from conans.client.command import main
File "/opt/gitlab/embedded/lib/python3.7/site-packages/conans/client/command.py", line 16, in <module>
from conans.client.conan_api import Conan, default_manifest_folder, _make_abs_path, ProfileData
File "/opt/gitlab/embedded/lib/python3.7/site-packages/conans/client/conan_api.py", line 11, in <module>
from conans.client.cache.cache import ClientCache
File "/opt/gitlab/embedded/lib/python3.7/site-packages/conans/client/cache/cache.py", line 16, in <module>
from conans.client.store.localdb import LocalDB
File "/opt/gitlab/embedded/lib/python3.7/site-packages/conans/client/store/localdb.py", line 2, in <module>
import sqlite3
File "/opt/gitlab/embedded/lib/python3.7/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "/opt/gitlab/embedded/lib/python3.7/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
Any help would be greatly appreciated.

Related

Python Certbot module 'collections' has no attribute 'Mapping'

when I try to run certbot in my console on my Linux Ubuntu Server 20.04.3 LTS, I get following error:
Traceback (most recent call last):
File "/usr/bin/certbot", line 11, in <module>
load_entry_point('certbot==0.40.0', 'console_scripts', 'certbot')()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3/dist-packages/certbot/main.py", line 18, in <module>
from certbot import cert_manager
File "/usr/lib/python3/dist-packages/certbot/cert_manager.py", line 15, in <module>
from certbot import ocsp
File "/usr/lib/python3/dist-packages/certbot/ocsp.py", line 25, in <module>
from certbot.storage import RenewableCert # pylint: disable=unused-import
File "/usr/lib/python3/dist-packages/certbot/storage.py", line 15, in <module>
from certbot import cli
File "/usr/lib/python3/dist-packages/certbot/cli.py", line 33, in <module>
from certbot.plugins import disco as plugins_disco
File "/usr/lib/python3/dist-packages/certbot/plugins/disco.py", line 183, in <module>
class PluginsRegistry(collections.Mapping):
AttributeError: module 'collections' has no attribute 'Mapping'
I have already searched for a solution, but have not found one. Even posts that have the same error could not solve the problem for me. Strangely enough, it worked about two months ago.
I'm running Python 3.10.
In my case, I edited the file /usr/bin/certbot and changed #!/usr/bin/python3 to: #!/usr/bin/python3.8 because Certbot does not support Python 3.10 yet

Ovirt Python SDK error during openuds installation

I get the following error, How to rectify this issue?
from ovirtsdk.xml import params
ImportError: No module named ovirtsdk.xml
This is the complete log file, Why I get this error and How to rectify it?
python manage.py createcachetable
Traceback (most recent call last):
File "manage.py", line 9, in <module>
execute_from_command_line(sys.argv)
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 327, in execute
django.setup()
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/home/hari/openuds/testuds-master/server/src/uds/__init__.py", line 72, in ready
from . import services # to make sure that the packages are initialized at this point
File "/home/hari/openuds/testuds-master/server/src/uds/services/__init__.py", line 73, in <module>
__init__()
File "/home/hari/openuds/testuds-master/server/src/uds/services/__init__.py", line 63, in __init__
__import__('uds.services.' + name, globals(), locals(), [])
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/__init__.py", line 31, in <module>
from .OVirtProvider import Provider
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/OVirtProvider.py", line 44, in <module>
from . import client
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/client/__init__.py", line 33, in <module>
from . import oVirtClient3;
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/client/oVirtClient3.py", line 7, in <module>
from ovirtsdk.xml import params
ImportError: No module named ovirtsdk.xml
You are missing the ovirt-engine-sdk-python package. Note that it requires version 3 of that package, so you can install it via pip like this:
$ pip install ovirt-engine-sdk-python==3.6.9.2
Don't run:
$ pip install ovirt-engine-sdk-python
which would install latest(4) version of the SDK, which isn't compatible with above code.

Archlinux:pip: ImportError: cannot import name 'requests'

Some of my python packages installed with pip had conflicts with another package I tried installing using pacman. So I decided to uninstall all the packages installed with pip. I made a requirements.txt file with all the packages and started uninstalling them. It worked fine for a while but eventually gave this error:
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
load_entry_point('pip==10.0.1', 'console_scripts', 'pip')()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 479, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2703, in load_entry_point
return ep.load()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2321, in load
return self.resolve()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2327, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3.6/site-packages/pip/_internal/__init__.py", line 42, in <module>
from pip._internal import cmdoptions
File "/usr/lib/python3.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
from pip._internal.index import (
File "/usr/lib/python3.6/site-packages/pip/_internal/index.py", line 15, in <module>
from pip._vendor import html5lib, requests, six
ImportError: cannot import name 'requests'
I got a similar error everytime I tried running pip after that.

python fabric error 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'

I am getting following error when I run fabric
(ENV)[root#server-124 ENV]# fab
Traceback (most recent call last):
File "/usr/bin/fab", line 9, in <module>
load_entry_point('Fabric==1.8.3', 'console_scripts', 'fab')()
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
return ep.load()
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.6/site-packages/fabric/main.py", line 19, in <module>
from fabric import api, state, colors
File "/usr/lib/python2.6/site-packages/fabric/api.py", line 9, in <module>
from fabric.context_managers import (cd, hide, settings, show, path, prefix,
File "/usr/lib/python2.6/site-packages/fabric/context_managers.py", line 42, in <module>
from fabric.state import output, win32, connections, env
File "/usr/lib/python2.6/site-packages/fabric/state.py", line 9, in <module>
from fabric.network import HostConnectionCache, ssh
File "/usr/lib/python2.6/site-packages/fabric/network.py", line 24, in <module>
import paramiko as ssh
File "/usr/lib/python2.6/site-packages/paramiko/__init__.py", line 31, in <module>
from transport import SecurityOptions, Transport
File "/usr/lib/python2.6/site-packages/paramiko/transport.py", line 33, in <module>
from paramiko import util
File "/usr/lib/python2.6/site-packages/paramiko/util.py", line 33, in <module>
from paramiko.common import *
File "/usr/lib/python2.6/site-packages/paramiko/common.py", line 98, in <module>
from Crypto import Random
File "/usr/lib64/python2.6/site-packages/Crypto/Random/__init__.py", line 29, in <module>
from Crypto.Random import _UserFriendlyRNG
File "/usr/lib64/python2.6/site-packages/Crypto/Random/_UserFriendlyRNG.py", line 38, in <module>
from Crypto.Random.Fortuna import FortunaAccumulator
File "/usr/lib64/python2.6/site-packages/Crypto/Random/Fortuna/FortunaAccumulator.py", line 39, in <module>
import FortunaGenerator
File "/usr/lib64/python2.6/site-packages/Crypto/Random/Fortuna/FortunaGenerator.py", line 34, in <module>
from Crypto.Util.number import ceil_shift, exact_log2, exact_div
File "/usr/lib64/python2.6/site-packages/Crypto/Util/number.py", line 56, in <module>
if _fastmath is not None and not _fastmath.HAVE_DECL_MPZ_POWM_SEC:
AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'
I have referred some other post that says it "so you'reusing a newer version of PyCrypto with an older version of _fastmath." So I also installed gmp-devel
I am using virtualenv , Centos 6, Python 2.6
please help.
This fixed it for me:
pip install PyCrypto==2.3
I didn't uninstall python-crypto because other packages I needed depended on it. I just ran the pip command above and everything worked :)

ImportError: cannot import name output

iam using fabric 0.9.1 version on windows to do some deployment related stuff.
But the moment iam about to run "fab hello" iam facing the following error
D:\pythonscripts>fab hello
Traceback (most recent call last):
File "C:\Python26\Scripts\fab-script.py", line 8, in <module>
load_entry_point('fabric==0.9.1', 'console_scripts', 'fab')()
File "build\bdist.win-amd64\egg\pkg_resources.py", line 318, in load_entry_poi
nt
File "build\bdist.win-amd64\egg\pkg_resources.py", line 2221, in load_entry_po
int
File "build\bdist.win-amd64\egg\pkg_resources.py", line 1954, in load
File "build\bdist.win-amd64\egg\fabric\main.py", line 17, in <module>
File "build\bdist.win-amd64\egg\fabric\api.py", line 9, in <module>
File "build\bdist.win-amd64\egg\fabric\context_managers.py", line 12, in <modu
le>
File "build\bdist.win-amd64\egg\fabric\state.py", line 9, in <module>
File "build\bdist.win-amd64\egg\fabric\network.py", line 19, in <module>
File "build\bdist.win-amd64\egg\fabric\utils.py", line 21, in abort
ImportError: cannot import name output
Any clue on how to resolve this error?
It seems to be this issue: http://code.fabfile.org/issues/show/194, probably it's not Fabric related but PyCrypto or Python64. If it is PyCrypto then the easiest thing is to download a binary version from http://www.voidspace.org.uk/python/modules.shtml#pycrypto and install it and download pywin32 from http://sourceforge.net/projects/pywin32/files/ and install it as well.

Categories