1

I've been adding modules to my library so I may call them for future use but when I write a new module and run that module the compiler does not recognize module unpackapp. For example, I call:

from unpackapp import UnpackApp

Compiler states: "ImportError: No module named unpackapp"

I'm saving to: Python27/Lib

Am I storing my custom modules in the right folder?

2
  • 4
    Uh, we don't know. Mostly because we don't know what folder they're in in the first place. Commented Mar 1, 2012 at 0:06
  • is Python27/Lib in your $PYTHONPATH? Commented Mar 1, 2012 at 0:19

2 Answers 2

1

Look into using setup tools and installing using:

python setup.py develop

If you don't want or need the overhead of setuptools, you can update sys.path to reflect where your module can be imported from:

import sys
sys.path.insert(0. "/path/to/your/module.py's/containing/directory")

You can also use "." for a path to refer to the current working directory.

Sign up to request clarification or add additional context in comments.

Comments

0

try this :

python setup.py install

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.