Installation of app fails

Hi there,

While installing an app (venv version), something did not work whie installing shapely (v1.7.0). I restarted my pc, now the following messages show when installing my app:

SDK version: 13.1.0 Connector version: 5.13.0
Creating app specific install dir viktor-docs
Creating app specific install dir viktor-stubs
Creating app specific install dir signals
Creating virtual environment
Exiting because of an error: installation of the app failed

Before restarting my pc I got an error saying that shapely could not get installed due to go.dll (this definitely has a typo, writing this from memory).

What should I do to correctly install my app?

Hi Fokke,

Could you share the contents of your requirements.txt?

What python version are you using? (output of python -c "import sys;print(sys.version)")

Im using python version 3.10.4. Should I downgrade to 3.7?

I don’t think that is necessary. Just to make sure; the error occurs after Creating virtual environment is printed and you don’t see any pip related commands that the install of dependencies is happening?

Could you try to manually remove the venv folder from the app folder and after that manually creating the virtual environment. You can do that by opening a command prompt inside the app folder and executing the command python -m venv venv. Does this create the virtual environment folder without errors?

Yes, the error occurs after “Creating virtual environment” is printed. Earlier, I did see pip related commands, now there are none.

The virtual environment folder is created without errors. It is in the folder and not in the “app” folder.

Does installation of the dependencies from requirements.txt into the create virtual environment cause any errors?

In command prompt to activate the venv:

venv\Scripts\activate.bat

or Powershell:

 venv\Scripts\Activate.ps1

In both cases followed by:

pip install -r requirements.txt

(you can deactivate the virtual environment by typing deactivate

This does not work: Access is denied.

Trying powershell, I cannot create the virtual environment:

"Scripts\Activate.ps1 : File C:\Users\kt33\viktor-app-starter\APP\venv\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?L
inkID=135170.
At line:1 char:1
+ Scripts\Activate.ps1
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess"

This happens even when I have powershell opened as administrator. Would this mean our digital infrastructure does not allow activating .bat scripts?

This happens even when I have powershell opened as administrator. Would this mean our digital infrastructure does not allow activating .bat scripts?

That might be the case. It should be quite straightforward to check by creating a dummy .bat or .ps1 file and trying to execute that.

A dummy gives the same error message. I’ll ask our tech support whether they can help me further.

Allright, the app can install now. However, when installing shapely the following error occurs:

Collecting shapely==1.7.0
  Using cached Shapely-1.7.0.tar.gz (349 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  Ă— python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\kt33\AppData\Local\Temp\pip-install-5c197azp\shapely_510bf7a2728142ad83582bd3c406cb77\setup.py", line 85, in <module>
          from shapely._buildcfg import geos_version_string, geos_version, \
        File "C:\Users\kt33\AppData\Local\Temp\pip-install-5c197azp\shapely_510bf7a2728142ad83582bd3c406cb77\shapely\_buildcfg.py", line 205, in <module>
          lgeos = CDLL("geos_c.dll")
        File "C:\Users\kt33\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 374, in __init__
          self._handle = _dlopen(self._name, mode)
      FileNotFoundError: Could not find module 'geos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Ă— Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Exiting because of an error: installation of the app failed

This was the error message mentioned earlier.

Using a newer versions of numpy and shapely solved the problem.