Forum Discussion

vikram_u_k's avatar
vikram_u_k
Contributor
8 years ago
Solved

How do i add Python Libraries and extend the Pyton support on TestComplete with Python 3.0 (TC11.31)

How do i add Python Libraries and extend the Pyton support on TestComplete with Python 3.0 (TC11.31).

I note that the Python executable on folder C:\Program Files\SmartBear\TestComplete 11\Bin\Extensions\Python does not have support for Serial devices. I wish to extend the Libraries available on Python 3.0. What is the recommended method to add this support?.

 

I need to add site-packages under this folder(C:\Program Files\SmartBear\TestComplete 11\Bin\Extensions\Python\Python34\Lib) but the Modules are not imported, any suggestions?.

 

I am getting a  CodecRegistryError.

  • It is not a CodecRegistryError, but SyntaxError.

    Looks like you have Python 27 installed on your machine. That can cause a conflict.

    First of all I suggest to install Python 34 the latest official Python 3 package instead of 27. Then install required package. 

     

    Finally you should be able to use this code in your TC scripts:

     

     

    from os import sys
    sys.path.insert(0, '%PATH_TO_PYTHON_DIRECTORY%\Lib\site-packages') import yourModuleName

     

9 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    It is not a CodecRegistryError, but SyntaxError.

    Looks like you have Python 27 installed on your machine. That can cause a conflict.

    First of all I suggest to install Python 34 the latest official Python 3 package instead of 27. Then install required package. 

     

    Finally you should be able to use this code in your TC scripts:

     

     

    from os import sys
    sys.path.insert(0, '%PATH_TO_PYTHON_DIRECTORY%\Lib\site-packages') import yourModuleName

     

    • SanM's avatar
      SanM
      Occasional Contributor

      Should we have to install Python 3.x msi even thoug TestComplete as python? After this we have to install thord party packages?

      • baxatob's avatar
        baxatob
        Community Hero

        1. TestComplete has built-in Python interpreter and you don't need to install something additionally.

         

        2. However to setup some third party libraries you need to have Python "registered" in your operation system.

        The easiest way is to install official package from python.org.

        Also you can register TC package in system %PATH%

         

        Specifics of usage Python in TestComplete >>