Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; 'subject:Error': 0.07; 'subject:module': 0.09; 'python': 0.10; '__init__.py': 0.16; 'examples:': 0.16; 'folder,': 0.16; 'from:name:vincent vande vyvre': 0.16; 'received:195.130': 0.16; 'received:195.130.137': 0.16; 'received:telenet-ops.be': 0.16; 'subject:\x92 ': 0.16; '\xe9crit': 0.16; 'skip:" 30': 0.20; 'skip:" 40': 0.20; 'init': 0.22; 'ph.d.': 0.22; 'help.': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'module': 0.25; 'header:User-Agent:1': 0.26; 'work.': 0.30; 'folder': 0.30; 'received:be': 0.30; 'foo': 0.33; 'file': 0.34; 'add': 0.34; 'could': 0.35; 'skip:s 60': 0.35; 'skip:p 30': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'skip:s 50': 0.37; 'to:addr:python.org': 0.40; 'your': 0.60; 'hope': 0.61; 'charset:windows-1252': 0.62; 'header:Reply-To:1': 0.67; 'link:': 0.69; 'reply-to:no real name:2**0': 0.71; 'as:': 0.79 Date: Sun, 12 Jul 2015 07:50:57 +0200 From: Vincent Vande Vyvre Reply-To: vincent.vandevyvre@oqapy.eu User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: python-list@python.org Subject: =?windows-1252?Q?Re=3A_Fwd=3A_Python_Error=3A_ImportErro?= =?windows-1252?Q?r=3A_No_module_named_=27=27folder=5Fname=92_a?= =?windows-1252?Q?t_Command_Prompt?= References: <55A1E620.7070507@udel.edu> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1436680979 news.xs4all.nl 2868 [2001:888:2000:d::a6]:55526 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 4359 X-Received-Body-CRC: 3376587105 Path: csiph.com!usenet.pasdenom.info!news.stben.net!border1.nntp.ams1.giganews.com!nntp.giganews.com!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:93720 Le 12/07/2015 06:02, Ernest Bonat, Ph.D. a écrit : > Thanks for your help. I had follow the link: 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! > > > > Thanks > If "/python_mvc_calculator/calculator/controller" is a folder and if you have a file __init__.py into this folder, you have to use: sys.path.insert(0, "/python_mvc_calculator/calculator/controller") from calculatorcontroller import foo # or import calculatorcontroller But the init file must be named __init__.py NOT init.py as sayed in askubuntu. Vincent