<div dir="ltr">Xin, <div><br></div><div>Unless you have modified your PYTHONPATH variable or your site-packages settings, this command: </div><div><br></div><div>python setup.py install --user </div><div><br></div><div>will not actually install petsc4py in a location visible to your Python installation.  Unfortunately, the Python procedures and documentation for "user-local" installations are fairly poor in comparison to the rest of Python's friendliness.  I rely on virtualenv to set up an environment that I can just "pip install" into.  I recommend using virtualenv, as properly using it can save you a lot of headaches when developing in Python.  See this answer on StackExchange to understand how to get set up with virtualenv:</div>
<div><br></div><div><a href="http://stackoverflow.com/a/5177027/122022">http://stackoverflow.com/a/5177027/122022</a></div><div><br></div><div>Once you have created a virtualenv, you can then cd into the directory of code you'd like to use and type:</div>
<div><br></div><div>pip install -e .</div><div><br></div><div>This allows you to modify the code and have those changes reflected when you reload the virtual environment's Python interpreter.</div><div><br></div><div>
If you just need to install once, you can just do:</div><div><br></div><div>pip install .</div><div><br></div><div>or</div><div><br></div><div>python setup.py install</div><div><br></div><div>And the package will be installed into the virtual environment, though you will need to re-install if you make any changes.</div>
<div><br></div><div>Hope this helps,</div><div>Aron</div><div><br><div class="gmail_quote">On Mon, Jul 2, 2012 at 4:25 PM, Xin Zhao <span dir="ltr"><<a href="mailto:sean.null@gmail.com" target="_blank">sean.null@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jed,<div><br></div><div>I've add the code to petsc4py and then</div><div>I typed in terminal:</div><div>python setup.py build</div>
<div>python setup.py install --user</div><div><br></div><div><br></div><div>But I still can not find the method Vec.setMPIGhost().</div>

<div><br></div><div>I know the question is stupid, but I really need your help.</div><div><br></div><div><br></div><div>Regards,</div><div>Xin<div><div class="h5"><br><br><div class="gmail_quote">On Mon, Jul 2, 2012 at 10:42 AM, Din Zhao <span dir="ltr"><<a href="mailto:sean.null@gmail.com" target="_blank">sean.null@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF"><div>Thank you all.</div><div><div><div><br><br></div><div><br>On Jul 2, 2012, at 2:55 AM, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>> wrote:<br>


<br></div><div></div><blockquote type="cite"><div><div class="gmail_quote">No, but you can use Vec.createGhost()</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Sun, Jul 1, 2012 at 5:22 PM, Din Zhao <span dir="ltr"><<a href="mailto:sean.null@gmail.com" target="_blank">sean.null@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">And in general, does any function in petsc have a counterpart in petsc4py?<br></blockquote><div><br></div><div>Most do, but the projects are maintained somewhat separately so not every one make it into petsc4py. Also, sometimes a more "pythonic" interface is adopted by petsc4py, so the calls don't line up exactly.</div>



</div>
</div></blockquote></div></div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div>

<br>
<div><hr></div><font face="Arial" size="1">This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.</font>