Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1121

import error with pythonSDK

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 3.1.3
    • None
    • couchbase==3.0.10
    • 1

    Description

      Create a virtual env for python3.

      PYTHON=python3
      PIP=pip3
       
      currentdir=$(pwd)
      export PATH=$PATH:/usr/local/bin
       
      # Setup virtual env
      virtualenv -p $PYTHON venv
      source venv/bin/activate
       
      # Install PYTHON dependencies
      $PIP install -r requirements.txt
       
      # set PYTHON env
      export PYTHONPATH=$PYTHONPATH:$currentdir/
      

      requirements.txt

      bcrypt==3.1.7
      docutils==0.16
      beautifulsoup4==4.9.3
      boto3==1.16.21
      couchbase==3.0.10
      cryptography==2.9.2
      decorator==4.4.2
      deepdiff==5.0.2
      docutils==0.16
      Geohash==1.0
      paramiko==2.7.1
      pycparser==2.20
      urllib3==1.26.2
      requests==2.25.0
      httplib2==0.18.1
      

      output of pip3 freeze:

      (venv) [root@s71823 cen006-p0-security-vset01-00-collection-rbac-P0]# pip3 freeze
      attrs==21.2.0
      bcrypt==3.1.7
      beautifulsoup4==4.9.3
      boto3==1.16.21
      botocore==1.19.63
      certifi==2020.12.5
      cffi==1.14.5
      chardet==3.0.4
      couchbase==3.0.10
      cryptography==2.9.2
      decorator==4.4.2
      deepdiff==5.0.2
      docutils==0.16
      Geohash==1.0
      httplib2==0.18.1
      idna==2.10
      jmespath==0.10.0
      mypy-extensions==0.4.3
      ordered-set==4.0.2
      paramiko==2.7.1
      pycparser==2.20
      PyNaCl==1.4.0
      pyrsistent==0.17.3
      python-dateutil==2.8.1
      requests==2.25.0
      s3transfer==0.3.7
      six==1.16.0
      soupsieve==2.2.1
      typing-extensions==3.10.0.0
      urllib3==1.26.2
      wrapt==1.12.1
      

      Tried with older version of 3.0.7

      Current CBC version:

      (venv) [root@s71823 cen006-p0-security-vset01-00-collection-rbac-P0]# cbc version
      cbc:
        Runtime: Version=2.10.6, Changeset=61e274aae48b6edeecb081afec843dbe31d72790
        Headers: Version=2.10.6, Changeset=61e274aae48b6edeecb081afec843dbe31d72790
        Build Timestamp: 2020-02-26 18:04:22
        IO: Default=libevent, Current=libevent, Accessible=libevent,libev,select
        SSL Runtime: OpenSSL 1.0.2k-fips  26 Jan 2017
        SSL Headers: OpenSSL 1.0.2k-fips  26 Jan 2017
        Snappy: 1.1.1
        Tracing: SUPPORTED
        System: Linux-4.4.0-135-generic; x86_64
        CC: GNU 4.8.5; -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -fno-strict-aliasing -ggdb3 -pthread
        CXX: GNU 4.8.5; -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -fno-strict-aliasing -ggdb3 -pthread
      

      Error Seen:

      (venv) [root@s71823 cen006-p0-security-vset01-00-collection-rbac-P0]# python3
      Python 3.7.6 (default, Feb  6 2020, 01:13:55) 
      [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> from couchbase.cluster import Cluster, ClusterOptions
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/data/workspace/cen006-p0-security-vset01-00-collection-rbac-P0/venv/lib/python3.7/site-packages/couchbase/cluster.py", line 5, in <module>
          from couchbase.management.queries import QueryIndexManager
        File "/data/workspace/cen006-p0-security-vset01-00-collection-rbac-P0/venv/lib/python3.7/site-packages/couchbase/management/queries.py", line 8, in <module>
          from couchbase_core._pyport import Protocol
      ImportError: cannot import name 'Protocol' from 'couchbase_core._pyport' (/data/workspace/cen006-p0-security-vset01-00-collection-rbac-P0/venv/lib/python3.7/site-packages/couchbase_core/_pyport.py)
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            jared.casey Jared Casey added a comment -

            Hi Ritam Sharma - this is a duplicate of PYCBC-1120. This will be fixed in v 3.1.2 (releasing soon). In the interim, the work-around is:

            python -m pip uninstall typing-extensions
            python -m pip install typing-extensions==3.7.4.3
            

            jared.casey Jared Casey added a comment - Hi Ritam Sharma - this is a duplicate of PYCBC-1120 . This will be fixed in v 3.1.2 (releasing soon). In the interim, the work-around is: python -m pip uninstall typing-extensions python -m pip install typing-extensions==3.7.4.3
            ritam.sharma Ritam Sharma added a comment - - edited

            Jared Casey - With 3.1.2

              from couchbase.cluster import Cluster, ClusterOptions
              File "/data/workspace/cen006-p0-security-vset01-00-collection-rbac-P0/venv/lib/python3.7/site-packages/couchbase/__init__.py", line 1, in <module>
                import couchbase_core._bootstrap
              File "/data/workspace/cen006-p0-security-vset01-00-collection-rbac-P0/venv/lib/python3.7/site-packages/couchbase_core/_bootstrap.py", line 34, in <module>
                import couchbase.exceptions as E
              File "/data/workspace/cen006-p0-security-vset01-00-collection-rbac-P0/venv/lib/python3.7/site-packages/couchbase/exceptions.py", line 30, in <module>
                from typing_extensions import TypedDict
            ModuleNotFoundError: No module named 'typing_extensions'
            

            Should this be explicitly installed ?

            ritam.sharma Ritam Sharma added a comment - - edited Jared Casey - With 3.1.2 from couchbase.cluster import Cluster, ClusterOptions File "/data/workspace/cen006-p0-security-vset01-00-collection-rbac-P0/venv/lib/python3.7/site-packages/couchbase/__init__.py", line 1, in <module> import couchbase_core._bootstrap File "/data/workspace/cen006-p0-security-vset01-00-collection-rbac-P0/venv/lib/python3.7/site-packages/couchbase_core/_bootstrap.py", line 34, in <module> import couchbase.exceptions as E File "/data/workspace/cen006-p0-security-vset01-00-collection-rbac-P0/venv/lib/python3.7/site-packages/couchbase/exceptions.py", line 30, in <module> from typing_extensions import TypedDict ModuleNotFoundError: No module named 'typing_extensions' Should this be explicitly installed ?

            People

              jared.casey Jared Casey
              ritam.sharma Ritam Sharma
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty