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
17,100
questions
3792
votes
14
answers
2.5m
views
What is __init__.py for?
What is __init__.py for in a Python source directory?
3015
votes
32
answers
2.2m
views
Find the version of an installed npm package
How can I find the version of an installed Node.js or npm package?
This prints the version of npm itself:
npm -v <package-name>
This prints a cryptic error:
npm version <package-name>
...
1268
votes
18
answers
513k
views
What is the difference between --save and --save-dev?
What is the difference between:
npm install [package_name]
and:
npm install [package_name] --save
and:
npm install [package_name] --save-dev
What does this mean? And what is really the effect of --...
1044
votes
19
answers
773k
views
How to list npm user-installed packages?
How do I list the user-installed / environment package only in npm?
When I do npm -g list, it outputs every package and their dependencies. Instead I'd like to see the packages installed in the ...
949
votes
5
answers
470k
views
What is thread safe or non-thread safe in PHP?
I saw different binaries for PHP, like non-thread or thread safe?
What does this mean?
What is the difference between these packages?
876
votes
10
answers
1.2m
views
Can I force pip to reinstall the current version?
I've come across situations where a current version of a package seems not to be working and requires reinstallation. But pip install -U won't touch a package that is already up-to-date. I see how to ...
850
votes
10
answers
358k
views
What's the difference between a module and package in Python?
What's the difference between a module and package in Python?
See also: What's the difference between "package" and "module"? (for other languages)
842
votes
23
answers
664k
views
How to fix "Attempted relative import in non-package" even with __init__.py
I'm trying to follow PEP 328, with the following directory structure:
pkg/
__init__.py
components/
core.py
__init__.py
tests/
core_test.py
__init__.py
In core_test.py I have ...
782
votes
8
answers
578k
views
How can I specify the required Node.js version in package.json?
I have a Node.js project that requires Node version 12 or higher. Is there a way to specify this in the packages.json file, so that the installer will automatically check and inform the users if they ...
717
votes
13
answers
553k
views
How do I remove packages installed with Python's easy_install?
Python's easy_install makes installing new packages extremely convenient. However, as far as I can tell, it doesn't implement the other common features of a dependency manager - listing and removing ...
716
votes
19
answers
1.0m
views
How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?
I tried to install a package, using
install.packages("foobarbaz")
but received the warning
Warning message:
package 'foobarbaz' is not available (for R version x.y.z)
Why doesn't R think that the ...
699
votes
23
answers
2.0m
views
How to install pip with Python 3?
I want to install pip. It should support Python 3, but it requires setuptools, which is available only for Python 2.
How can I install pip with Python 3?
697
votes
4
answers
375k
views
What is a Python egg?
I'm trying to understand how Python packages work. Presumably eggs are some sort of packaging mechanism, but what would be a quick overview of what role they play and may be some information on why ...
679
votes
11
answers
571k
views
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?
675
votes
12
answers
576k
views
How to unload a package without restarting R
I'd like to unload a package without having to restart R (mostly because restarting R as I try out different, conflicting packages is getting frustrating, but conceivably this could be used in a ...
672
votes
8
answers
174k
views
What is the difference between require() and library()?
What is the difference between require() and library()?
652
votes
30
answers
528k
views
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.)
595
votes
15
answers
708k
views
beyond top level package error in relative import [duplicate]
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 ...
575
votes
13
answers
687k
views
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 ...
544
votes
6
answers
262k
views
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)
...
526
votes
16
answers
1.0m
views
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 ...
477
votes
8
answers
299k
views
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 ...
451
votes
35
answers
256k
views
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 ...
447
votes
24
answers
1.0m
views
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 ...
438
votes
16
answers
484k
views
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.
...
438
votes
19
answers
1.1m
views
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 ...
433
votes
3
answers
293k
views
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
...
426
votes
5
answers
206k
views
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/...
407
votes
32
answers
1.2m
views
"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-...
389
votes
16
answers
275k
views
How to install a private NPM module without my own registry?
I've taken some shared code and put it in an NPM module, one I don't want to upload to the central registry. The question is, how do I install it from other projects?
The obvious way is probably to ...
388
votes
12
answers
240k
views
Sibling package imports
I've tried reading through questions about sibling imports and even the
package documentation, but I've yet to find an answer.
With the following structure:
├── LICENSE.md
├── README.md
├── api
│ ├...
381
votes
6
answers
211k
views
What is the purpose of the -m switch?
Could you explain to me what the difference is between calling
python -m mymod1 mymod2.py args
and
python mymod1.py mymod2.py args
It seems in both cases mymod1.py is called and sys.argv is
['...
344
votes
13
answers
855k
views
How do I update a Python package?
I'm running Ubuntu 9:10 and a package called M2Crypto is installed (version is 0.19.1). I need to download, build and install the latest version of the M2Crypto package (0.20.2).
The 0.19.1 package ...
321
votes
10
answers
301k
views
Does uninstalling a package with "pip" also remove the dependent packages?
When you use pip to install a package, all the required packages will also be installed with it (dependencies). Does uninstalling that package also remove the dependent packages?
306
votes
34
answers
1.8m
views
How can I solve "java.lang.NoClassDefFoundError"?
I've tried both the examples in Oracle's Java Tutorials. They both compile fine, but at run time, both come up with this error:
Exception in thread "main" java.lang.NoClassDefFoundError: ...
290
votes
8
answers
218k
views
How do I find a list of Homebrew's installable packages?
Recently I installed Brew. How can I retrieve a list of available brew packages to install?
281
votes
4
answers
334k
views
Where does R store packages?
The install.packages() function in R is the automatic unzipping utility that gets and install packages in R.
How do I find out what directory R has chosen to store packages?
How can I change the ...
265
votes
17
answers
297k
views
Upgrade python packages from requirements.txt using pip command
How do I upgrade all my python packages from requirements.txt file using pip command?
tried with below command
$ pip install --upgrade -r requirements.txt
Since, the python packages are suffixed ...
252
votes
7
answers
148k
views
How to read a (static) file from inside a Python package?
Could you tell me how can I read a file that is inside my Python package?
My situation
A package that I load has a number of templates (text files used as strings) that I want to load from within ...
246
votes
3
answers
215k
views
How do I write good/correct package __init__.py files
My package has the following structure:
mobilescouter/
__init__.py #1
mapper/
__init__.py #2
lxml/
__init__.py #3
vehiclemapper.py
...
238
votes
11
answers
335k
views
How to select a CRAN mirror in R
I'm trying to install a package through the R prompt by doing the following:
install.packages('RMySQL')
But the output is as follows:
--- Please select a CRAN mirror for use in this session ---
...
235
votes
10
answers
149k
views
Load multiple packages at once
How can I load a bunch of packages at once with out retyping the require command over and over? I've tried three approaches all of which crash and burn.
Basically, I want to supply a vector of ...
233
votes
10
answers
123k
views
NodeJS require a global module/package
I'm trying to install globally and then use forever and forever-monitor like this:
npm install -g forever forever-monitor
I see the usual output and also the operations that copy the files to the ...
232
votes
7
answers
173k
views
Are there best practices for (Java) package organization? [closed]
A little while ago, I saw a question answered here regarding the fine-grained organization of Java packages. For example, my.project.util, my.project.factory, my.project.service, etc.
Are there best ...
227
votes
16
answers
949k
views
ModuleNotFoundError: No module named 'sklearn'
I want to import sklearn but there is no module apparently:
ModuleNotFoundError: No module named 'sklearn'
I am using Anaconda and Python 3.6.1; I have checked everywhere but still can't find ...
225
votes
9
answers
135k
views
How can I "go run" a project with multiple files in the main package?
I have a single file in the main package called main.go. Because the code isn't reusable I want to separate part of the code in a different file but in the same package.
How do I split the contents of ...
222
votes
10
answers
331k
views
How to import local packages without gopath
I've used GOPATH but for this current issue I'm facing it does not help. I want to be able to create packages that are specific to a project:
myproject/
├── binary1.go
├── binary2.go
├── package1.go
└...
221
votes
15
answers
142k
views
How do I view the size of npm packages?
When I search for packages on NPM, I would like to see package sizes (in KB or MB, etc). NPM doesn’t seem to show this information.
How can I determine how much bloat an NPM package will add to my ...
215
votes
20
answers
518k
views
Does Android keep the .apk files? if so where?
After android installs an application from the Marketplace, does it keep the .apk file?
Is there a standard location where Android would keep such files?
211
votes
3
answers
66k
views
How Do I Document Packages in Java?
In the Java APIs I can see Javadoc comments for packages.
How/where do I place Javadoc comments to document a package?