Questions tagged [module]

A logical subdivision of a larger, more complex system.

Modules are a convenient way to break down a larger problem and divide it into smaller problems/solutions. This way the main problem can be broken down into separate parts that can be worked on independently. For example, one module could consist of a the printing functionality of program, which can be handed to one programmer. The GUI (Graphical User Interface) could be another module, handed to another programmer, and so forth.

Modular design is meant to improve efficiency and speed of development by allowing programmers to work on specific aspects of the program independently of each other.

22551 questions
67
votes
5 answers

use of @import when modules are disabled

I have a problem @import Foundation; and I see: @import vs #import - iOS 7 and I set "Enable Modules" to "YES" and my problem is not solved
Ali Rezaei
  • 713
  • 1
  • 5
  • 7
67
votes
8 answers

How do I "use" a Perl module in a directory not in @INC?

I have a module in the parent directory of my script and I would like to 'use' it. If I do use '../Foo.pm'; I get syntax errors. I tried to do: push @INC, '..'; use EPMS; and .. apparently doesn't show up in @INC I'm going crazy! What's wrong…
Frew Schmidt
  • 9,364
  • 16
  • 64
  • 86
66
votes
14 answers

no module named 'dotenv' python 3.8

EDIT: Solved, if anyone comes across this python3.8 -m pip install python-dotenv worked for me. I've tried reinstalling both dotenv and python-dotenv but I'm still getting the same error. I do have the .env file in the same directory as this…
Jonathan Thai
  • 663
  • 1
  • 5
  • 8
66
votes
1 answer

What is the difference between browserify/requirejs modules and ES6 modules

I'm still new to ES6 and module loaders and I'm currently looking at combining a browserify setup with ES6. I was wondering if I would still need browserify/requirejs if I'm using ES6 modules. Seems like both allow you to define modules and export…
joerideg
  • 1,818
  • 1
  • 15
  • 18
66
votes
2 answers

using __init__.py

I am having difficulty understanding the usage scenarios or design goals of python's __init__.py files in my projects. Assume that I have 'model' directory (refers as a package) which contains the following…
user90150
66
votes
2 answers

Dynamic require in RequireJS, getting "Module name has not been loaded yet for context" error?

Is there a way to define a module that "dynamically" load other modules in RequireJS? If yes, how the optimizer (r.js) understands how/when a module has to be included? For example, let dynModules a module which defines name/path pairs: define([],…
gremo
  • 47,186
  • 75
  • 257
  • 421
66
votes
12 answers

How can I find the version of an installed Perl module?

How do you find the version of an installed Perl module? This is in an answer down at the bottom, but I figure it important enough to live up here. With these suggestions, I create a function in my .bashrc function perlmodver { perl -M$1 -e…
Drew Stephens
  • 17,207
  • 15
  • 66
  • 82
66
votes
14 answers

Adding a module (Specifically pymorph) to Spyder (Python IDE)

I have managed to get spyder installed and functioning on my mac but I want to add in a few modules that it doesn't include by default (mahotas and pymorph). I installed both via easy_install in the terminal and both seemed to install without any…
Daniel
  • 3,344
  • 5
  • 27
  • 35
65
votes
4 answers

How to import functions from different js file in a Vue+webpack+vue-loader project

I have App.vue which has a template: I've declared the isTokenAvailable method in the normal way for Vue inside methods. It uses a…
Manish Patel
  • 4,411
  • 4
  • 25
  • 48
65
votes
19 answers

Android Studio not showing modules in project structure

I am using Android studio and I want to add module to my project like "action bar Sherlock" or jar files, but when I opened the project structure there is no module or library in the menu :\ In intelij it's appearing: So what's the problem? How…
Mohamd Ali
  • 2,146
  • 4
  • 23
  • 30
64
votes
4 answers

Error: No module named 'fcntl'

I get the following error: Traceback (most recent call last): File "C:/Users/aaaa/Desktop/ttttttt.py", line 5, in import reload File "C:\Users\aaa\AppData\Local\Programs\Python\Python36\lib\site- packages\reload.py", line 3, in…
yome
  • 953
  • 2
  • 7
  • 11
64
votes
9 answers

Module is not available, misspelled or forgot to load (but I didn't)

I am fairly new to angular and using it with JSON api files. TO test, I am trying to use the free github api (my names for functions are for a different json api that i will be working with later). I just wanted to see if my functions were working…
user3606237
64
votes
5 answers

Can't load Python modules installed via pip from site-packages directory

I am trying to install and use the Evernote module (https://github.com/evernote/evernote-sdk-python) . I ran pip install evernote and it says that the installation worked. I can confirm that the evernote module exists in…
Chase McCoy
  • 1,550
  • 2
  • 13
  • 16
63
votes
2 answers

What does `__import__('pkg_resources').declare_namespace(__name__)` do?

In some __init__.py files of modules I saw such single line: __import__('pkg_resources').declare_namespace(__name__) What does it do and why people use it? Suppose it's related to dynamic importing and creating namespace at runtime.
rsk
  • 1,266
  • 1
  • 13
  • 20
62
votes
10 answers

How can my Perl script find its module in the same directory?

I recently wrote a new Perl script to kill processes based on either process name / user name and extended it using Classes so that I could reuse the process code in other programs. My current layout is - /home/mutew/src/prod/pskill <-- Perl…
aks
  • 24,359
  • 3
  • 32
  • 35