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
656
votes
8 answers

What is the difference between require() and library()?

What is the difference between require() and library()?
Marco
  • 9,334
  • 7
  • 33
  • 51
647
votes
11 answers

Installing a local module using npm?

I have a downloaded module repo, I want to install it locally, not globally in another directory? What is an easy way to do this?
fancy
  • 48,619
  • 62
  • 153
  • 231
642
votes
29 answers

Can you find all classes in a package using reflection?

Is it possible to find all classes or interfaces in a given package? (Quickly looking at e.g. Package, it would seem like no.)
Jonik
  • 80,077
  • 70
  • 264
  • 372
580
votes
15 answers

beyond top level package error in relative import

It seems there are already quite some questions here about relative import in python 3, but after going through many of them I still didn't find the answer for my issue. so here is the question. I have a package shown below package/ …
shelper
  • 10,053
  • 8
  • 41
  • 67
557
votes
13 answers

How to find out which package version is loaded in R?

I am in a process of figuring out how to use my university cluster. It has 2 versions of R installed. System wide R 2.11 (Debian 6.0) and R 2.14.2 in non-standard location. I am trying to use MPI together with snow. The code I am trying to run is…
mpiktas
  • 11,258
  • 7
  • 44
  • 57
514
votes
6 answers

What is the convention for word separator in Java package names?

How should one separate words in package names? Which of the following are correct? com.stackoverflow.my_package (Snake Case using underscore) com.stackoverflow.my-package (Kebab Case using hyphens) com.stackoverflow.myPackage (Camel…
Jigar
  • 8,762
  • 6
  • 25
  • 26
502
votes
17 answers

How to clean node_modules folder of packages that are not in package.json?

Assume I install project packages with npm install that looks into package.json for modules to be installed. After a while I see that I don't need some specific module and remove its dependency from package.json. Then I remove some other modules…
Sergei Basharov
  • 51,276
  • 73
  • 200
  • 335
472
votes
8 answers

javax vs java package

What's the rationale behind the javax package? What goes into java and what into javax? I know a lot of enterprise-y packages are in javax, but so is Swing, the new date and time api (JSR-310) and other J2SE packages.
Jaka Jančar
  • 11,386
  • 9
  • 53
  • 74
439
votes
34 answers

Elegant way to check for missing packages and install them?

I seem to be sharing a lot of code with coauthors these days. Many of them are novice/intermediate R users and don't realize that they have to install packages they don't already have. Is there an elegant way to call installed.packages(), compare…
Maiasaura
  • 32,226
  • 27
  • 104
  • 108
432
votes
3 answers

How to view hierarchical package structure in Eclipse package explorer

OK here's what I would like: in the Eclipse package explorer, I see the following: (dot represents a clickable arrow that I can use to expand the folder) PROJECT Source Folder Package Class…
Philip
  • 7,253
  • 3
  • 23
  • 31
432
votes
24 answers

Python 3: ImportError "No Module named Setuptools"

I'm having troubles with installing packages in Python 3. I have always installed packages with setup.py install. But now, when I try to install the ansicolors package I get: importerror "No Module named Setuptools" I have no idea what to do…
user1994934
  • 4,323
  • 2
  • 14
  • 8
430
votes
15 answers

How to get package name from anywhere?

I am aware of the availability of Context.getApplicationContext() and View.getContext(), through which I can actually call Context.getPackageName() to retrieve the package name of an application. They work if I call from a method to which a View or…
ef2011
  • 10,431
  • 12
  • 49
  • 67
412
votes
19 answers

Relative imports - ModuleNotFoundError: No module named x

This is the first time I've really sat down and tried python 3, and seem to be failing miserably. I have the following two files: test.py config.py config.py has a few functions defined in it as well as a few variables. I've stripped it down to…
blitzmann
  • 7,319
  • 5
  • 23
  • 29
394
votes
5 answers

Is __init__.py not required for packages in Python 3.3+

I am using Python 3.5.1. I read the document and the package section here: https://docs.python.org/3/tutorial/modules.html#packages Now, I have the following structure: /home/wujek/Playground/a/b/module.py module.py: class Foo: def…
wujek
  • 10,112
  • 12
  • 52
  • 88
394
votes
32 answers

"pip install unroll": "python setup.py egg_info" failed with error code 1

I'm trying to install some packages with pip. But pip install unroll gives me Command "python setup.py egg_info" failed with error code 1 in C:\Users\MARKAN~1\AppData\Local\Temp\pip-build-wa7uco0k\unroll\ How can I solve this?
benjaminh
  • 3,949
  • 3
  • 10
  • 3