Thank you Adam for your response. I have imported iface from from
qgis.utils import iface. I am working in qgis environment. It is my first
work with qgis and I am finding it difficult to understand. Can you please
share where I am going wrong? Is there any other way to activate a layer
from multiple layers and create a map? I have google street map , shape
file and dfsu file in these layers which are required to be added in the
map.
On Wed, 6 Dec 2023 at 18:10, Adam Nielsen via QGIS-User <
qgis-user@lists.osgeo.org> wrote:
> > While trying to activate with iface.setactivelayer I am facing an error.
>
> The error is complaining that iface is None. Your code doesn't show
> what value you assigned to this variable - where did you set iface and
> what value did you set it to? I think you forgot to set it and that is
> why you are getting this error.
>
> Cheers,
> Adam.
> ___
> QGIS-User mailing list
> QGIS-User@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
(base) C:\Users\FFWS>conda activate qgis
(qgis) C:\Users\FFWS>jupyter notebook
[I 2023-12-06 15:20:33.915 ServerApp] Package notebook took 0.s to import
[I 2023-12-06 15:20:33.962 ServerApp] Package jupyter_lsp took 0.0473s to import
[W 2023-12-06 15:20:33.962 ServerApp] A `_jupyter_server_extension_points`
function was not found in jupyter_lsp. Instead, a
`_jupyter_server_extension_paths` function was found and will be used for now.
This function name will be deprecated in future releases of Jupyter Server.
[I 2023-12-06 15:20:33.993 ServerApp] Package jupyter_server_terminals took
0.0269s to import
[I 2023-12-06 15:20:33.993 ServerApp] Package jupyterlab took 0.s to import
[I 2023-12-06 15:20:34.087 ServerApp] Package notebook_shim took 0.s to
import
[W 2023-12-06 15:20:34.087 ServerApp] A `_jupyter_server_extension_points`
function was not found in notebook_shim. Instead, a
`_jupyter_server_extension_paths` function was found and will be used for now.
This function name will be deprecated in future releases of Jupyter Server.
[I 2023-12-06 15:20:34.087 ServerApp] jupyter_lsp | extension was successfully
linked.
[I 2023-12-06 15:20:34.102 ServerApp] jupyter_server_terminals | extension was
successfully linked.
[I 2023-12-06 15:20:34.118 ServerApp] jupyterlab | extension was successfully
linked.
[I 2023-12-06 15:20:34.118 ServerApp] notebook | extension was successfully
linked.
[I 2023-12-06 15:20:34.477 ServerApp] notebook_shim | extension was
successfully linked.
[I 2023-12-06 15:20:34.509 ServerApp] notebook_shim | extension was
successfully loaded.
[I 2023-12-06 15:20:34.509 ServerApp] jupyter_lsp | extension was successfully
loaded.
[I 2023-12-06 15:20:34.509 ServerApp] jupyter_server_terminals | extension was
successfully loaded.
[I 2023-12-06 15:20:34.524 LabApp] JupyterLab extension loaded from
C:\Users\FFWS\anaconda3\envs\qgis\lib\site-packages\jupyterlab
[I 2023-12-06 15:20:34.524 LabApp] JupyterLab application directory is
C:\Users\FFWS\anaconda3\envs\qgis\share\jupyter\lab
[I 2023-12-06 15:20:34.524 LabApp] Extension Manager is 'pypi'.
[I 2023-12-06 15:20:34.524 ServerApp] jupyterlab | extension was successfully
loaded.
[I 2023-12-06 15:20:34.524 ServerApp] notebook | extension was successfully
loaded.
[I 2023-12-06 15:20:34.524 ServerApp] Serving notebooks from local directory:
C:\Users\FFWS
[I 2023-12-06 15:20:34.524 ServerApp] Jupyter Server 2.10.0 is running at:
[I 2023-12-06 15:20:34.524 ServerApp]
http://localhost:/tree?token=99f5ac6fd1ec2cac299b0dcc61f5392edd69a7bbed37f1eb
[I 2023-12-06 15:20:34.524 ServerApp]
http://127.0.0.1:/tree?token=99f5ac6fd1ec2cac299b0dcc61f5392edd69a7bbed37f1eb
[I 2023-12-06 15:20:34.524 ServerApp] Use Control-C to stop this server and
shut down all kernels (twice to skip confirmation).
[C 2023-12-06 15:20:34.571 ServerApp]
To access the server, open this file in a browser:
file:///C:/Users/FFWS/AppData/Roaming/jupyter/runtime/jpserver-5788-open.html
Or copy and paste one of these URLs:
http://localhost:/tree?token=99f5ac6fd1ec2cac299b0dcc61f5392edd69a7bbed37f1eb
http://127.0.0.1:/tree?token=99f5ac6fd1ec2cac299b0dcc61f5392edd69a7bbed37f1eb
[I 2023-12-06 15:20:34.665 ServerApp] Skipped non-installed server(s):
bash-language-server, dockerfile-language-server-nodejs,
javascript-typescript-langserver, jedi-language-server, julia-language-server,
pyright, python-language-server, python-lsp-server, r-languageserver,
sql-language-server, texlab, typescript-language-server,
unified-language-server, vscode-css-languageserver-bin,
vscode-html-languageserver-bin, vscode-json-languageserver-bin,
yaml-language-server
[I 2023-12-06 15:20:41.701 ServerApp] Creating new notebook in
[I 2023-12-06 15:20:48.258 ServerApp] Kernel started:
67fc13ce-4b7f-4808-88c7-72f2aff472c6
[I