<div dir="ltr"><div dir="ltr">Il giorno mer 3 ott 2018 alle ore 02:51 John Walker <<a href="mailto:jdkwalker21@gmail.com">jdkwalker21@gmail.com</a>> ha scritto:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi, would anyone know how to configure Spyder to work with the QGIS library? I am finding the python editor in QGIS difficult to work with because it has no debugger and I cannot run highlighted code. I have tried a few things:<div><br></div><div>1. created a new conda environment and installed QGIS via conda using: <span class="gmail-m_-6856847661130539576gmail-pln">conda install </span><span class="gmail-m_-6856847661130539576gmail-pun">-</span><span class="gmail-m_-6856847661130539576gmail-pln">c conda</span><span class="gmail-m_-6856847661130539576gmail-pun">-</span><span class="gmail-m_-6856847661130539576gmail-pln">forge qgis. However I get errors when trying to import qgis.core</span></div><div><span class="gmail-m_-6856847661130539576gmail-pln"><br></span></div><div><span class="gmail-m_-6856847661130539576gmail-pln">2. installed Spyder within OSGeo4W QGIS python instance i.e.</span></div><div><span class="gmail-m_-6856847661130539576gmail-pln"><pre class="gmail-m_-6856847661130539576gmail-lang-py gmail-m_-6856847661130539576gmail-prettyprint gmail-m_-6856847661130539576gmail-prettyprinted"><code><span class="gmail-m_-6856847661130539576gmail-pln">py3</span><span class="gmail-m_-6856847661130539576gmail-pun">-</span><span class="gmail-m_-6856847661130539576gmail-pln">env
python </span><span class="gmail-m_-6856847661130539576gmail-pun">-</span><span class="gmail-m_-6856847661130539576gmail-pln">m pip install spyder</span></code></pre><pre class="gmail-m_-6856847661130539576gmail-lang-py gmail-m_-6856847661130539576gmail-prettyprint gmail-m_-6856847661130539576gmail-prettyprinted"><span style="font-family:Arial,Helvetica,sans-serif;white-space:normal">But this gives errors in the IPython console i.e.</span></pre><pre class="gmail-m_-6856847661130539576gmail-lang-py gmail-m_-6856847661130539576gmail-prettyprint gmail-m_-6856847661130539576gmail-prettyprinted"><pre class="gmail-m_-6856847661130539576gmail-lang-py gmail-m_-6856847661130539576gmail-prettyprint gmail-m_-6856847661130539576gmail-prettyprinted"><code><span class="gmail-m_-6856847661130539576gmail-typ">SyntaxError</span><span class="gmail-m_-6856847661130539576gmail-pun">:</span><span class="gmail-m_-6856847661130539576gmail-pln"> invalid syntax
</span><span class="gmail-m_-6856847661130539576gmail-typ">File</span><span class="gmail-m_-6856847661130539576gmail-pln"> </span><span class="gmail-m_-6856847661130539576gmail-str">"C:\OSGEO4~1\apps\Python36\lib\site.py"</span><span class="gmail-m_-6856847661130539576gmail-pun">,</span><span class="gmail-m_-6856847661130539576gmail-pln"> line </span><span class="gmail-m_-6856847661130539576gmail-lit">177</span><span class="gmail-m_-6856847661130539576gmail-pln">
file</span><span class="gmail-m_-6856847661130539576gmail-pun">=</span><span class="gmail-m_-6856847661130539576gmail-pln">sys</span><span class="gmail-m_-6856847661130539576gmail-pun">.</span><span class="gmail-m_-6856847661130539576gmail-pln">stderr</span><span class="gmail-m_-6856847661130539576gmail-pun">)</span></code></pre><pre class="gmail-m_-6856847661130539576gmail-lang-py gmail-m_-6856847661130539576gmail-prettyprint gmail-m_-6856847661130539576gmail-prettyprinted"><span style="font-family:Arial,Helvetica,sans-serif;white-space:normal">Thanks for any help.</span></pre><pre class="gmail-m_-6856847661130539576gmail-lang-py gmail-m_-6856847661130539576gmail-prettyprint gmail-m_-6856847661130539576gmail-prettyprinted"></pre></pre><pre class="gmail-m_-6856847661130539576gmail-lang-py gmail-m_-6856847661130539576gmail-prettyprint gmail-m_-6856847661130539576gmail-prettyprinted"></pre></span></div></div><br></blockquote><div><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">You could try the bat in this repository:</div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"><a href="https://github.com/frankbroniewski/visual-studio-code-qgis">https://github.com/frankbroniewski/visual-studio-code-qgis</a><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">simply change in the last line of the bat from "code.exe" (this is the Visual Studio Code IDE) with the exe of your IDE.</div></div></div></div>