Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -
i trying make simple python program opening list of webpages user manually download reports site. don't have previous experience preparing exe files.. , i'm in learning process python coding. of done on windows 7 x64
this python code:
#!c:/python34/python.exe -u splinter import * import time import os import csv #---------------------------------- raporty = [] open('../raporty.csv', newline='') csvfile: contents = csv.reader(csvfile, delimiter=' ', quotechar='|') row in contents: r = ', '.join(row) r = r.replace(',','') raporty.append(r) #--not implemented yet zmienne = [] open('../zmienne.csv', newline='') csvfile: contents = csv.reader(csvfile, delimiter=' ', quotechar='|') row in contents: r = ', '.join(row) r = r.replace(',','') zmienne.append(r) print("start") browser = browser() #----------------login------------------ browser.visit('https://xxxx') print(browser.title) if browser.title == "xxxxxxxxxxxx": element = browser.find_by_name('login').first element.value = "xxxx" element2 = browser.find_by_name('password').first element2.value = "xxxx" browser.find_by_value('sign in').click() time.sleep(5) #---------------------------------- j = 1 in raporty: webpage = 'webpage_link' print("text" + i) browser.visit(webpage) j += 1 if j > 15: time.sleep(j) else: time.sleep(12)
my setup.py file looks this:
from distutils.core import setup import py2exe setup( console=['final.py'], options={ "py2exe":{ "skip_archive": true, "unbuffered": true, "optimize": 2, "packages": ["encodings", "splinter"] } }, )
first issue had resolved missing files (webdriver.xpi , webdriver_prefs.json) selenium package, i've included them in library.rar file after compilation hand. unfortunately right know after running file message:
fatal python error: py_initialize: unable load file system codec importerror: no module named 'encodings'
i have same error when install anaconda python 3.6. error resolved adding environment variable "pythonpath" point installation location of python.
i refer following link,
Comments
Post a Comment