Questions tagged [package]

Package broadly refers to two things: 1) a usable unit/component of built/compiled software, or 2) a partition of the global namespace (Java).

Package may refer to a software component or the action of creating a package. The component could be a portion of a whole system, or the whole system itself, or any level of granularity between. Typical packaging mechanisms include: tar, jar, zip, rpm, war, exe. In this context it may also be used as a verb: "I was packaging my software and...".

Package is also a term from the java world to refer to the mechanism used to partition the global namespace with the intention of making it possible of having two classes with the same name and of creating a logical structure in which classes may be held. In java packages are most commonly represented by directories. Package is also a java keyword used at the start of a class file to indicate the package to which the class belongs. This is important because of 'package' scoped access rules, which allow classes in the same package to access a field/method/class.

Because of the ambiguity here it is best to use other tags to help define the meaning of this one. If you're asking about java packages, please include the Java tag. If you're asking about packaging up your software for deployment/use add other appropriate tags, such as 'Maven', 'Make', 'Ant', etc.

16844 questions
159
votes
5 answers

How do I create a namespace package in Python?

In Python, a namespace package allows you to spread Python code among several projects. This is useful when you want to release related libraries as separate downloads. For example, with the directories Package-1 and Package-2 in…
joeforker
  • 40,459
  • 37
  • 151
  • 246
157
votes
8 answers

How to add a package from GitHub in Flutter?

I need to use the latest source code of a package and the latest source hasn't been published yet. What should I write into pubspec.yaml to get a package in Github? The code below doesn't work. It doesn't download the package and I can't import it…
Kostya Vyrodov
  • 6,257
  • 5
  • 23
  • 34
155
votes
15 answers

How do I import a specific version of a package using go get?

coming from a Node environment I used to install a specific version of a vendor lib into the project folder (node_modules) by telling npm to install that version of that lib from the package.json or even directly from the console, like so: $ npm…
Wilk
  • 7,873
  • 9
  • 46
  • 70
154
votes
6 answers

Access data in package subdirectory

I am writing a python package with modules that need to open data files in a ./data/ subdirectory. Right now I have the paths to the files hardcoded into my classes and functions. I would like to write more robust code that can access the…
Jacob Lyles
  • 9,920
  • 7
  • 32
  • 30
154
votes
4 answers

Java packages com and org

What are the meaning of the packages org and com in Java?
Gabriel
  • 1,549
  • 2
  • 9
  • 3
153
votes
9 answers

Download source from npm without installing it

How can I download the source code of a package from npm without actually installing it (i.e. without using npm install thepackage)?
AURIGADL
  • 1,832
  • 2
  • 13
  • 15
152
votes
8 answers

Print a list of all installed node.js modules

In a node.js script that I'm working on, I want to print all node.js modules (installed using npm) to the command line. How can I do this? console.log(__filename); //now I want to print all installed modules to the command line. How can I do this?
Anderson Green
  • 30,230
  • 67
  • 195
  • 328
142
votes
7 answers

Package structure for a Java project?

Whats the best practice for setting up package structures in a Java Web Application? How would you setup your src, unit test code, etc?
mawaldne
  • 3,919
  • 6
  • 31
  • 37
136
votes
9 answers

#import using angle brackets < > and quote marks " "

I'm wondering what decides whether you're allowed to use or "Header.h" when you're importing files in Objective-C. So far my observation has been that you use the quote marks "" for files in your project that you've got the implementation…
quano
  • 18,812
  • 25
  • 97
  • 108
135
votes
12 answers

Is there a standard way to list names of Python modules in a package?

Is there a straightforward way to list the names of all modules in a package, without using __all__? For example, given this package: /testpkg /testpkg/__init__.py /testpkg/modulea.py /testpkg/moduleb.py I'm wondering if there is a standard or…
DNS
  • 37,249
  • 18
  • 95
  • 132
134
votes
2 answers

Does it make sense to use Conda + Poetry?

Does it make sense to use Conda + Poetry for a Machine Learning project? Allow me to share my (novice) understanding and please correct or enlighten me: As far as I understand, Conda and Poetry have different purposes but are largely…
Seub
  • 2,451
  • 4
  • 25
  • 34
134
votes
4 answers

Go update all modules

Using this module as an example (using a specific commit so others will see what I see): git clone git://github.com/walles/moar Set-Location moar git checkout d24acdbf I would like a way to tell Go to "update everything". Assume that the…
Zombo
  • 1
  • 62
  • 391
  • 407
134
votes
7 answers

How to import classes defined in __init__.py

I am trying to organize some modules for my own use. I have something like this: lib/ __init__.py settings.py foo/ __init__.py someobject.py bar/ __init__.py somethingelse.py In lib/__init__.py, I want to define some classes…
scottm
  • 27,829
  • 22
  • 107
  • 159
134
votes
5 answers

How to install a node.js module without using npm?

There are quite a few modules which are listed on node's github page but are not published with the npm-registry. These modules can't be installed using npm. What is the correct way to install these nodejs modules after cloning them from Git?
vivekian2
  • 3,795
  • 9
  • 35
  • 41
134
votes
8 answers

How to install Python packages from the tar.gz file without using pip install

Long story short my work computer has network constraints which means trying to use pip install in cmd just leads to timing out/not finding package errors. For example; when I try to pip install seaborn: Instead I have tried to download the tar.gz…
yenoolnairb
  • 1,493
  • 2
  • 10
  • 12