I had created a python file which will pull the data from app dynamics for which i had imported the package from appd.request import AppDynamicsClient
it is working fine but now i want to convert it into .exe for which i am using py2exe in py2exe i am trying to include the package appdynamics but it is giving error package not found
from appd.request import AppDynamicsClient
from matplotlib.dates import date2num
import matplotlib.dates as dates
import matplotlib.pyplot as plt
import requests
these are the packages i am importing in main file which i am trying to convert it into .exe file
setup.py file
from distutils.core import setup
from distutils.core import setup
import py2exe
setup(console=['AD_API.py'],
options = {
"py2exe": {
'packages' :['requests','AppDynamicsClient','matplotlib']
}
}
)
ERROR MESSAGE:
ImportError: No module named AppDynamicsClient
Related
I am getting an import error as i try to import gensim, pandas and numpy in django views.py . It works fine in shell.
How can I import them in views.py. I have installed the libraries in virtual environment.
This is the error screenshot, click
i want to run a wordcount program using dataflow in python 2.7 on gcloud SDK
i have used the path to import the PipelineOptions,
Here are two approaches-
1.from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import SetupOptions
2.from apache_beam.pipeline import PipelineOptions
from apache_beam.pipeline import SetupOptions
but it still show 'ImportError: No module named options.pipeline_options' in both of the approaches which i try.
there is any solution in apache_beam or in python 2.7 ?
I compiled my prototype Application with py2exe to check its function as an exe, and run into 0 errors until I go to start it. Nothing happens. A process starts with my app name, it thinks for a few seconds, then nothing. No log file is generated. The app works great when run in python environment, but not in the compiled exe. I've given my setup code below. Any ideas? :
from distutils.core import setup
import py2exe, sys, os
import matplotlib
import FileDialog
import dateutil
sys.argv.append('py2exe')
setup( windows=['ATLAS.pyw'], data_files=matplotlib.get_py2exe_datafiles(),
options = {"py2exe": {
"includes": "decimal, datetime",
"packages": ["FileDialog", "dateutil"],
'bundle_files': 2,
'compressed': True}
},
zipfile = None
)
Hooks utilized in the Application:
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.backend_bases import key_press_handler
from pandas.sandbox.qtpandas import DataFrameWidget
from matplotlib.widgets import LassoSelector
from tkFileDialog import askopenfilename
from matplotlib.figure import Figure
import matplotlib.image as mpimg
from PySide import QtGui, QtCore
from matplotlib.path import Path
import pandas.io.sql as psql
from numpy import nonzero
import tkMessageBox as mb
from pylab import *
import pyodbc
import sys
import ttk
SOLVED:
So, using quick fingers (and compiling it with PyInstaller with the --debug option) I screen-capped the quickly-closing console window that contained the Traceback:
WindowsError: [Error 3] The system cannot find the path specified: 'C:\\path\\dateutil\\zoneinfo/*.*'
The zoneinfo file was being saved in pytz instead of dateutil. A quick rename solved the problem.
Only issue though, if you want to compile with -F or --onefile it will not work due to the initial improper naming convention. Not quite sure how to fix that though.
I'm trying to create an executable using py2exe for my Tkinter widget using python 2.7. This is my setup.py file:
from distutils.core import setup
import Tkinter
import py2exe
import numpy
import matplotlib
import scipy
import FileDialog
includes = ['scipy.special._ufuncs_cxx',
'scipy.sparse.csgraph._validation'
]
#dll_excludes = ['libgdk-win32-2.0-0.dll','libgobject-2.0- 0.dll','libgdk_pixbuf-2.0-0.dll']
setup(
console=["home.py"]
,options={"py2exe":{'includes':includes
# ,'packages' : ['matplotlib','pytz']
# ,'dll_excludes': dll_excludes
}
}
,data_files=matplotlib.get_py2exe_datafiles()
)
The executable compiles fine, but when I try to run home.exe from the dist folder it gives me this message.......and I have no idea how to fix it (I thought doing import FileDialog would do it):
File "matplotlib\backends\backend_tkagg.pyc", line 7, in <module>
File "six.pyc", line 194, in load_module
File "six.pyc", line 108, in _resolve
File "six.pyc", line 79, in _import_module
ImportError: No module named FileDialog
Thanks very much
I'm using scrapy-0.16 for data extraction from LinkedIn.
from scrapy.selector import HtmlXPathSelector
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.http import Request
from scrapy import log
from linkedin.items import LinkedinItem, PersonProfileItem
from os import path
from linkedin.parser.HtmlParser import HtmlParser
import os
import urllib
from bs4 import UnicodeDammit
from linkedin.db import MongoDBClient
https://github.com/pondering/scrapy-linkedin
The error comes
Traceback (most recent call last):
File "C:\Users\TAWANE DUDEZ\Desktop\linkedin\linkedin\spiders\LinkedinSpider.py", line 6, in <module>
from linkedin.items import LinkedinItem, PersonProfileItem
ImportError: No module named linkedin.items
Cannot find linkedin.items module.
My suspicion is that you're trying to run the scrapy crawl LinkedinSpider command from the wrong directory. Try navigating to C:\Users\TAWANE DUDEZ\Desktop\linkedin and then running the command again.
Since the crawler is now starting, you also need to be running a MongoDB instance before starting the crawl. The README of the github project being used says to typemongod to start an instance. Just to check, you do have MongoDB and pymongo installed right?