Fwd: Python Error: ImportError: No module named ''folder_name’ at Command Prompt

Ernest Bonat, Ph.D. ernest.bonat at gmail.com
Sun Jul 12 06:02:49 CEST 2015


Thanks for your help. I had follow the link: How to add a Python module
to syspath?

<http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
>
and I could not make it work. I did use sys.path.insert() and
sys.path.append() as:

Examples: sys.path.append('/python_mvc_calculator/calculator/') or
sys.path.insert(0, "/python_mvc_calculator/calculator")

I did try it to:
sys.path.append('/python_mvc_calculator/calculator/controller') or
sys.path.insert(0, "/python_mvc_calculator/calculator/controller") too!

The main.py file is in python_mvc_calculator/calculator folder and I
need to import a module calculatorcontroller.py in
"python_mvc_calculator/calculator/controller"

I hope this explanation helps a bit!

<http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
>

Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer | Senior Data Analyst
Visual WWW, Inc. | President and CEO
115 NE 39th Avenue | Hillsboro, OR 97124
Cell: 503.730.4556 | Email: ernest.bonat at gmail.com
<mailto:ernest.bonat at gmail.com>

/The content of this email is confidential. It is intended only for the
use of the persons named above. If you are not the intended recipient,
you are hereby notified that any review, dissemination, distribution or
duplication of this communication is strictly prohibited. If you are not
the intended recipient, please contact the sender by reply email and
destroy all copies of the original message./
---------- Forwarded message ----------
From: Terry Reedy <tjreedy at udel.edu>
Date: Sat, Jul 11, 2015 at 8:59 PM
Subject: Re: Python Error: ImportError: No module named ''folder_name’ at
Command Prompt
To: "Ernest Bonat, Ph.D." <ernest.bonat at gmail.com>


Please send this followup to python-list.

On 7/11/2015 11:26 PM, Ernest Bonat, Ph.D. wrote:

> Hey Terry,
>
> Thanks for your help. I had follow the link: How to add a Python module
> to syspath?
> <
> http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
> >
> and I could not make it work. I did use sys.path.insert() and
> sys.path.append() as:
>
> Examples: sys.path.append('/python_mvc_calculator/calculator/') or
> sys.path.insert(0, "/python_mvc_calculator/calculator")
>
> I did try it to:
> sys.path.append('/python_mvc_calculator/calculator/controller') or
> sys.path.insert(0, "/python_mvc_calculator/calculator/controller") too!
>
> The main.py file is in python_mvc_calculator/calculator folder and I
> need to import a module calculatorcontroller.py in
> "python_mvc_calculator/calculator/controller"
>
> I hope this explanation helps a bit!
>
> <
> http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
> >
>
> Thanks
>
> Ernest Bonat, Ph.D.
> Senior Software Engineer | Senior Data Analyst
> Visual WWW, Inc. | President and CEO
> 115 NE 39th Avenue | Hillsboro, OR 97124
> Cell: 503.730.4556 | Email: ernest.bonat at gmail.com
> <mailto:ernest.bonat at gmail.com>
>
> /The content of this email is confidential. It is intended only for the
> use of the persons named above. If you are not the intended recipient,
> you are hereby notified that any review, dissemination, distribution or
> duplication of this communication is strictly prohibited. If you are not
> the intended recipient, please contact the sender by reply email and
> destroy all copies of the original message./
>
> On Sat, Jul 11, 2015 at 5:02 PM, Terry Reedy <tjreedy at udel.edu
> <mailto:tjreedy at udel.edu>> wrote:
>
>     On 7/11/2015 11:15 AM, Ernest Bonat, Ph.D. wrote:
>
>         Hi All,
>
>
>         I’m doing a CSV data analysis in Python using Eclipse IDE/PyDev.
>         I have
>         organized my project using the standard MVC architecture. In
>         Eclipse IDE
>         everything is working properly. When I run my main.py file it at
>         Command
>         Prompt I got an error: ImportError: No module named
>         'folder_name'. It’s
>         like the location path of the ‘'folder_name’ was not found. Do I
>         need to
>         update my main.py file to run it at the Command Prompt?
>
>
>     'import module' searches directories on sys.path for a file or
>     directory named 'module'.  sys.path starts with '.', which
>     represents the 'current' directory. If you start with the directory
>     containing main.py as current directory and 'folder-name' is in the
>     same directory, the import should work.  Otherwise ??? EclipseIDE
>     probably modifies the current dir and/or path to make things work.
>
>     For any more help, post the OS and locations of main.py,
>     folder_name, and python.
>
>     --
>     Terry Jan Reedy
>
>
>     --
>     https://mail.python.org/mailman/listinfo/python-list
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150711/b948eb99/attachment.html>


More information about the Python-list mailing list