Note that there are some explanatory texts on larger screens.

plurals
  1. POPythonpath is not working for me
    text
    copied!<p>So I've been working the last exercise of <a href="http://learnpythonthehardway.org/book/ex52.html" rel="nofollow">Learn Python the Hard Way</a> and it states that before I run the program Ive been working on, you have to set the Pythonpath environment variable like this:</p> <pre><code>export PYTHONPATH=$PYTHONPATH:. </code></pre> <p>I've done this, and after it wasn't working (Im assuming thats why when I try to run my program, I get an ImportError), I did some research on pythonpath. It's essentially says that Pythonpath is to find where to look for modules to import. So I set Pythonpath to the actual location of the module I'm trying to import and still to no avail.</p> <p>Here's my directory:</p> <ul> <li>User/<em>myname</em>/python_stuff/projects/GothonWeb <ul> <li>bin/ <ul> <li>init.py (with the double underscores, of course.)</li> <li>app.py</li> </ul></li> <li>gothonweb/ <ul> <li>init.py (with the double underscores, of course.)</li> <li>maps.py</li> </ul></li> <li>templates (web.py) <ul> <li>game.html</li> <li>index.html</li> <li>layout.html</li> </ul></li> <li>so forth and so on.</li> </ul></li> </ul> <p>Im trying to run the app.py, which tries to import the main.py module:</p> <pre><code>from gothonweb import maps </code></pre> <p>But I still get this error:</p> <pre><code>Traceback (most recent call last): File "python_stuff/projects/GothonWeb/bin/app.py", line 2, in &lt;module&gt; from gothonweb import maps ImportError: No module named gothonweb </code></pre> <p>Anyone know whats up? Oh, some other details. Running on Python 2.7 on Mac Os X Lion, if that helps any.</p>
 

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