Python Script failing on pycryptodome

First time using Python from the Script step. So I’m pretty sure I’m doing something wrong. But not sure what.

Octopus 2019.13.7
We setup a tentacle on Windows Server 2019 (1809) in listening mode. Latest Calamari is on it 5.0.12.

But when we use the Script Step, select Python3 and put ‘print(“Hello world”)’ for the inline script we get the following in deploy logs:

When a script or process writes to error out on Windows 2019 (1809) with .NET 4.7.2 , PowerShell may terminate it immediately without allowing further code execution. This also causes only part of the error output to be shown.. Install .NET 4.8 or later to resolve this problem. More information. 
Looking in indexes: https://formsauth-packages.afcorp.afg/pypi/import-pypi/ 
Collecting pycryptodome 
Calamari.exe :   ERROR: Could not find a version that satisfies the requirement pycryptodome (from versions: none) 
At E:\OctopusStorage\Work\20200527215351-175341-7\Bootstrap.ps1:38 char:1 
+ &  "${env:TentacleHome}\Calamari\9.0.5\Calamari.exe" run-script -sens ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo          : NotSpecified: (  ERROR: Could ...versions: none):String) [], RemoteException 
    + FullyQualifiedErrorId : NativeCommandError 
 
ERROR: No matching distribution found for pycryptodome 
Unable to install package pycryptodome using pip. 
If you do not have pip you can install pycryptodome using your favorite python package manager. 
The remote script failed with exit code 1 
The action testing python on a Worker failed 

We just put Python 3.8.3 on the server, restarted the tentacle and ran the following via the script console to ensure Python and pip are available:

python --version
pip --version

With the following output from that script console:

When a script or process writes to error out on Windows 2019 (1809) with .NET 4.7.2 , PowerShell may terminate it immediately without allowing further code execution. This also causes only part of the error output to be shown.. Install .NET 4.8 or later to resolve this problem. More information. 
Python 3.8.3 
pip 19.2.3 from c:\program files (x86)\python38-32\lib\site-packages\pip (python 3.8) 

The docs say pip must be installed or that pycryptodome package be installed. But pip is installed and available.

Any ideas on how to resolve that error?

Hi David,

Thanks for getting in touch and providing a great level of detail! Calamari is reporting no version of pip being available, so the first question that came to mind is if pip is available specifically to the user that the Tentacle is running as?

I look forward to hearing back. :slight_smile:

Best regards,

Kenny

I believe it is. I had run pip --version from the Octopus Deploy Script Console against that target and got the response above giving the version of pip installed.

I also ran (in the Octopus script console):

Get-Command pip | Select Name,Source
$ENV:PATH -split ';'

Giving the following result:

pip.exe C:\Program Files (x86)\Python38-32\Scripts\pip.exe 
C:\Program Files (x86)\Python38-32\Scripts\ 
C:\Program Files (x86)\Python38-32\ 
C:\Windows\system32 
C:\Windows 
C:\Windows\System32\Wbem 
C:\Windows\System32\WindowsPowerShell\v1.0\ 
C:\Windows\System32\OpenSSH\ 
C:\Users\[redacted]\AppData\Local\Microsoft\WindowsApps 
E:\Tools 

Wait, nevermind. This looks to be a problem with our private Pip repository. Just tried pip download pycryptodome locally and it worked fine until I pointed Pip to our private feed.

I was misreading the Tentacle requirements for Python usage. I was thinking pip being available meant it didn’t need pycryptodome. But now I understand what that requirement means.

Thanks for taking a look into it. Hope you have a great day.

Hi David,

Thanks for keeping in touch and letting me know the outcome here! You’re quite welcome, and please don’t hesitate to reach out if you have any questions or concerns in the future. :slight_smile:

Best regards,

Kenny

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.