Creating virtual environment failed: Exiting because of an error: exit status 1


When I try to create a virtual environment I got an error because of an exit code like this:
PS C:\DevOps\Python.ParametricDesign\RWZITank> viktor-cli.exe install
SDK version: 12.9.0 Connector version: 5.10.0
Creating app specific install dir viktor-docs
Creating app specific install dir viktor-stubs
Creating app specific install dir signals
Creating virtual environment
Error: Command ‘[‘C:\DevOps\Python.ParametricDesign\RWZITank\venv\Scripts\python.exe’, ‘-Im’, ‘ensurepip’, ‘–upgrade’, ‘–default-pip’]’ returned non-zero exit status 1.
Exiting because of an error: exit status 1

But I have no idea what is going on.

Hope to hear from you soon!

Hi Sjoerd,

Let’s check which Python your system uses, could you open a cmd terminal and give me the output of:

where python

Hi Kevin,

The results are:
C:\Users\hsc>where python

So it creates a python env based on an already installed python version? I also have miniconda installed, can I refer to this instead maybe? I don’t know if it is the ArcGIS Pro version or the windows version that is causing troubles

That’s right, the viktor-cli picks the first Python from that list. In your case, Python comes with conda / arcgis it seems. I would advise to install a regular Python version, here you can download the Windows x86-64 executable installer.

When installed, please make sure that this Python version is listed first in the Path environnment variable. In your Windows search box you can type “environment variables” and click on “Edit the system environment variables”. In the popup windows, click on “Environment Variables…”, select “Path” and click “Edit…”. Then you need to select the line with the new python installation and “Move Up” to the top. Make sure both the “…\Python37” as well as “…\Python37\Scripts” is moved to the top:

Hi Kevin,

It seems to have worked. Is the reason to use this python installer that in there the already needed python packages are available? Because I think in miniconda the default installed python packages are very limited. Is this why?
Thanks for the help!


Hi Sjoerd,

The CLI uses the Python interpreter that is found first in the PATH variable. In your case this interpreter is the one that came with ArcGIS. I can imagine that this is a non-standard version of Python to be able to work with ArcGIS. Miniconda is a Python distribution by a third-party, Anaconda, that uses Conda as a package management system. Although using this with the CLI might work, we do not actively support using Python that comes with the Anaconda/Miniconda distribution.

VIKTOR just uses plain Python and pip (the preferred package installer for Python). If you use viktor-cli install a virtual environment is created with all the packages you defined in requirements.txt by doing a pip install. You do not need to activate this environment yourself, this is handled by the CLI