Linux Ubuntu issues with Pip

196 views Asked by At

I'm getting this error when I'm trying to set up KoBo ToolBox on an Ubuntu VPS

> Error in sys.excepthook:
> Traceback (most recent call last):
> File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook
> from apport.fileutils import likely_packaged, get_recent_crashes
> File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
> from apport.report import Report
> File "/usr/lib/python3/dist-packages/apport/report.py", line 32, in <module>
> import apport.fileutils
> File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 12, in <module>
> import os, glob, subprocess, os.path, time, pwd, sys, requests_unixsocket
> File "/usr/lib/python3/dist-packages/requests_unixsocket/__init__.py", line 1, in <module>
> import requests
> File "/usr/lib/python3/dist-packages/requests/__init__.py", line 95, in <module>
> from urllib3.contrib import pyopenssl
> File "/usr/local/lib/python3.8/dist-packages/urllib3/contrib/pyopenssl.py", line 43, in <module>
> import OpenSSL.SSL  # type: ignore[import-untyped]
> File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
> from OpenSSL import crypto, SSL
> File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1553, in <module>
> class X509StoreFlags(object):
> File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1571, in X509StoreFlags
> NOTIFY_POLICY = _lib.X509_V_FLAG_NOTIFY_POLICY
> AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'
> 
> Original exception was:
> Traceback (most recent call last):
> File "/usr/local/bin/docker-compose", line 5, in <module>
> from compose.cli.main import main
> File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 13, in <module>
> import docker.errors
> File "/usr/local/lib/python3.8/dist-packages/docker/__init__.py", line 1, in <module>
> from .api import APIClient
> File "/usr/local/lib/python3.8/dist-packages/docker/api/__init__.py", line 1, in <module>
> from .client import APIClient
> File "/usr/local/lib/python3.8/dist-packages/docker/api/client.py", line 6, in <module>
> import requests
> File "/usr/lib/python3/dist-packages/requests/__init__.py", line 95, in <module>
> from urllib3.contrib import pyopenssl
> File "/usr/local/lib/python3.8/dist-packages/urllib3/contrib/pyopenssl.py", line 43, in <module>
> import OpenSSL.SSL  # type: ignore[import-untyped]
> File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
> from OpenSSL import crypto, SSL
> File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1553, in <module>
> class X509StoreFlags(object):
> File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1571, in X509StoreFlags
> NOTIFY_POLICY = _lib.X509_V_FLAG_NOTIFY_POLICY
> AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'
> An error has occurred

I've tried installing all of the pip upgrade requests, reinstalling pip/ python and ensuring everything is up to date to no avail. I'm relatively new to this so go easy on me!

I have updated pyopenssl as suggested by other threads but I'm still left with:

> Traceback (most recent call last):   File
> "/usr/local/bin/docker-compose", line 8, in <module>
>     sys.exit(main())   File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 81,
> in main
>     command_func()   File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line
> 200, in perform_command
>     project = project_from_options('.', options)   File "/usr/local/lib/python3.8/dist-packages/compose/cli/command.py", line
> 60, in project_from_options
>     return get_project(   File "/usr/local/lib/python3.8/dist-packages/compose/cli/command.py", line
> 152, in get_project
>     client = get_client(   File "/usr/local/lib/python3.8/dist-packages/compose/cli/docker_client.py",
> line 41, in get_client
>     client = docker_client(   File "/usr/local/lib/python3.8/dist-packages/compose/cli/docker_client.py",
> line 124, in docker_client
>     kwargs = kwargs_from_env(environment=environment, ssl_version=tls_version) TypeError: kwargs_from_env() got an
> unexpected keyword argument 'ssl_version'

Thanks in advance!

0

There are 0 answers