Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If adding your module folder to the PYTHONPATH didn't work, You can modify the <strong>sys.path</strong> list in your program where the Python interpreter searches for the modules to import, the <a href="http://docs.python.org/tutorial/modules.html#the-module-search-path">python documentation</a> says:</p> <blockquote> <p>When a module named <strong>spam</strong> is imported, the interpreter first searches for a built-in module with that name. If not found, it then searches for a file named <strong>spam.py</strong> in a list of directories given by the variable sys.path. sys.path is initialized from these locations:</p> <blockquote> <ul> <li>the directory containing the input script (or the current directory).</li> <li>PYTHONPATH (a list of directory names, with the same syntax as the shell variable PATH).</li> <li>the installation-dependent default.</li> </ul> <p>After initialization, Python programs can modify <strong>sys.path</strong>. The directory containing the script being run is placed at the beginning of the search path, ahead of the standard library path. This means that scripts in that directory will be loaded instead of modules of the same name in the library directory. This is an error unless the replacement is intended. </p> </blockquote> </blockquote> <p>Knowing this, you can do the following in your program:</p> <pre><code>import sys # Add the ptdraft folder path to the sys.path list sys.path.append('/path/to/ptdraft/') # Now you can import your module from ptdraft import nib # Or just import ptdraft </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload