![]() ![]() %home% during setup, from which the environment definition is read by the plugin. I can define a configure function in my Python module which writes the environmental variables the an appropriate place e.g. Somewhat to my surprise, this appears to work and I can import my conda based packages without errors! Convenience We get rid of the existing environmental variables, and set the environmental variables as the conda environment requires it: import jsonįinally, with all the environmental variables in place, we start the conda interpreter. Otherwise, you'll end up importing QGIS Python packages with the other interpreter (which may give issues if they're not the same version). Given how it's configured, it's best to start another instance of the QGIS Python interpreter. However, to keep my QGIS interpreter running properly, I don't want to screw around with its environmental variables. I want to replace the QGIS environmental variables by the ones I defined before.Īny process that is started next (via e.g. How do I get the environmental variables? Well I can just start the conda environment once, and dump them in a file: import json ![]() (It could also be done with a command line script, basically an alternative version of the conda activate script, I guess.) Step one This can be achieved in other ways as well, of course, namely: Python's os.environ. It is isn't especially pretty but it does work.īasically, the conda activate call sets environment variables. I've currently resorted to asking the user to start an interpreter, and enter the port number in a field in the plugin, which are kinda ugly steps.Īlright, I think I've figured something out. I feel like there ought to be a relatively easy way to "escape" the QGIS-set environmental variables (which I'm blaming so far). So I've tried stuff like the ignore switch /i for cmd, or -UseNewEnvironment for Powershell, but to no avail (from: ). My current hypothesis is that it's the environmental variables being set when starting QGIS are somehow interfering, effectively crippling the conda environment activation. ModuleNotFoundError: No module named 'conda'Īll of the options I've tried (direct subprocess call, subprocess to intermediate Windows Batch/Powershell scripts) work fine outside of QGIS, but result in this error when tried from inside of QGIS. However, without exception, I get this error when calling activate.bat ( source activate on *nix): "c:\Miniconda3\Scripts\conda-script.py", line 11, in Start my server on localhost with a specified port, and connect.For example, a Macintosh Plus running System 7.5. Mini vMac is part of the Gryphel Project. Start the interpreter of that conda environment. Summary : The Mini vMac emulator collection allows modern computers to run software made for early Macintosh computers, the computers that Apple sold from 1984 to 1996 based upon Motorola's 680x0 microprocessors.Call the conda activate script to set the appropriate environmental variables for the conda environment via a subprocess call.Figure out the conda installation (like e.g.This works fine, I'd just like to be able to start the conda interpreter from within the QGIS GUI. QGIS can be installed via conda, but I quickly run into issues: numba-JIT doesn't work, and I think there's issues with the GIS stack (geopandas, rasterio) versus QGIS (both requiring GDAL for example).Īnyway, I have a working solution, which is to run two Python interpreters (conda
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |