packaging

Pyinstaller: generate -exe file + folder (in --onefile mode)

前提是你 提交于 2019-12-17 22:20:14
问题 Now i'm working with Pyinstaller. I have an script which get images from a img folder.. /python |----/img |----|----icon1.ico |----|----icon2.ico |----maint.py My script to generate .exe is pyinstaller.py --windowed --noconsole --clean --onefile maint.py the problem is that only generate the .exe file but the whole folder /img is omitted. Question: which aditional syntax do I need to put in the previous line in order to get automatically the .exe file + /img folder? Update 12/18/2013 I mean:

Received 'can't find '__main__' module in '<packageName>' with python package

一曲冷凌霜 提交于 2019-12-17 19:34:16
问题 I'm trying to release my first Python package in the wild and I was successful in setting it up on PyPi and able to do a pip install . When I try to run the package via the command line ( $ python etlTest ), I receive the following error: /usr/bin/python: can't find '__main__' module in 'etlTest' When I run the code directly from my IDE, it works without issue. I am using Python 2.7 and have __init__.py scripts where required. What do I need to do to get this working? 回答1: I can easily

How to package opencv +java in a jar

自古美人都是妖i 提交于 2019-12-17 19:23:39
问题 I've been using Opencv 2.4.5 with Java for a while building an application and would now like to distribute the app. The library is loaded using the following: static{ System.loadLibrary("opencv_java245"); } which works fine. However, when exporting, it doesn't work when running from the jar: java -jar build1.jar The opencv_java245.jar file is included as a user library, with a native file (libopencv_java245.dylib) connected to it. When running the executable jar generated from Eclipse, I get

Including a directory using Pyinstaller

此生再无相见时 提交于 2019-12-17 15:39:50
问题 All of the documentation for Pyinstaller talks about including individual files. Is it possible to include a directory, or should I write a function to create the include array by traversing my include directory? 回答1: I'm suprised that no one mentioned the official supported option using Tree() : https://stackoverflow.com/a/20677118/2230844 https://pythonhosted.org/PyInstaller/advanced-topics.html#the-toc-and-tree-classes 回答2: Paste the following after a = Analysis() in the spec file to

list python package dependencies without loading them?

此生再无相见时 提交于 2019-12-17 06:38:09
问题 Say that python package A requires B, C and D; is there a way to list A → B C D without loading them ? Requires in the metadata ( yolk -M A ) are often incomplete, grr. One can download A.tar / A.egg, then look through A/setup.py, but some of those are pretty gory. (I'd have thought that getting at least first-level dependencies could be mechanized; even a 98 % solution would be better than avalanching downloads.) A related question: pip-upgrade-package-without-upgrading-dependencies 回答1:

Separate declarations of types/packages aliases in Ada

北慕城南 提交于 2019-12-14 03:56:12
问题 I would like to declare some "user-defined compiler-constants" to keep my specification files as "constant" as possible. This is something common in C++, e.g. : // misc/config.hh namespace misc { typedef std::shared_ptr<A> A_ptr; namespace arch = ibmpc; } // misc/code.hh #include "misc/config.hh" namespace misc { void function p(A_ptr a); } Which would be in Ada : -- misc.ads package Misc is use Types; ----> forbidden ! procedure P(A : A_Access); end Misc; -- misc-types.ads package Misc.Types

Packaging Rails 2.3 Models

别等时光非礼了梦想. 提交于 2019-12-13 16:24:10
问题 I've got an existing webapp running on Rails. The plan is to setup a new server which will provide an API service, and eventually update the webapp to be a client of this API. It seems like a good approach to achieving this would be packaging all the models as gems and sharing them between the two applications. Eventually the API service would be monolithic - containing all the models, but there is a period of development/migration where models will need to be shared. Both the API and the

Shading dependencies of scala (jar) library

可紊 提交于 2019-12-13 05:20:37
问题 I would like to distribute a jar of a library I created with all my dependencies bundled inside. However I would like to avoid version conflicts of dependencies with the adopting project. I think maven shade can do this but I could not find a way to do this with Scala / SBT. I found OneJar however from my experiments with it seems to work only for executables. How could I achieve this? Thanks! 回答1: You can do this with your own classloader. The classLoader: Write a class loader which loads

How do you make an entry point to a script in a virtual environment available system-wide?

醉酒当歌 提交于 2019-12-13 03:18:02
问题 I'm using setuptools for python packaging where I define console script entry points the usual way in the setup.py file: setup.py # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup(... name='my_project', entry_points={'console_scripts':['my_entry_name=my_package.scripts.my_python_script:main' ]}, ... ) After installing the package, I can call this entry point from a batch file like this: my_CURRENT_batch_file.command #!/bin/bash cd "$(dirname "$0")" # set the working

How to generate a Karaf features descriptor

落花浮王杯 提交于 2019-12-13 02:47:20
问题 I am trying to automatically generate Apache Karaf's (2.3.0) feature desscriptor file ( features.xml ). From Karaf's doc I have learned that I can use the "features" packaging. my pom.xml <project> ... <packaging>feature</packaging> <dependencies> <dependency> <groupId>org.apache.jclouds</groupId> <artifactId>jclouds-core</artifactId> <scope>provided</scope> <version>${jclouds.version}</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.karaf.tooling<