Forum Discussion
I have copied the openpyxml folders (openpyxl-2.5.0a1-py3.4.egg, et_xmlfile-1.0.1-py3.4.egg, and jdcal-1.3-py3.4.egg) files to TestComplete path C:\Program Files\SmartBear\TestComplete 11\Bin\Extensions\Python\Python34\Lib\site-packages as attached in the screen shot
But still, I am getting an error as no module named 'openpyxml'. Please correct me if I am wrong.
Hi,
> [...] to TestComplete path C:\Program Files\SmartBear\TestComplete 11\Bin\Extensions\Python\Python34\Lib\site-packages
As per help topic referenced by baxatob (https://support.smartbear.com/testcomplete/docs/scripting/specifics/python.html):
"To import custom Python packages, put them in the <TestComplete>\Bin\Extensions\Python\Python36\Lib folder and use the
import
command."Does this help ?
Hi,
I copied the custom packages to TestComplete path "C:\Program Files\SmartBear\TestComplete 11\Bin\Extensions\Python\Python34\Lib" as attached in the screen shot.
After this, I am using below syntax to import
import openpyxl
But same error exist no module named 'openpyxml'.
Hi!
NO! You can't just copy/paste your packages!
Copy/paste will work only for simple libraries stored in .py files. Openpyxl is more complex thing.
Follow this code:
from os import sys '''USE YOUR OWN SETTINGS FOR PACKAGES NAMES AND LOCATIONS'''
openpyxl_location = "C:\\Python36\\Lib\\site-packages\\openpyxl-2.5.0a1-py3.6.egg" jdcal_location = "C:\\Python36\\Lib\\site-packages\\jdcal-1.3-py3.6.egg" etxmlfile_location = "C:\\Python36\\Lib\\site-packages\\et_xmlfile-1.0.1-py3.6.egg" sys.path.insert(0, openpyxl_location) sys.path.insert(0, jdcal_location) sys.path.insert(0, etxmlfile_location) #Now you can do it: from openpyxl import Workbook # etc...